摘要:
my_list = [1,2,1,54,5,64,4681,4,676] my_list_two = list(set(my_list)) my_list_two.sort(key = my_list) print(my_list_two)
閱讀全文
posted @ 2018-10-11 17:34
是魚的記憶
閱讀(1861)
推薦(0)
摘要:
a = list(range(50)) b = list(range(50)) c = [] for x in a: c.insert(x, [a[x], b[x]]) print(c)
閱讀全文
posted @ 2018-10-11 17:28
是魚的記憶
閱讀(298)
推薦(0)
摘要:
from queue import Queue from threading import Thread import time q = Queue() def add_to_queue(): for i in range(10): print('添加') q.put(i) time.sleep(0.01) def get_from_q...
閱讀全文
posted @ 2018-07-25 16:16
是魚的記憶
閱讀(169)
推薦(0)
posted @ 2018-07-25 16:00
是魚的記憶
閱讀(184)
推薦(0)
摘要:
函數:string.join() Python中有join()和os.path.join()兩個函數,具體作用如下: join(): 連接字符串數組。將字符串、元組、列表中的元素以指定的字符(分隔符)連接生成一個新的字符串 os.path.join(): 將多個路徑組合后返回 一、函數說明1、joi
閱讀全文
posted @ 2018-07-24 23:29
是魚的記憶
閱讀(185)
推薦(0)
摘要:
一直在想requests的content和text屬性的區別,從print 結果來看是沒有任何區別 結論是:text 返回的是unicode 型的數據,一般是在網頁的header中定義的編碼形式。 content返回的是bytes,二級制型的數據。
閱讀全文
posted @ 2018-07-18 21:41
是魚的記憶
閱讀(8739)
推薦(0)