How to compile all py file to pyc file in a folder by writing a python script?
<p>I work on win system, and I wonder a way that I can use a python script which could run in cmd lines to mass compile the py files.
I have write a simple python code.</p>

<pre><code>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
</code></pre>

<p>It work inconveniently and can not compile the file in the folder's sub-folder. I hope your help.</p>
