python -O -m py_compile file.py
-O 优化成字节码
-m 表示把后面的模块当成脚本运行
-OO 表示优化的同时删除文档字符串
也可以写一个脚本来实现:
import py_compile
py_compile.compile("file_path")
python -O -m py_compile file.py
import py_compile
py_compile.compile("file_path")
繼續運行 ?* 回憶上次內容 上次使用shell環境中的命令 命令 作用 c