Time of Update: 2016-11-09
標籤:python帶參數的裝飾器__author__ = ‘similarface‘import sysimport loggingimport functoolslogging.basicConfig( stream=sys.stderr, level=logging.DEBUG )def decorator(config): def concret
Time of Update: 2016-11-09
標籤:lis 對象 迭代 個數 range top 簡單 sequence 不同方法 斐波那契數列(Fibonacci sequence),又稱黃金分割數列,也稱為“兔子數列”:F(0)=0
Time of Update: 2016-11-08
標籤:隱藏 stat nes 平台 linu move dir 系統內容 filename 提供對作業系統進行調用的介面 1 os.getcwd()
Time of Update: 2016-11-09
標籤:targe object str get define 父類 pre 子類 ima 來源:廖雪峰 繼承關係是:object -> Animal -> Dog
Time of Update: 2016-11-08
標籤:toc 內容 沒有 start net 引用 lis 元組 支援 知識點:Python中,萬物皆對象。 python中不存在所謂的傳值調用,一切傳遞的都是對象的引用,也可以認為是傳址。
Time of Update: 2016-11-08
標籤:src odi log 位元組 pen com pytho pre pop subprocess.Popen(...)python3 實現代碼: 備忘write
Time of Update: 2016-11-08
標籤:python 連接埠 掃描我們的韓國bss系統上線之後,要求對主機的連接埠、資源使用進行統計,連接埠每個主機去看,太費勁了,所以,就寫了這樣一個小程式,不是很完美但是,可以用啊!哈哈哈,別噴,本人是個菜鳥#!/usr/bin/python# -*- coding:utf-8 -*-import socketimport sys#connectordef connector(ip,port): &
Time of Update: 2016-11-08
標籤:express 等價 its one net att 獨立 編譯 plain Regex 文法:123456import re #匯入模組名 p&n
Time of Update: 2016-11-09
標籤:main pil following .json strip() mail bre 通過 end python學習之-成員資訊增刪改查主要實現了成員資訊的增加,修改,查詢,和刪除功能,寫著
Time of Update: 2016-11-09
標籤:ken mrr sim one sea gtd dft abd box 對照著廖雪峰的網站學習Python遇到些問題:在進程中,父進程建立子進程時發現,顯示不是按照順序顯示,疑問?參照代碼
Time of Update: 2016-11-09
標籤:組成 list 表示 padding cell 指定 包含 dict cti 列表方法: 方法說明append( item )在列表末尾插入(item )count(
Time of Update: 2016-11-09
標籤:extend zhang 排序 元素 print app names name pen ###增刪改查names =
Time of Update: 2016-11-09
標籤:python# -*- coding: utf-8 -*-#知識點:反射#通過字串的形式去匯入模組,這就是反射#並以字串的形式執行函數#先看簡單的小粒子temp = ‘mysql‘ #這個字串是模組的名字(也就是mysql.py或sqlserver.py,尾碼名不用寫)func = ‘count‘ #這個字串是函數的名字(也就是mysql.py/sqlserver.py中的函數count)m
Time of Update: 2016-11-09
標籤:alt iss image 參數 mis require str com 過程 代碼的一個小小Bug有時候會讓人焦頭爛額,費了很大勁搞明白的問題,如果不記錄下來,是很容易遺忘的! 
Time of Update: 2016-11-09
# Text To Speech using SAPI (Windows) and Python module pyTTS by Peter Parente# download installer file pyTTS-3.0.win32-py2.4.exe # from: http://sourceforge.net/projects/uncassist# also needs:
Time of Update: 2016-11-09
C:test [dir] getpath [file] path.py [dir] sub [file] sub_path.py比如C:\test目錄下還有一個名為sub的目錄;C:\test目錄下有getpath.py,sub目錄下有 sub_path.py,getpath.py調用sub_path.py;我們在C:\test下執行getpath.py。如果我們在
Time of Update: 2016-11-09
#!/usr/bin/env python import subprocessfrom threading import Threadfrom Queue import Queue num_threads = 3ips = ['127.0.0.1', '10.103.13.156','10.103.13.145']q = Queue() def pingme(i, queue): while True: ip =
Time of Update: 2016-11-09
#!/usr/bin/env pythonimport timestart = time.clock() import cx_Oracletns = cx_Oracle.makedsn('127.0.0.1', '1534', 'dsn')db = cx_Oracle.connect('username', 'password', tns)def sqlSelect(sql, db):
Time of Update: 2016-11-08
class A(object): # A must be new-style class def __init__(self): print "enter A" print "leave A" class B(C): # A --> C def __init__(self): print "enter B" super(B, self).__init__() print "leave B" 在我們的印象中,對於super(B, self)
Time of Update: 2016-11-09
Python內建函數(47)——open,python內建47open英文文檔:open(file, mode='r', buffering=-1, encoding=None, errors=None, newline=None, closefd=True, opener=None) Open file and return a corresponding file object. If the file cannot be opened, an OSError is raised.file