What is the pyc of Python's basic knowledge?

Source: Internet
Author: User

PYC file

PYC is compiled by the py file after the binary file, the py file becomes PYc file, the speed of loading increased, and PYC is a cross-platform bytecode, is executed by Python virtual machine. PYC content, is related to Python version, the different version of the compiled PYc file is different, 2.5 compiled PYC files, 2.4 version of Python is not executable. PYC files can also be deserialized, and different versions of the compiled PYC files are different.

How to compile into a PYC file that can be run
2.7.1 (r271:8683227201018:30:46) [MSC v.150032"help""copyright""credits"or"license"for more information.>>>import py_compile>>> py_compile.compile("D:/test.py")>>>

Batch compilation only needs to enter the corresponding directory name

You can now see that the PYc file was produced in the corresponding directory
The PYc file is a byte code that is used to save the build of a Python virtual machine. In the run of Python, if you encounter import, first look for the corresponding. pyc or. dll file in the set path. If you do not have these files, compile the corresponding pycodeobject and wear the. pyc file to write intermediate results.

What is the pyc of Python's basic knowledge?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.