{"id":593,"date":"2011-10-03T09:54:45","date_gmt":"2011-10-03T09:54:45","guid":{"rendered":"https:\/\/fir3netwp.gmsrrpobkbd.com\/2011\/10\/03\/how-do-i-print-the-path-of-a-python-module\/"},"modified":"2021-07-24T18:25:55","modified_gmt":"2021-07-24T18:25:55","slug":"how-do-i-print-the-path-of-a-python-module","status":"publish","type":"post","link":"https:\/\/www.fir3net.com\/Programming\/Python\/how-do-i-print-the-path-of-a-python-module.html","title":{"rendered":"How do I print the path of a Python module ?"},"content":{"rendered":"
To print the path of python module the command print [module].__file__<\/span>. An example is shown below:<\/p>\n [root@webserver1 ~]# python To print the path of python module the command print [module].__file__. An example is shown below: [root@webserver1 ~]# pythonPython 2.4.3 (#1, Sep 21 2011, 19:55:41)[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2Type “help”, “copyright”, “credits” or “license” for more information.>>> import pexpect>>> print pexpect.__file__\/usr\/lib\/python2.4\/site-packages\/pexpect.pyc<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[36],"tags":[],"yoast_head":"\n
Python 2.4.3 (#1, Sep 21 2011, 19:55:41)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.
>>> import pexpect<\/span><\/strong>
>>> print pexpect.__file__<\/span><\/strong>
\/usr\/lib\/python2.4\/site-packages\/pexpect.pyc<\/p>\n","protected":false},"excerpt":{"rendered":"