Home > Backend Development > Python Tutorial > What is the extension of python script file

What is the extension of python script file

hzc
Release: 2020-07-01 15:03:41
Original
16247 people have browsed it

The extension of python script file is: 1. [.py], py is the most basic source code extension; 2. [.pyw], pyw is another source code extension; 3. [. pyc], which is the compiled bytecode of Python source code.

What is the extension of python script file

The extensions of python programs are .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 does not have a command line window. . Mainly used when publishing GUI programs without seeing console information.

pyc: When executing python code, you often see pyc files 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 tutorial: "Python Tutorial"

The above is the detailed content of What is the extension of python script file. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template