读书人

python 模块跟布局

发布时间: 2012-09-02 21:00:34 作者: rapoo

python 模块和布局

写一个Demo:

大致7个部分:

#1.起始行 ?

#2.模块文档?

#3.模块导入

#4.声明模块变量?

#5.类声明 ?

#6.函数声明 ?

#7.主程序 ?

?

#!/usr/bin python        #1"Here are module docs"#2import sys,os#3point = 20#4class Demo(object):#5    "Demo class docs"    passdef other():#6    "other function docs"    demo = Demo()    if point>10:        print 'The point is: ',pointother()#7

读书人网 >perl python

热点推荐