在E盘下有个aa.py文件。
我们可以建立一个脚本:
1 import py_compile 2 py_compile.compile(r"E:\aa.py")
可以将aa.py编译成aa.pyc,放在相同的目录下。