自己在Eclipse里写的py文件一直都在那,但是看到别的地方都有pyc文件心里痒痒。
python2.2
>>> imp
>>> py_compile.compile('xxx.py')
python2.4 later
#生成pyc
python -m py_compile xxx.py
#生成pyo
python -O -m py_compile xxx.py
自己在Eclipse里写的py文件一直都在那,但是看到别的地方都有pyc文件心里痒痒。
python2.2
>>> imp
>>> py_compile.compile('xxx.py')
python2.4 later
#生成pyc
python -m py_compile xxx.py
#生成pyo
python -O -m py_compile xxx.py