#/usr/bin/env python 起始行
"this is a test module" 模块文档(文档字符串)
import sys
import os 模块导入
debug = True (全局)变量定义
class FooClass (object):
"Foo class"
pass 类定义(若有)
def test():
"test function"
foo = FooClass()
if debug:
print 'ran test()' 函数定义
if name=='main':
test() 主程序
转载于:https://my.oschina.net/likeai34/blog/690121