If I import os
module, I can run the following to infer the location of os.py
>>> import os
>>> print os.__file__
/usr/lib/python2.6/os.pyc
However, when I import posix
, it does not have the __file__
attribute. Is it because it is implemented as a part of the python runtime, not as a standard library?
How can I find out more information like this using solely the python official documentation?
It's a C module. It can be either built into the Python binary or compiled as a shared library. In your case it is compiled in
The official docs say not to import it directly, and you should use the functionality provided via os
Run python interactively.
>>> import posix
>>> help(posix)
There's a lot of good stuff there.
FILE
(built-in)
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