Time of Update: 2017-10-11
標籤:exec 中文編碼 new har 儲存 password 串連資料庫 color 查詢 #coding=utf-8import csvimport
Time of Update: 2017-10-11
標籤:爬蟲 path from 圖片 filename python windows apple clip 今天沒事回家寫了個貼吧圖片下載程式,工具用的是PyCharm,這個工具很實用,開始用的
Time of Update: 2017-10-11
標籤:python 閉包 裝飾器 閉包的意義:返回的函數對象,不僅僅是一個函數對象,在該函數外還包裹了一層範圍,這使得,該函數無論在何處調用,優先使用自己外層包裹的範圍 #應用領域:延遲計算(原來我們是傳參,現在我們是包起來)from urllib.request import urlopen def index(url):
Time of Update: 2017-10-12
標籤:名稱 漢諾塔問題 編號 遞迴調用 解決 數位 img pytho 位置 有三根柱子一次為A,B,C
Time of Update: 2017-10-12
標籤:this class size div python pytho with family start 定義:Python endswith()
Time of Update: 2017-10-12
標籤:cell sheet 迴圈 blog 獲得 path 索引 pre 開啟檔案 import xlrdpath =
Time of Update: 2017-10-11
標籤:python 字元轉換 1.python把一個unicode字串寫入檔案為什麼會報錯?write方法的參數類型是str,str是二進位流(不包含編碼資訊),當你給出一個unicode對象時,會執行str函數轉換成str類型再送給write方法。unicode轉str包含一次編碼,如不指定則預設使用ascii編碼,而ascii編碼集裡漢字字元是沒有對應的,所以報錯。正確做法是在代碼裡指定編碼。比如在open裡指定(fp=
Time of Update: 2017-10-12
標籤:context 串連 line cpu 擷取 none 出錯 python 多線程 多進程進程之間是相互獨立的,python是啟動進程的時候,是啟動的是原生進程。進程是沒有GIL鎖的,而且
Time of Update: 2017-10-12
標籤:ber memory nal 編碼 poi cte version ted doc https://docs.python.org/2/howto/unicode.htmla
Time of Update: 2017-10-11
標籤:命名 ext pycharm 上下 載入 logs 授權 小表徵圖 使用 老套路,安裝和使用(Win7x64、JDK神馬滴早已裝好)。1.安裝網上下下來後就這東西NextD盤路徑我選擇、我
Time of Update: 2017-10-11
標籤:連結 擷取 show import 網路 port 擷取網頁 ref script 擷取單條新聞的#標題#連結#時間#來源#內容
Time of Update: 2017-10-11
標籤:產生器 重複 返回 fun 沒有 代碼 pfile ignore 對比 在一些營運情境中,常常需要比較兩個環境中的應用目錄結構(是否有檔案/目錄層面上的增刪)以及比較兩個環境中同名檔案
Time of Update: 2017-10-10
標籤:lock pika 有用 ges 處理 操作 waiting fetch 情況下 今天,我們要逐步開始討論rabbitmq稍微進階點的耍法了。瞭解這一步,對我們設計高並發的系統非常有用。當
Time of Update: 2017-10-10
標籤:time 格式 reg 確認密碼 密碼 utf-8 else while 程式 用python
Time of Update: 2017-10-10
標籤:count join ide 代碼 檔案 input 產生 使用者輸入 pen python
Time of Update: 2017-10-10
標籤:list == 格式 資料格式 add 圖表 size mat tar.gz 一、安裝xlrd模組和xlwt模組 1. 下載xlrd模組和xlwt模組 &
Time of Update: 2017-10-13
產生器並行,產生器的作用的在單線程下實現並行,稱為攜程,比線程更小的單位,依附於線程def customer(name): print("%s準備吃包子了"%name) while True: baozi = yield #產生器 print("%s吃了%s包子"%(name,baozi))def producer(): c1 = customer("張三") c2 = customer("李四") c1.__next_
Time of Update: 2017-10-13
python的paramiko模組實現遠端控制和傳輸,pythonparamiko 轉載請註明出處1 安裝sudo pip install paramiko2 ssh實現遠端控制#LINUX下執行shellssh username@ip #輸入密碼後就可以對遠程機器進行操作ssh username@ip command #輸入密碼後遠程機器就執行commandssh運行後,想退出,可以kill掉ssh進程。3 paramiko實現sshimport paramikohostname
Time of Update: 2017-10-12
運算子優先順序, 1 >>>a=20 2 >>>b=15 3 >>>c=10 4 >>>d=5 5 >>>e=0 6 >>>e=(a-b)*c/d 7 >>>print(e) 8 10 9 >>>print('(a-b)*c/d',e)10 (a-b)*c/d 10.011 >>>print((a-b)*c/d,e)12 10.0
Time of Update: 2017-10-12
身份運算子, 1 >>>a=10 2 >>>b=10 3 >>>print(a is b) 4 True 5 >>>print(a is not b) 6 False 7 >>>b=20 8 >>>print(a is b) 9 False10 >>>print(a is not b)11 True12 #is,判斷兩個標識符是否引用自同一個對象, a is b (1