当前位置: 首页 > 后端技术 > Python

Python模块和布局

时间:2023-03-26 15:37:43 Python

写一个demo:大概7个部分:#1。开始第2行。模块文档#3。模块导入#4。模块变量的声明#5。类声明#6。函数声明#7.Mainprogram#!/usr/binpython#1"Herearemoduledocs"#2importsys,os#3point=20#4classDemo(object):#5"Democlassdocs"passdefother():#6"其他函数文档"demo=Demo()ifpoint>10:print'Thepointis:',pointother()#7---[2012-02-25]---