Time of Update: 2014-08-14
標籤:os io for ar cti div amp python Or, How to use variable length argument lists in Python.The special
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-11
標籤:python 刷部落格 while 本執行個體使用python的while語句來進行刷自己部落格註:本功能只為展示python的強悍功能,不為攻擊任何人,讓我們做良民網友//引入所需要的python包import webbrowser as web as是把包明子改或者叫串連為asimport timeimport osimport
Time of Update: 2018-12-08
理解切片基本用法:首先需要明白,可迭代對象,按照正數索引(正序)是從0開始的,按照負數索引(逆序)是從-1開始的。>>> astring = 'Hello world'>>> astring[0:2]'He'>>> 可見,這種情況下,給切片操作一個起始位置,和一個終止位置,則顯示從起始位置開始(包括起始位置)到終止位置(不包括終止位置)之間的內容;在有負數索引的情況下,是類似的,只要確定終止位置的內容:>>>
Time of Update: 2018-12-08
先去下載一個叫SWFToImage.dll的東西 再建立一個bat檔案,並運行: 複製代碼 代碼如下:COPY SWFToImage.dll %windir%\system32 regsvr32 %windir%\system32\SWFToImage.dll 複製代碼 代碼如下:#用python下載百度文庫的代碼,需要的同志請修改,下面有提示 #http://www.cnblogs.com/dearplain/ #code by plain import urllib2 import win3
Time of Update: 2018-12-08
複製代碼 代碼如下:#!/usr/bin/python #-*- encoding: utf-8 -*- import types class NotIntegerError(Exception): pass class OutOfRangeError(Exception): pass _MAPPING = (u'零', u'一', u'二', u'三', u'四', u'五', u'六', u'七', u'八', u'九', ) _P0 = (u'', u'十', u'百', u'千', )
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
官方網站 : www.python.orgPython is an interpreted, interactive, object-oriented programming language. It is often compared to Tcl, Perl, Scheme or Java.Python combines remarkable power with very clear syntax. It has modules, classes, exceptions, very
Time of Update: 2018-12-07
Django是一個開放原始碼的Web應用程式框架,由Python寫成,它最初是被開發來用於管理勞倫斯出版集團旗下的一些以新聞內容為主的網站的。python+django也是web開發人員最受歡迎的架構.今天記錄下整個搭建開發環境的過程.(說明下環境的系統為 centos 5.2) 一:更新yum倉庫(目前這個yum源是最快的)[root@filerserver python]#cd /etc/yum.repos.d[root@filerserver python]#mv
Time of Update: 2018-12-07
需要備忘一下的是gui下代替sudo,su的程式是gksu.可惜是英文的介面.還可以用glade設計gtk的介面,可惜我是寫完這個程式才知道.2005.11.18封裝了一個imagebutton出來,也算是對python的進一步學習吧~~~window的樣式也做了修改~~~現在基本上已經可以正常使用了~~~我把我那個醜陋的fvwm菜單的退出已經換為這個了~~ 1#!/usr/bin/python 2import pygtk 3import gtk 4import os 5import sys 6
Time of Update: 2018-12-07
整理的一些符號(前三個在java和c中是不這樣表達的,用&&、||、!表達)andornot!= (not equal)== (equal)>= (greater-than-equal)<= (less-than-equal)TrueFalseView Code # _*_ coding:utf-8 _*_print (True and False), Falseprint (False and True), Falseprint (1 == 1 and 2 == 1
Time of Update: 2018-12-07
web:Python web automation 網頁自動化技術看看我自己寫的程式,在web automation這個方面的數量最多。網上對這方面程式的需求也很多,因為web的時代,操作的工作量移到web上來了, 機器替代人的需求增大也就不足為奇。無疑python是做這方面工作的好手:總結一下python做web automation常用手段:基於urllib2、urllib:
Time of Update: 2018-12-07
python twisted教程 一,非同步編程發佈於: August 17, 2011, 11:45 pm 分類: Twisted 作者: cyrec 閱讀:
Time of Update: 2018-12-07
很久沒寫文章了,感覺寫起來手有點生的感覺,最近沒事的時候用python 做網頁分析,抓取裡面有用的資料,原來用過python SGMLParser來處理網頁,其實如果處理比較簡單的網頁的話,用python SGMLParser已經夠了,但是你如果你要處理比較複雜點的網頁結構文本的話,可能用python Beautiful Soup會方便很多,也許少許的代碼就可以完成你的工作了,所以python 處理東西還是非常的方便,有興趣的可以去瞭解使用python
Time of Update: 2018-12-07
#!/usr/bin/python#-*- coding:gbk-*-'''spec:根據是否命中126W人名,將usrdict分為兩個部分parms:[IN] [IN][OUT]author: liuyusi0121@sogou-inc.com date 20120808'''import re;import sys;def LoadKeys(filename): ''' 載入key到記憶體 ''' keys=[]; p=re.compile('^\s+|\s+$
Time of Update: 2018-12-07
1 MotivationFor the task of blogging, you can generate Html file locally, then using metaWeblog API to upload them to your blog hosting site. This workflow has following benefits:There are many ways to generate Html documents, you can choose which
Time of Update: 2018-12-07
以前斷斷續續的看python,由於應用少,總是看了就忘,所以這裡記錄下來,已備以後查看。這次主要是把python裡面的常用模組簡單的做下記錄.記錄的部分僅僅是自己的理解。這裡的python版本是2.5.2>>> import sys>>> sys.version'2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)]'>>> import string>
Time of Update: 2014-06-28
利用python開發了一個提取sim.log 中的各個關鍵步驟中的時間並進行統計的程式:#!/usr/bin/python2.6import re,datetimefile_name='/home/alzhong/logs/qtat1/R2860.01.13/sim-applycommitrollback-bld1.log'file=open(file_name,'r')acnum=[];time_res=[];lnum=0def trans_time(time)
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 (
Time of Update: 2013-12-27
Python常見部署方法有 :fcgi :用spawn-fcgi或者架構內建的工具對各個project分別產生監聽進程,然後和http 服務互動wsgi :利用http服務的mod_wsgi模組來跑各個project(Web應用程式或架構簡單而通用的Web伺服器 之間的介面)。uWSGI 是一款像php-cgi一樣監聽同一連接埠,進行統一管理和Server Load