import py_compile # 源文件,编译后的文件 py_compile.compile(‘QtPythonPrj.py‘, ‘D:/pythonPrj/QtPythonPrj.pyc‘, None, False, -1)
QT应用(13)-从.py到生成 .pyc文件
原文:https://www.cnblogs.com/jasmineTang/p/14401827.html