生成.pyc 文件的方法:
编译一个.py文件成为.pyc:
1 2 3 |
python >>>import py_compile >>>py_compile.compile('abc.py') |
把整个文件夹下的所有.py文件编译为.pyc, 注意后面有个. 号表示当前目录:
1 |
python -m compileall . |
人生没有原因,闯出一路精彩
生成.pyc 文件的方法:
编译一个.py文件成为.pyc:
1 2 3 |
python >>>import py_compile >>>py_compile.compile('abc.py') |
把整个文件夹下的所有.py文件编译为.pyc, 注意后面有个. 号表示当前目录:
1 |
python -m compileall . |