pythonµ¼³öÓÊÏäÀïµÄÁªÏµÈË£¬Ö§³ÖGmailµÈ
PythonÓïÑÔ
: µ¼³öÓÊÏäÀïµÄÁªÏµÈË£ºÖ§³ÖGmail£¬126£¬ÍøÒ×£¬ËѺü£¬Hotmail£¬ÐÂÀË£¬ÑÅ»¢£¬MSN
#!/usr/bin/env python
#coding=utf-8
from
BeautifulSoup
import
BeautifulSoup
import
os
,
urllib
,
urllib2
,
pdb
import
cookielib
import
httplib
import
csv
,
re
GDATA_URL
=
'/accounts/ClientLogin'
class
MailContactError
(Exception
):
pass
class
MailContact
:
def
__init__
(self
,
username
,
password
):
pass
def
login
(self
):
pass
def
get_contacts
(self
):
pass
def
get_contact_page
(self
):
pass
class
GMailContact
(MailContact
):
"""
A class to retrieve a users contacts from their Google Account.
Dependencies:
-------------
* BeautifulSoup.
* That's it. :-)
Usage:
------
>>> g = GMailContact('email@example.org', 'password')
>>> g.login()
(200, 'OK')
>>> g.get_contacts()
>>> g.contacts
[(u'Persons Name', 'name@person.com'), ...]
"""
def
__init__
(self
,
username
=
'test@gmail.com'
,
password
=
'test'
,
service
=
'cp'
):
self
.
mail_type
=
"@gmail.com"
self
.
username
=
username
+
self
.
mail_type
self
.
password
=
password
 
Ïà¹ØÎĵµ£º
ÈçÓÐһ·¾¶"e:/software/²âÊÔ.txt"
ÐèҪͨ¹ýpyhon¶Á/д "²âÊÔ.txt"Îļþ£¬¿ÉÒÔ²ÉÓÃÏÂÃæµÄ·½·¨£º
ipath = "e:/software/²âÊÔ.txt"
uipath = unicode(ipath , "utf8")
È»ºóÓÃ"uipath"¾¹ý±àÂëºóµÄ·¾¶È¥open()¼´¿É¡£
ÏÂÃæÊÇÎÒÔÚÏîÄ¿ÖÐÓÃpython¶ÁдexcelµÄÒ»µãÌå»á(½â¾öÁ˶ÁÖÐÎÄÎļþà ......
Python 3 ½Ì³Ì¶þ:Îļþ,Ŀ¼ºÍ·¾¶
http://www.cnitblog.com/yunshichen/archive/2009/04/01/55931.html
python osÄ£¿é
http://hi.baidu.com/happynp/blog/item/729243f902d5a751242df2c2.html
http://hi.baidu.com/fiber212121/blog/item/6e07ec03c97b6982d53f7c27.html
python getoptÄ£¿é
http://www.tsnc.edu.cn/de ......
ÀàÐÍ
·½·¨
×¢½â
Ìî³ä
center(width[, fillchar]) ,
ljust(width[, fillchar]),
rjust(width[, fillchar]),
zfill(width),
expandtabs([tabsize])
l
fillchar ²ÎÊýÖ¸¶¨ÁËÓÃÒÔÌî³äµÄ×Ö·û£¬Ä¬ÈÏΪ¿Õ¸ñ
l
¹Ë ......
mysqlÊÇÒ»¸öÓÅÐãµÄ¿ªÔ´Êý¾Ý¿â£¬ËüÏÖÔÚµÄÓ¦Ó÷dz£µÄ¹ã·º£¬Òò´ËºÜÓбØÒª¼òµ¥µÄ½éÉÜÒ»ÏÂÓÃpython²Ù×÷mysqlÊý¾Ý¿âµÄ·½·¨¡£python²Ù×÷Êý¾Ý¿âÐèÒª°²×°Ò»¸öµÚÈý·½µÄÄ£¿é£¬ÔÚhttp://mysql-python.sourceforge.net/
ÓÐÏÂÔØºÍÎĵµ¡£
ÓÉÓÚpythonµÄÊý¾Ý¿âÄ£¿éÓÐרÃŵÄÊý¾Ý¿âÄ£¿éµÄ¹æ·¶£¬ËùÒÔ£¬Æäʵ²»¹ÜʹÓÃÄÄÖÖÊý¾ ......
±àÒëPython½Å±¾Éú³É¿ÉÖ´ÐгÌÐò£¬¿ÉÒÔͨ¹ýpy2exe±àÒëÍê³É¡£
ÔÚVCÖе÷ÓÃpythonʱ£¬¿ÉÒÔ½áºÏpy2exe£¬Íê³ÉÕû¸ö³ÌÐòµÄ¶ÀÁ¢·¢²¼^_^
google.py:
#! /usr/bin/env python
import sys, webbrowser
def main(a):
url = "http://www.google.com/search?q=%s" % a
webbrowser.o ......