Time of Update: 2015-01-28
標籤:python pil cpickle 讀取映像 儲存映像 利用Python PIL、cPickle讀取和儲存映像資料庫 @author:wepon@blog:http://blog.csdn.net/u012162613/article/details/43226127電腦視覺、機器學習任務中,經常跟映像打交道,
Time of Update: 2014-08-10
標籤:blog http io 檔案 資料 2014 ar 問題 事情是這樣的:博主嘗試用Python的sqlite3資料庫存放加密後的使用者名稱密碼資訊,表是這樣的CREATE TABLE IF NOT EXISTS
Time of Update: 2014-07-26
標籤:mysql db CentOS下安裝sudo yum install MySQL-python可以參考http://www.mikusa.com/python-mysql-docs/index.html 擷取更多資訊MySQL-python
Time of Update: 2015-01-03
標籤: 看知乎的時候發現了一個 “如何正確地吐槽” 收藏夾,裡面的一些神回複實在很搞笑,但是一頁一頁地看又有點麻煩,而且每次都要開啟網頁,於是想如果全部爬下來到一個檔案裡面,是不是看起來很爽,並且隨時可以看到全部的,於是就開始動手了。工具1.Python
Time of Update: 2014-10-28
標籤:blog http 使用 sp on 2014 log bs python 1
Time of Update: 2014-09-18
標籤:style blog color io ar for div sp log Here is the basic algorithm about merge sort:def
Time of Update: 2014-08-12
標籤:blog java os io 檔案 for ar art #encoding: utf-8__author__ = ‘DELL‘import csvimport globimport datetimeimport
Time of Update: 2014-08-12
標籤:style blog http color strong 檔案 2014 問題 初學Python,本身就在一些語句處有些迷惑,如 a =
Time of Update: 2014-08-11
標籤:python 刷部落格 while 本執行個體使用python的while語句來進行刷自己部落格註:本功能只為展示python的強悍功能,不為攻擊任何人,讓我們做良民網友//引入所需要的python包import webbrowser as web as是把包明子改或者叫串連為asimport timeimport osimport
Time of Update: 2018-12-08
複製代碼 代碼如下:#! /usr/bin/env python ##python2.7-批量下載壁紙 ##壁紙來自桌酷網站,所有權歸屬其網站 ##本代碼僅做為交流學習使用,請勿用於商業用途,否則後果自負 ##Code by Dreamlikes import re,urllib,urllib2 #儲存圖片的路徑 savepath = 'd:\\picture\\' #壁紙集合的URL,如下 url =
Time of Update: 2018-12-08
所以就想把這些照片翻著看一遍,可是拷出來的照片手機 裡是按時間自動分檔案夾的,一個一個檔案夾拷很是麻煩,於是打算寫個python小指令碼來完成這個工作(扯這麼多,終於 到主題了,囧) 這是待拷貝的檔案夾根目錄,每個子目錄下都有若干照片。 廢話少說,上代碼: 複製代碼 代碼如下:# -*- coding: utf-8 -*- #!/usr/bin/python #Filename:copyfile.py import os,shutil def mycopy(srcpath,dstpath):
Time of Update: 2018-12-08
直接開啟dos視窗,再執行python程式 在指令碼的最後一行後面添加:raw_input()語句,這樣直到按下斷行符號鍵,視窗才關閉。 使用time模組的sleep函數,它有一個參數,傳入數字,其單位是秒: 複製代碼 代碼如下:import time print "aaaaaaaaaaa" time.sleep(150); 如果控制台裡面的行數過多過亂,我們可以使用下面語句進行清屏: 複製代碼 代碼如下:import os #linux os.system('cls') #windows
Time of Update: 2018-12-08
re.match re.match 嘗試從字串的開始匹配一個模式,如:下面的例子匹配第一個單詞。 複製代碼 代碼如下:import re text = "JGood is a handsome boy, he is cool, clever, and so on..." m = re.match(r"(\w+)\s", text) if m: print m.group(0), '\n', m.group(1) else: print 'not match'
Time of Update: 2018-12-08
先來看看python的版本: >>> import sys >>> sys.version '2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)]' (一) 用記事本建立一個檔案ChineseTest.py,預設ANSI: s = "中文" print s 測試一下瞧瞧: E:\Project\Python\Test>python ChineseTest.py
Time of Update: 2018-12-08
>>> "hello".encode("hex") '68656c6c6f'相應的還可以>>> '68656c6c6f'.decode("hex") 'hello'查了一下手冊,還有這些codec可用CodecAliasesOperand typePurposebase64_codecbase64, base-64byte stringConvert operand to MIME base64bz2_codecbz2byte stringCompress
Time of Update: 2018-12-08
後來想到自己Delphi有一個獲得拼音的代碼。於是找了出來。研究了一下代碼如下:複製代碼 代碼如下:function get_hz_pywb(hzstr: string; pytype: integer): string; var I: Integer; allstr: string; hh: THandle; pp: pointer; ss: TStringList; function retturn_wbpy(tempstr: string; tqtype: integer):
Time of Update: 2014-12-09
python 升級到2.7.8 導致yum 運行異常:No module named yum,2.7.8yumos version:[root@lixora etc]# cat redhat-releaseRed Hat Enterprise Linux Server release 5.4 (Tikanga)---運行yum 報錯[root@lixora ~]# yum install dialogThere was a problem importing one of the Python
Time of Update: 2014-10-01
每天進步一點點——Ganglia的Python擴充模組開發,gangliapython轉載請說明出處:http://blog.csdn.net/cywosp/article/details/39701245註:本文涉及到的代碼都在centos 6.5 64bit系統上通過驗證,Ganglia版本為3.1,通過yum安裝具體步驟請參考:http://blog.csdn.net/cywosp/article/details/397011411. 概述 Ganglia
Time of Update: 2014-08-19
[Python]發送email的幾種方式python發送email還是比較簡單的,可以通過登入郵件服務來發送,linux下也可以使用調用sendmail命令來發送,還可以使用本地或者是遠端smtp服務來發送郵件,不管是單個,群發,還是抄送都比較容易實現。先把幾個最簡單的發送郵件方式記錄下,像html郵件,附件等也是支援的,需要時查文檔即可1 登入郵件服務#!/usr/bin/env python# -*- coding: utf-8
Time of Update: 2013-12-27
其實linux下配置python非常簡單。1 首先,你的linux機器上是否已經安裝了python。命令列下輸入: python -V若,提示有版本資訊,則說明你的機器上已經安裝了python。否則,請按照下面的方式安裝python。2 命令列下輸入:sudo apt-get install python3 測試是否安裝成功在命令列下輸入:python 會顯示下列結果: Python 2.4.3 (#1, Dec 11 2006, 11:38:52) [GCC 4.1.1 20061130 (