原创 數據類型-數字(Number)

Python 支持三種不同的數值類型: 整型(Int) - 通常被稱爲是整型或整數,是正或負整數,不帶小數點。Python3 整型是沒有限制大小的,可以當作 Long 類型使用,所以 Python3 沒有 Python2 的 Long 類

原创 mysql查詢/終止正在執行的SQL

查詢正在執行的SQL show processlist;    time列:此這個狀態持續的時間,單位是秒。 終止正在執行的SQL kill 580; # 580爲show processlist查出來的id      

原创 推導(comprehension)

推導基礎: [<i表達式> for i in aiterator] aiterator指一個可遍歷對象,比如列表、元組、也可以是range() 用循環變量i去遍歷aiterator,並將i相關表達式的值放入一個列表中。 例:square

原创 數據類型-字符串(str)

通過序號來讀取其中某個字符:'abc'[1] = 'b' 可以通過運算符運算:'aaa' + 'bbb' =  'aaabbb';  'a'*3 = 'aaa';   效率沒有join()高  

原创 記一個超有用的網址 - python

https://github.com/amoyshmily/learning/blob/master/SuperNotes/Python/crazyIT.md

原创 Constant Throughput Timer常量吞吐量定時器

1. 添加Constant Throughput Timer(右鍵-添加-Timer-Constant Throughput Timer) 標題2. Target throughput(in samples per minute): 吞吐

原创 python運算優先級

從高到低依次爲 算術運算符:**優先級最高 位運算符 比較(關係)運算符 is 運算符:is、is not in 運算符:in、not in 邏輯運算符:not > and > or   

原创 print() 參數

print的完整格式爲print(objects,sep,end,file,flush),其中後面4個爲可選參數 sep:在輸出字符串之間插入指定字符串,默認是空格 >>> print('a','b','c') a b c >>> pri

原创 sys.stdout.write()

print(obj)實質就是調用sys.stdout.write(obj+’\n’) sys.stdout是python中標準輸出流 # 兩者等價 sys.stdout.write('hello'+'\n') print('hello')

原创 SVN關於previous operation has not finished問題的解決

svn執行clean up命令時報錯“Previous operation has not finished; run 'cleanup' if it was interrupted”。 無論你到那個父層次的目錄執行“clean up “

原创 python - 循環

while 循環 while 判斷條件: 語句 while 循環使用 else 語句 count = 0 while count < 5:   print (count, " 小於 5")   count = count + 1

原创 python - if

if if condition_1:   statement_block_1 elif condition_2:   statement_block_2 else:   statement_block_3   if 表達式1:

原创 Python3 元組

Python 的元組與列表類似,不同之處在於元組的元素不能修改。 tup1 = ('Google', 'Runoob', 1997, 2000); tup2 = (1, 2, 3, 4, 5, 6, 7 ) 創建空元組  tup1 = (

原创 Python3 列表

list1 = ['Google', 'Runoob', 1997, 2000]; list2 = [1, 2, 3, 4, 5, 6, 7 ]; list1[0] = 'Google';  # 第一個索引是0;最後一個索引是-1 lis

原创 os.system路徑存中有空格

其實沒有搞清楚原理是什麼,只是把所有答案都試了一遍,發現下面這個是管用的,留個記號 os.system(r'"文件路徑"') r單引號雙引號,引號順序反了還不行了