模块优化 *.pyc 命令:python - m py_comple file.py 脚本: import py_compile py_compile.compile('module.py' , 'module.pyc') *.pyo 或 opt 命令:python - O - m py_compile module.py