pythonʵÏÖtwitter client
¹«Ë¾µÄ´úÀí¿ÉÒÔÖ±½Ó´©Ç½£¬×ÔÓÉ·ÃÎÊTwitter¡¢FacebookµÈÍøÕ¾£¬ÕâÁ½ÌìÑо¿ÁËÒ»ÏÂTwitterÌṩµÄAPI£¬ÓÃpythonдÁËÒ»¸ötwitter client£¬Ö»ÊµÏÖÁË»ù±¾¹¦ÄÜ£¬²é¿´×Ô¼ºµÄtwitterÏûÏ¢£¬Ò²¿ÉÒÔ²»ÑéÖ¤£¬²é¿´publicµÄtwitterÏûÏ¢¡£ÆäËû¹¦ÄÜʵÏÖÀàËÆ¡£Ö÷Òªº¯ÊýÈçÏ£º
def fetch_with_proxy(proxy, username, password, url):
proxy_handler = urllib2.ProxyHandler({"http" : proxy})
opener = urllib2.build_opener(proxy_handler)
urllib2.install_opener(opener)
authheader = AddAuthorizationHeader(username, password)
req = urllib2.Request(url)
try:
res = urllib2.urlopen(req)
except IOError, e:
if hasattr(e, 'code'):
if e.code != 401:
print e.code
else:
req.add_header("Authorization", authheader)
res = urllib2.urlopen(req)
data= simplejson.loads(res.read())
def AddAuthorizationHeader(username, password):
if username and password:
basic_auth = base64.encodestring('%s:%s' % (username, password))[:-1]
return 'Basic %s' % basic_auth
def main(user):
username='XXX@gmail.com' #change to your username and password
password='XXX'
proxy='host:port' &
Ïà¹ØÎĵµ£º
֮ǰдÁËÒ»¸ö×Ô¶¯½âѹѹËõÎļþµ½Ñ¹ËõÎļþËùÔÚÎļþ¼ÐµÄ½Å±¾
ºó¸ù¾Ý×Ô¼ºÐèÒª£¬Ð´ÁËÁíÍâÁ½¸ö¡£ÔÀíÒ»Ñù
¶¼ÊÇʹÓÃwinrarµÄÃüÁî
µÚÒ»¸ö½Å±¾Ã»¿¼ÂÇÖܵ½£¬Ö»ÄܽâѹrarÎļþ
¸Ä½øºó¿ÉÒÔÖ§³ÖwinrarÖ§³ÖµÄ¸÷ÖÖÎļþ
°ÑÖ¸¶¨Îļþ¼ÐϵÄÎļþ±£´æµ½Ö¸¶¨Îļþ¼Ð
#rardir.py
import os
import sys
src=sys.argv[1]
dst=sys.argv[2]
......
תÔØ×Ô£ºhttp://hi.baidu.com/myitlyj/blog/item/25586bd7088ba3dba044df6b.html
ÔÚ³ÌÐòÖÐʹÓÃÅäÖÃÎļþÀ´Áé»îµÄÅäÖÃһЩ²ÎÊýÊÇÒ»¼þºÜ³£¼ûµÄÊÂÇ飬ÅäÖÃÎļþµÄ½âÎö²¢²»¸´ÔÓ£¬ÔÚpythonÀï¸üÊÇÈç´Ë£¬ÔÚ¹Ù·½·¢²¼µÄ¿âÖоͰüº¬ÓÐ×öÕâ¼þÊÂÇéµÄ¿â£¬ÄǾÍÊÇConfigParser£¬ÕâÀï¼òµ¥µÄ×öһЩ½éÉÜ¡£
ConfigParser½âÎöµÄÅäÖÃÎļþµÄ¸ñÊ ......
¹¤¾ßÀ¸->¸ß¼¶->ÅäÖÃ->±à¼Æ÷ÏÔʾ->Óï·¨¼ÓÁÁ->´ò¿ª
ÔÚ´ò¿ªµÄÎļþÖнáβ¼ÓÉÏÏÂÃæÎÄ×Ö£¬²¢±£´æ¡£
/L10"Python" Line Comment = # Block Comment One = """ Block Comment Off = """ Escape Char = \ File Extensions = PY PYW
/Indent Strings = ":"
/Function String 1 = "%[ ,^t]++def[ ]+^([a-zA-Z0-9_] ......
write by ¾ÅÌìÑãôá(JTianLing) -- blog.csdn.net/vagrxie
ÌÖÂÛÐÂÎÅ×é¼°Îļþ
ÔÎÄÀ´×Ô£º¡¶JavaScript for C & Python programmers
¡·£¬¾¹ý×÷ÕßCanisÔÊÐíºó·Ò룬¼´Ê¹×ªÔØÇ븽´ø´ËÁ´½Ó¡£
Ç°ÑÔ£ººÜÉٸɷÒëµÄÊÂÇ飬ÀÛ£¬ÐÁ¿à£¬²»ÄÜ·¢»Ó£¬µäÐ͵ķÑÁ¦²»Ìֺã¬×î½üÎÞÁÄ£¬ÏëÔÚÍøÒ³ÉÏÏÔʾ¶¯»£¨ÒòΪCSDNÌ ......