In ruby the library path is provided in $:
, in perl it's in @INC
- how do you get the list of paths that Python searches for modules when you do an import?
You can also make additions to this path with the PYTHONPATH environment variable at runtime, in addition to:
import sys sys.path.append('/home/user/python-libs')
I think you're looking for sys.path
import sys print (sys.path)
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