【Python】py编译pyc
有多种方法,作者常用办法:
1 2 |
import py_compile py_compile.compile('SendM.py') |
例:
1 2 3 4 5 6 7 8 |
C:\SendMail\tool>python Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import py_compile >>> py_compile.compile('mconfpwd.py') '__pycache__\\mconfpwd.cpython-36.pyc' >>> |