python 教程 第十五章、 结构布局
生活随笔
收集整理的這篇文章主要介紹了
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()總結
以上是生活随笔為你收集整理的python 教程 第十五章、 结构布局的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: USG2000
- 下一篇: ubuntu下python thrift