Posts Tagged 'python'

怎麼給python添加新的lib path

二月9th, 2010

python讀取類庫的順序是,當前目錄,pythonpath,path和安裝目錄。 可以動態的設置pythonpath如下:

  1. Python 2.6.3 : 75186 , Oct ( r263rc1 : 75186 , Oct   2 20 : 40 : 30 ) 2009 , 20 : 40 : 30 ) [ MSC v .1500 32 bit )] ( Intel )]
  2. on   win32
  3. Type   " , " copyright " , " credits " " help " , " copyright " , " credits " or " " license " for more information .
  4. >>> import   sys
  5. . path >>> sys . path
  6. , ' C: \\ Python26 ' , ' C: \\ Windows \\ system32 \\ python26.zip ' , ' C: \\ Python26 \\ DLLs ' , [ '' , ' C: \\ Python26 ' , ' C: \\ Windows \\ system32 \\ python26.zip ' , ' C: \\ Python26 \\ DLLs ' ,
  7.   \\ Python26 \\ lib ' , ' C: \\ Python26 \\ lib \\ plat-win ' , ' C: \\ Python26 \\ lib \\ lib-tk ' ' C: \\ Python26 \\ lib ' , ' C: \\ Python26 \\ lib \\ plat-win ' , ' C: \\ Python26 \\ lib \\ lib-tk '
  8. C: \\ Python26 \\ lib \\ site-packages ' ] , ' C: \\ Python26 \\ lib \\ site-packages ' ]
  9. . path . append ( ' c: \\ path ' ) >>> sys . path . append ( ' c: \\ path ' )
  10. . path >>> sys . path
  11. , ' C: \\ Python26 ' , ' C: \\ Windows \\ system32 \\ python26.zip ' , ' C: \\ Python26 \\ DLLs ' , [ '' , ' C: \\ Python26 ' , ' C: \\ Windows \\ system32 \\ python26.zip ' , ' C: \\ Python26 \\ DLLs ' ,
  12.   \\ Python26 \\ lib ' , ' C: \\ Python26 \\ lib \\ plat-win ' , ' C: \\ Python26 \\ lib \\ lib-tk ' ' C: \\ Python26 \\ lib ' , ' C: \\ Python26 \\ lib \\ plat-win ' , ' C: \\ Python26 \\ lib \\ lib-tk '
  13. C: \\ Python26 \\ lib \\ site-packages ' , ' c: \\ path ' ] , ' C: \\ Python26 \\ lib \\ site-packages ' , ' c: \\ path ' ]
  14. >>>

還有就是修改環境變量。 增加一個PYTHONPATH
windows比較討厭的是有空格問題。
在系統變量裡面增加一個變量PYTHONPATH
值是:

  1. C:\\Program Files (x86)\\Google\\google_appengine;C:\\Program Files (x86)\\Google\\google_appengine\\lib\\antlr3;C:\\Program Files (x86)\\Google \\google_appengine\\lib\\django;C:\\Program Files (x86)\\Google\\google_appengine\\lib\\webob;C:\\Program Files (x86)\\Google\\google_appengine\\lib \\yaml\\lib;C:\\Program Files (x86)\\Google\\google_appengine;

只是gae執行起來還是有點問題,保存modle的時候,說沒有app id。 咳。
———–
python 2.6 開始,好像支持在site-packages目錄下建xxx.pth的文件,把要include的lib path寫進去即可。 這個方便,易於維護。 不錯更多可以看這個http://docs.python.org/library/site.html

Popularity: 4%

python版本的jquery

一月5th, 2009

jquery在做html內容提取,分析的時候很方便。 而python做類似的工作就麻煩一點,原來我都是用正則表達式或者HtmlParser的。
兩者用著都不是太爽,今天發現了一個好東西pyquery ,一個類似jquery的python庫。
摘抄一段使用說明

  1. >>> from pyquery import PyQuery as pq
  2. >>> from lxml import etree
  3. >>> d = pq("<html></html>")
  4. >>> d = pq(etree.fromstring("<html></html>"))
  5. >>> d = pq(url='http://google.com/')
  6. >>> d = pq(filename=path_to_html_file)

Now d is like the $ in jquery:

  1. >>> d("#hello")
  2. [<p#hello.hello>]
  3. >>> p = d("#hello")
  4. >>> p.html()
  5. 'Hello world !'
  6. >>> p.html("you know <a href='http://python.org/'>Python</a> rocks")
  7. [<p#hello.hello>]
  8. >>> p.html()
  9. 'you know <a href="http://python.org/">Python</a> rocks'
  10. >>> p.text()
  11. 'you know Python rocks'

簡單吧,安裝也很簡單下載

http://pypi.python.org/packages/source/p/pyquery/pyquery-0.3.tar.gz

解壓縮
python setup.py install
就可以了,可能要安裝ezsetup
現在的版本是0.3,還有一些jquery的東西沒有實現,比如:radio,:password,以及一些ajax的功能,但是已經夠用了,強烈推薦。
趕緊試試吧。

還有一個BeautifulSoup ,也推荐一下

Popularity: 38%

django學習筆記

十二月25th, 2008

最近在看django,覺得這種快速開發的framework還是不錯的。
但是也有他們存在的問題,尤其是剛開始不久的。 兼容性是個大問題。 一樣的代碼,升級了就不能用。
在做django管理試驗的時候就遇到了問題,老闆本的就不說了,我用的1.0.2是要做如下操作才可以。
urls.py
去掉

  1. from contrib django . contrib import admin
  2. autodiscover () admin . autodiscover ()
  3. ' ^admin/(.*) ' , admin . site . root ) , ( r ' ^admin/(.*) ' , admin . site . root ) ,

前面的註釋
setting.py
INSTALLED_APPS
添加
'django.contrib.admin',
要建立一個admin.py,內容如下:

  1. from contrib django . contrib import admin
  2. from   models jobs . models import Job
  3. class   admin . ModelAdmin ) : JobAdmin ( admin . ModelAdmin ) :
  4.     pass
  5. site . register ( Job , JobAdmin ) admin . site . register ( Job , JobAdmin )

其中Job是model的類名字

還有,需要修改
models.py裡的
__str__ 為__unicode__
不然會出現
Caught an exception while rendering: 'ascii' codec can't encode characters in position 0-2: ordinal not in range(128)

Popularity: 34%

python的settimeout

十一月9th, 2008

有時候寫python關於網絡的程序。 比如用urllib2等module發http請求的時候,發現有時候會有死掉的情況,就是程序沒任何反應,也不是cpu,內存沒資源的問題。 具體情況還沒搞明白那裡出的問題,但是找到一個解決辦法。 就是設置socket time out,即:如果一個請求超過一定的時間沒有完成,就終止,再次發起請求。
這個是從2.3有的功能用法如下:
settimeout( value)
Set a timeout on blocking socket operations. The value argument can be a nonnegative float expressing seconds, or None. If a float is given, subsequent socket operations will raise an timeout exception if the timeout period value has elapsed before the operation has completed. Setting a timeout of None disables timeouts on socket operations. s.settimeout(0.0) is equivalent to s.setblocking(0); s.settimeout(None) is equivalent to s.setblocking(1). New in version 2.3.

就是settimeout()裡面填一個數值。 小心別太小,別正常的請求也不能完成。

Popularity: 29%

轉貼一個Python HTMLParser的使用例子

六月21st, 2008

原文

http://crquan.blogbus.com/logs/8269701.html

#!/usr/bin/env python

import sys
import urllib
import HTMLParser

class HTMLParser . HTMLParser ) : CustomParser ( HTMLParser . HTMLParser ) :
( ' table ' , ' h1 ' , ' font ' , ' ul ' , ' li ' , ' tr ' , ' td ' , ' a ' ) selected = ( ' table ' , ' h1 ' , ' font ' , ' ul ' , ' li ' , ' tr ' , ' td ' , ' a ' )

def self ) : reset ( self ) :
HTMLParser . reset ( self ) HTMLParser . HTMLParser . reset ( self )
_level_stack = [] self . _level_stack = []
def self , tag , attrs ) : handle_starttag ( self , tag , attrs ) :
if tag in selected : CustomParser . selected :
_level_stack . append ( tag ) self . _level_stack . append ( tag )
def self , tag ) : handle_endtag ( self , tag ) :
if _level_stack \ self . _level_stack \
and tag in selected \ CustomParser . selected \
and self . _level_stack [ - 1 ] : tag == self . _level_stack [ - 1 ] :
_level_stack . pop () self . _level_stack . pop ()
def self , data ) : handle_data ( self , data ) :
if " . join ( self . _level_stack ) " / " . join ( self . _level_stack ) in (
' , ' table/tr/td ' ,
' , ' table/tr/td/h1/font ' ,
' ) : ' table/tr/td/ul/li ' ) :
print _level_stack , data self . _level_stack , data

if sys . argv ) > 1 : len ( sys . argv ) > 1 :
urllib . urlencode ( { ' ip ' : sys . argv [ 1 ] , ' action ' : 2 } ) params = urllib . urlencode ( { ' ip ' : sys . argv [ 1 ] , ' action ' : 2 } )
else :
None params = None

unicode ( urllib . urlopen ( ' http://www.ip138.com/ips8.asp ' , params ) . read () , ' GB2312 ' ) content = unicode ( urllib . urlopen ( ' http://www.ip138.com/ips8.asp ' , params ) . read () , ' GB2312 ' )

CustomParser () parser = CustomParser ()
feed ( content ) parser . feed ( content )
close () parser . close ()

Popularity: 53%

python讀有文件結束符的txt文本文件

四月24th, 2008

一直用python讀文件都是文本文件。 用的方法是:

open ( ' ft.txt ' ) lines = open ( ' ft.txt ' )

但是前兩天讀一個幾百兆的大文件的時候,遇到了奇怪的問題,覺得是內容沒有讀完。 定位最後讀到的行,用emeditor打開,發現有一個怪字符“ ”。 編碼是“\x001a”,一查,原來是文件結束符號。
一直鬱悶,奇怪為啥文本文件裡面有文件結束符,試了好多辦法,都不行,最後經limodou指點,原來這種情況要當成二進製文件來讀。

open ( ' ft.txt ' , ' rb ' ) lines = open ( ' ft.txt ' , ' rb ' )

文件內容如下:

abc defg

兩種不同情況的結果如下:

= open ( ' ft.txt ' ) >>> f = open ( ' ft.txt ' )
. read () >>> f . read ()
' ' abc '
= open ( ' ft.txt ' , ' rb ' ) >>> f = open ( ' ft.txt ' , ' rb ' )
. read () >>> f . read ()
\x 1adefg ' ' abc \x 1adefg '

Popularity: 33%

python非貪婪、多行匹配正則表達式例子

四月14th, 2008

一些regular的tips:

1 非貪婪flag

. findall ( r " a( \d +?) " , " a23b " ) >>> re . findall ( r " a( \d +?) " , " a23b " )
2 ' ] [ ' 2 ' ]
. findall ( r " a( \d +) " , " a23b " ) >>> re . findall ( r " a( \d +) " , " a23b " )
23 ' ] [ ' 23 ' ]

注意比較這種情況:

. findall ( r " a( \d +)b " , " a23b " ) >>> re . findall ( r " a( \d +)b " , " a23b " )
23 ' ] [ ' 23 ' ]
. findall ( r " a( \d +?)b " , " a23b " ) >>> re . findall ( r " a( \d +?)b " , " a23b " )
23 ' ] [ ' 23 ' ]

2 如果你要多行匹配,那麼加上re.S和re.M標誌
re.S:.將會匹配換行符,默認.不會匹配換行符

. findall ( r " a( \d +)b.+a( \d +)b " , " a23b \n a34b " ) >>> re . findall ( r " a( \d +)b.+a( \d +)b " , " a23b \n a34b " )
[]
. findall ( r " a( \d +)b.+a( \d +)b " , " a23b \n a34b " , re . S ) >>> re . findall ( r " a( \d +)b.+a( \d +)b " , " a23b \n a34b " , re . S )
23 ' , ' 34 ' )] [( ' 23 ' , ' 34 ' )]
>>>

re.M:^$標誌將會匹配每一行,默認^和$只會匹配第一行

. findall ( r " ^a( \d +)b " , " a23b \n a34b " ) >>> re . findall ( r " ^a( \d +)b " , " a23b \n a34b " )
23 ' ] [ ' 23 ' ]
. findall ( r " ^a( \d +)b " , " a23b \n a34b " , re . M ) >>> re . findall ( r " ^a( \d +)b " , " a23b \n a34b " , re . M )
23 ' , ' 34 ' ] [ ' 23 ' , ' 34 ' ]

但是,如果沒有^標誌,

. findall ( r " a( \d +)b " , " a23b \n a23b " ) >>> re . findall ( r " a( \d +)b " , " a23b \n a23b " )
23 ' , ' 23 ' ] [ ' 23 ' , ' 23 ' ]

可見,是無需re.M

Popularity: 52%

python正則表達式學習

四月9th, 2008

出處
python 中的re 模塊

正則表達式

就個人而言,主要用它來做一些複雜字符串分析,提取想要的信息學習原則:夠用就行,需要的時候在深入

現總結如下:

正則表達式中特殊的符號:

“.” 表任意字符
“^ ” 表string起始
“$” 表string 結束“*” “+” “?” 跟在字符後面表示,0個——多個, 1個——多個, 0個或者1個
*?, +?, ?? 符合條件的情況下,匹配的盡可能少//限制*,+,?匹配的貪婪性
{m} 匹配此前的字符,重複m次
{m,n} m到n次,m,n可以省略

舉個例子'a.*b' 表示a開始,b結束的任意字符串
a{5} 匹配連續5個a

[] 表一系列字符[abcd] 表a,b,c,d [^a] 表示非a
| A|B 表示A或者B , AB為任意的正則表達式另外|是非貪婪的如果A匹配,則不找B
(…) 這個括號的作用要結合實例才能理解, 用於提取信息

\d [0-9]
\D 非\d
\s 表示空字符
\S 非空字符
\w [a-zA-Z0-9_]
\W 非\w

一:re的幾個函數

1: compile(pattern, [flags])
根據正則表達式字符串pattern 和可選的flags 生成正則表達式對象

生成正則表達式對象(見二)

其中flags有下面的定義:
I 表示大小寫忽略
L 使一些特殊字符集,依賴於當前環境
M 多行模式使^ $ 匹配除了string開始結束外,還匹配一行的開始和結束
S “.“ 匹配包括'\n'在內的任意字符,否則. 不包括'\n'
U Make \w, \W, \b, \B, \d, \D, \s and \S dependent on the Unicode character properties database
X 這個主要是表示,為了寫正則表達式,更可毒,會忽略一些空格和#後面的註釋

其中S比較常用,
應用形式如下
import re
re.compile(……,re.S)

2: match(pattern,string,[,flags])
讓string匹配,pattern,後面分flag同compile的參數一樣返回MatchObject 對象(見三)

3: split( pattern, string[, maxsplit = 0])
用pattern 把string 分開
>>> re.split('\W+', 'Words, words, words.')
['Words', 'words', 'words', '']
括號'()'在pattern內有特殊作用,請查手冊

4:findall( pattern, string[, flags])
比較常用,
從string內查找不重疊的符合pattern的表達式,然後返回list列表

5:sub( pattern, repl, string[, count])
repl可以時候字符串,也可以式函數當repl是字符串的時候,
就是把string 內符合pattern的子串,用repl替換了

當repl是函數的時候,對每一個在string內的,不重疊的,匹配pattern
的子串,調用repl(substring),然後用返回值替換substring

>>> re.sub(r'def\s+([a-zA-Z_][a-zA-Z_0-9]*)\s*\(\s*\):',
… r'static PyObject*\npy_\1(void)\n{',
… 'def myfunc():')
'static PyObject*\npy_myfunc(void)\n{'

>>> def dashrepl(matchobj):
… if matchobj.group(0) == '-': return ' '
… else: return '-'
>>> re.sub('-{1,2}', dashrepl, 'pro—-gram-files')
'pro–gram files'

二:正則表達式對象(Regular Expression Objects )

產生方式:通過re.compile(pattern,[flags])回

match( string[, pos[, endpos]]) ;返回string[pos,endpos]匹配
pattern的MatchObject(見三)

split( string[, maxsplit = 0])
findall( string[, pos[, endpos]])
sub( repl, string[, count = 0])
這幾個函數和re模塊內的相同,只不過是調用形式有點差別

re.幾個函數和正則表達式對象的幾個函數,功能相同,但同一程序如果多次用的這些函數功能,正則表達式對象的幾個函數效率高些

三:matchobject

通過re.match(……) 和re.compile(……).match返回

該對像有如下方法和屬性:

方法:
group( [group1, ...])
groups( [default])
groupdict( [default])
start( [group])
end( [group])

說明這幾個函數的最好方法,就是舉個例子

matchObj = re.compile(r”(?P \d+)\.(\d*)”)
m = matchObj.match('3.14sss')
#m = re.match(r”(?P \d+)\.(\d*)”, '3.14sss')

print m.group()
print m.group(0)
print m.group(1)
print m.group(2)
print m.group(1,2)

print m.group(0,1,2)
print m.groups()
print m.groupdict()

print m.start(2)
print m.string

輸出如下:
3.14
3.14
3
14
('3′, '14′)
('3.14′, '3′, '14′)
('3′, '14′)
{'int': '3′}
2
3.14sss

所以group() 和group(0)返回,匹配的整個表達式的字符串另外group(i) 就是正則表達式中用第i個“()” 括起來的匹配內容
('3.14′, '3′, '14′)最能說明問題了。

更進一步的學習,請看手冊

Popularity: 53%

python中關於文件路徑的簡單操作

四月8th, 2008

出處
python中關於文件路徑的簡單操作

幾個主要的函數:

1: os.listdir(path) //path為目錄

功能相當於在path目錄下執行dir命令,返回為list類型舉例:
print os.listdir('..')
輸出:
[a,b,c,d]

2: os.path.walk(path,visit,arg)

path :是將要遍歷的目錄
visit :是一個函數指針,函數圓形為:
callback(arg,dir,fileList)
其中arg為為傳給walk的arg , dir是path下的一個目錄,fileList為dir下的文件和目錄組成的list
arg:傳給visit用的,對walk沒有什麼作用

舉例:
def callback(arg,directory, files):
print directory,
print files,
print arg
print '——————–'

os.path.walk('.',callback, '123456′)

輸出:
. ['path0704.py', 'temp', '\xc2\xb7\xbe\xb6\xcf\xe0\xb9\xd8\xd1\xa7\xcf\xb0.txt'] 123456
——————–
.\temp ['temp.h', 'temp1'] 123456
——————–
.\temp\temp1 ['abc.bmp'] 123456

如果想找到某個目錄下所有文件,只需要在callback裡面,在fileList中找出文件,即可

除此之外,還有一個函數可以用那就是os.walk,看10

3:os.path.split(path)
path 為一個路徑,

輸出,把path分成兩部分,具體看實例:
print os.path.split(“abc/de.txt”)
('abc', 'de.txt')
os.path.split(“abc”)
(”, 'abc')
print os.path.split(“de/abc/de”)
('de/abc', 'de')

4: os.path.splitext(filename)
把文件名分成文件名稱和擴展名
os.path.splitext(abc/abcd.txt)
('abc/abcd', '.txt')

5: os.path.dirname(path)
把目錄名提出來
print os.path.dirname(“abc”)
#輸出為空
print os.path.dirname('abc\def')
abc

6: os.path.basename(filename)
取得主文件名
print os.path.basename('abc')
abc
print os.path.basename('abc.txt')
abc
print os.path.basename('bcd/abc')
abc #這個需要注意不包括目錄名稱
print os.path.basename('.')
.

7:os.mkdir(path, [mode])
path為目錄名: 這裡有個要求,只能創建一級目錄比如path為abc/def 則當前目錄下必須存在abc 否則失敗

8: os.makedirs(path [,mode])
可以創建多級目錄

9:os.remove(path)刪除一個文件,一定是一個文件
os.removedirs(path) 刪除一個目錄下所有東西
os.rmdir(path) 刪除一個目錄,而且一定要空,否則os.errer

10:os.walk(path)
遍歷path,返回一個對象,他的每個部分都是一個三元組
('目錄x',[目錄x下的目錄list],目錄x下面的文件)

舉例:
a = os.walk('.')
for i in a:
print i
輸出:
('.', ['abc', 'temp'], ['path0704.py', '\xc2\xb7\xbe\xb6\xcf\xe0\xb9\xd8\xd1\xa7\xcf\xb0.txt' ])
('.\\abc', [], ['\xd0\xc2\xbd\xa8 BMP \xcd\xbc\xcf\xf1.bmp'])
('.\\temp', ['temp1'], ['temp.h'])
('.\\temp\\temp1′, [], ['abc.bmp'])

11:shutil.copy(src,dst)
把文件src內容拷貝到文件dst中。 ,目標區域必須可以寫,如果dst存在,則dst被覆蓋

上面的函數基本夠用其它文件移動操作還請看:shutil模塊:High-level file operations

Popularity: 25%

python登錄併校驗是否成功

六月11th, 2007

為了監控網站運行是否正常,寫了一個腳本來檢查網站運行的情況。
主要是自動登錄並且校驗登陸後的內容來判斷網站web服務和數據庫服務是否正常。
代碼如下:

#!/usr/bin/env python
# -*- coding: gbk -*-
import urllib
import urllib2
import ClientCookie
import re
import string
import time
import socket
10 timeout = 10
" www.juyimeng.com " server = " www.juyimeng.com "
" http:// " + server + " /login.php " loginurl = " http:// " + server + " /login.php "
[ v_account = [
name " : " user1 " , " pass " : " pass1 " , " utype " : " 1 " , " vkey " : " 用户1 " }, { " name " : " user1 " , " pass " : " pass1 " , " utype " : " 1 " , " vkey " : " 用戶1 " },
name " : " user2 " , " pass " : " pass2 " , " utype " : " 2 " , " vkey " : " 用户2 " } { " name " : " user2 " , " pass " : " pass2 " , " utype " : " 2 " , " vkey " : " 用戶2 " }
]
def s ) : fes_write ( s ) :
'''
控制輸出信息的顯示
'''
print s
def x ) : get_response ( x ) :
'''
登錄,取得登陸後的頁面html代碼,用來判斷結果
'''
" login for " + x [ " name " ]) fes_write ( " login for " + x [ " name " ])
' username ' : x [ " name " ] , ' password ' : x [ " pass " ] , ' usertype ' : x [ " utype " ] } eform = { ' username ' : x [ " name " ] , ' password ' : x [ " pass " ] , ' usertype ' : x [ " utype " ] }
urllib . urlencode ( qstring = urllib . urlencode ( eform )
#print qstring
try :
urllib2 . Request ( request = urllib2 . Request ( qstring loginurl , qstring )
ClientCookie . urlopen ( response = ClientCookie . urlopen ( request )
return split ( string . split ( read () , " \n " ) response . read () , " \n " )
except e : Exception , e :
e ) fes_write ( e )
return " " error "
def k , l ) : verify_info ( k , l ) :
'''
校驗信息是否正確
'''
for line in l :
if match ( line ) : k . match ( line ) :
return True
break
return False
def : verify_all () :
'''
主程序,進行校驗
'''
if 0 : timeout != 0 :
setdefaulttimeout ( timeout socket . setdefaulttimeout ( timeout )
" socket time out: " + str ( socket . getdefaulttimeout ())) fes_write ( " socket time out: " + str ( socket . getdefaulttimeout ()))
len ( v_account ) success_num = len ( v_account )
for x in v_account :
re . compile ( ' .* ' + x [ " vkey " ] + ' .* ' ) vkey = re . compile ( ' .* ' + x [ " vkey " ] + ' .* ' )
if vkey , get_response ( x )) == True : verify_info ( vkey , get_response ( x )) == True :
success_num - 1 success_num = success_num - 1
x [ " name " ] + " login success! " ) fes_write ( x [ " name " ] + " login success! " )
else :
" error when " + x [ " name " ] + " login! " ) fes_write ( " error when " + x [ " name " ] + " login! " )
if 0 : success_num == 0 :
" all things runs well! " ) fes_write ( " all things runs well! " )
else :
e_notify ()
" some thing is wrong! " ) fes_write ( " some thing is wrong! " )

def : e_notify () :
'''
出錯之後的notify操作
'''
pass
if ' __main__ ' : __name__ == ' __main__ ' :
verify_all ()

v_account定義了多個賬戶,因為用戶可能不同,後台機制不一樣,所以用多個用戶來登錄
request = urllib2.Request( loginurl , qstring ) 用的是post的方法,也可以用get的方法。
ClientCookie,一個python的擴展包,安裝請參考這裡
2個v_account裡的vkey用來和登陸後的頁面上的信息來驗證是否正常登錄的
socket.setdefaulttimeout用來設置建立socket連接的超時設置,原來沒有設置,程序會一直等待回應(如果服務器端做了最長運行時間會好點),設置了10秒,如果一個登錄程序10秒還沒有成功,基本上就失敗了。
e_notify:可以自己設置一些notify的方法,比如郵件,短消息等。

Popularity: 23%