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