What do these python file extensions mean?
.pyc.pyd.pyo
What are the differences between them and how are they generated from a *.py file?
On
.py : The input source code that you have written.
.pyc : The compiled bytecode. If you import a module, python will build a .pyc
a file that contains the bytecode to make importing it again later easier(and
faster).
.pyo : A .pyc file that was created while optimizations (-O) were on.
.pyd : A windows DLL file for python.
On
cimports.includes.sys.path. See site module.pipA larger list of additional Python file-extensions (mostly rare and unofficial) can be found at http://dcjtech.info/topic/python-file-extensions/
.py: This is normally the input source code that you've written..pyc: This is the compiled bytecode. If you import a module, python will build a*.pycfile that contains the bytecode to make importing it again later easier (and faster)..pyo: This was a file format used before Python 3.5 for*.pycfiles that were created with optimizations (-O) flag. (see the note below).pyd: This is basically a windows dll file. http://docs.python.org/faq/windows.html#is-a-pyd-file-the-same-as-a-dllAlso for some further discussion on
.pycvs.pyo, take a look at: http://www.network-theory.co.uk/docs/pytut/CompiledPythonfiles.html (I've copied the important part below)Note:
On 2015-09-15 the Python 3.5 release implemented PEP-488 and eliminated
.pyofiles. This means that.pycfiles represent both unoptimized and optimized bytecode.