python文件類型
1 源代碼 .py
以.py結尾的文本文件
例如
vim 1.py
#!/usr/bin/python
print 'hello word'
python 1.py
由python解釋器進行解釋,不需要編譯
2 字節代碼.pyc
python編譯完成後的文件.pyc
vim 2.py
#!/usr/bin/python
import py_compile
py_compile.compile('1.py')
python 2.py
編譯文件
編譯之後會產生.pyc文件
python 1.pyc
3 經過優化的代碼 .pyo
python -O -m py_compile 1.py