Computer >> Computer tutorials >  >> Programming >> Python

What do the python file extensions, .pyc .pyd .pyo stand for?


The .py, .pyc, .pyo and .pyd files have their own significance when it comes to executing python programs. The are used for −

  • .py: The input source code that you've written.

  • .pyc: The compiled bytecode. If you import a module, python will build a *.pyc file that contains the bytecode to make importing it again later easier (and faster).

  • .pyo: A *.pyc file that was created while optimizations (-O) was on.

  • .pyd: A windows dll file for Python. https://docs.python.org/faq/windows.html#is-a-pyd-file-the-same-as-a-dll