Home > Article > Backend Development > What is the extension name of python program file
What is the extension name of python program file
The extension name of python program is .py, .pyc, .pyo and .pyd. .py is the source file, .pyc is the compiled source file, .pyo is the source file optimized and compiled, and .pyd is a python library written in other languages.
Extension
The common extensions we use when writing Python programs are py and pyc. In fact, there are several other extensions. The following are the usages of several extensions.
py: py is the most basic source code extension. Directly double-clicking to run under windows will call python.exe for execution.
pyw: pyw is another source code extension. The only difference from py is that double-clicking the source code of the pyw extension under Windows will call pythonw.exe to execute the source code. This execution method There will be no command line window. Mainly used when publishing GUI programs without seeing console information.
pyc: When executing python code, you will often see a pyc file with the same name automatically generated in the same directory. This is the compiled bytecode of python source code. Generally, the pyc file of the py file referenced in your code will be automatically generated when the code is executed. This file can be executed directly, and the source code cannot be seen when opened with a text editor.
pyo: pyo is an optimized and encoded file similar to pyc.
pyd: pyd is not generated from a python program, but an extension written in other languages that can be called by python.
Recommended learning: Python video tutorial
The above is the detailed content of What is the extension name of python program file. For more information, please follow other related articles on the PHP Chinese website!