原创 實現調用函數功能

1.使用list實現依次調用函數功能 def check_network(): print "This is check_network" def check_config(): print "This is chec

原创 generator

生成器 >>> def gen123(): ... print "yield to 1" ... yield 1 ... print "yield to 2" ... yield 2 ... pr

原创 打印程序運行時間

用裝飾器實現打印程序運行時間import time def print_run_time(func): def wrapper(*args, **kw): start = time.time()

原创 旋轉數組的最小數字

        題目描述把一個數組最開始的若干個元素搬到數組的末尾,我們稱之爲數組的旋轉。 輸入一個非減排序的數組的一個旋轉,輸出旋轉數組的最小元素。 例如數組{3,4,5,1,2}爲{1,2,3,4,5

原创 windows cmd

netsh interface ip show addressdir /s /b/sLists every occurrence of the specified file name within the specified direct

原创 替換空格

題目描述請實現一個函數,將一個字符串中的每個空格替換成“%20”。例如,當字符串爲We Are Happy.則經過替換之後的字符串爲We%20Are%20Happy。# -*- coding:utf-8 -*- class Solutio