私はwinシステムで作業していますが、cmd行で実行できるpythonスクリプトを使用してpyファイルを大量コンパイルする方法を知りたいです。簡単なpythonコードを書きました。
import py_compile, os, glob
dir = 'D:\\FAS\\config'
for f in glob.glob(dir + '\\*.py'):
py_compile.compile(f)
print "Success compile the file: %s" % f
動作が不便で、フォルダーのサブフォルダーにあるファイルをコンパイルできません。あなたの助けを願っています。