Python Module Py_compile usage (convert py file to PYc file)

Source: Internet
Author: User

#-*-coding:cp936-*-#python#Xiaodeng#Python module Py_compile usage (convert py file to PYc file)#Binary files, which are generated by the Py file after compilation." "import py_compile# without escape rpy_compile.compile (' D:\test.py ') Traceback (most recent call last): File "<pyshell#1> ", line 1, <module> py_compile.compile (' D:\test.py ') File" C:\Python27\lib\py_compile.py ", line 106, in Compi Le with open (file, ' U ') as f:ioerror: [Errno] Invalid mode (' u ') or filename: ' D:\test.py ' #加r前缀py_compile. Compile (R ') D:\test.py ') #py文件完整的路径." "#cmd command operation modePython-m Py_compile Test.pypython-m Py_compile D:\test.pypython-M py_compile/root/src/{file1,file2}.py#- m is equivalent to the import in the script, where the-M py_compile is equivalent to the import py_compile

Python Module Py_compile usage (convert py file to PYc file)

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.