I got module name which contains declaration of os.path.isfile
. Jedi lib gave me genericpath
(without file path). Now i want to get full filename of PY file with this genericpath
module. E.g. "C:\Py27\Lib\genericpath.py". How can I do it? Jedi cannot do it?
Like this:
>>> import re
>>> re.__file__
'/usr/lib/python2.7/re.pyc'
For packages that are not part of the Python core, you can also use __path__
:
>>> import requests
>>> requests.__file__
'/usr/local/lib/python2.7/dist-packages/requests-1.1.0-py2.7.egg/requests/__init__.pyc'
>>> requests.__path__
['/usr/local/lib/python2.7/dist-packages/requests-1.1.0-py2.7.egg/requests']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With