python 教程 第十五章、 结构布局

第十五章、 结构布局

#!/usr/bin/env python       #(1)起始行 

"this is a module"          #(2)模块文档 

import sys                  #(3)模块导入 

debug = True                #(4)全局变量定义 

class Fooclass(object):     #(5)类定义
    "Foo class"
    pass 

def test():                 #(6)函数定义
    "test function"
    foo = Fooclass()
    if debug:
        print 'run test()' 

if __name__ == '__main__':  #(7)主程序
    test()
服务项目 技术咨询 微信图书 微信视频 微信代码 定制开发 其他福利
服务入口 QQ群有问必答
查看详情
一本书解决90%问题
查看详情
微信开发视频
小程序开发视频
免费代码
¥1888阿里云代金券
查看详情
营销工具
微信特异功能
原文地址:https://www.cnblogs.com/txw1958/p/2210089.html