Various file extensions in Python: Here follows a list of Python file extensions. I request the readers to add any more missing file extensions, related to python environment. file extension Description .py regular python source code script .pyc compiled Bytecode Script .pyo optimized .pyc script, resulted when the invoked with -O option .pyw Python script for Windows. It is executed with pythonw.exe. Useful in cases where the script need to be executed in the background, without resulting in console output .pyd Python script, as a Windows DLL file. Useful when we dont want to reveal the source code, but only the application to the client .pxd Cython script, which is equivalent to a C/C++ header .pyx Cython source code which is to be converted to C/C++ .pth used to add import path for site-packages .py3 (rarely used) Python3 script. In general, Python3 scripts usually end with ".py" not ".py3" .pyz ...