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?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
.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.