py文件生成pyo文件 对于Python 3.5及以上版本,可以使用如下命令: python -O -m compileall file.py 注意事项 Windows平台下,此命令不会报错,但也不会生成pyo文件