Example 1: Use httplib to access a URL and obtain the returned content:
Import Httplib
Conn = Httplib. httpconnection ( " Www.cnblogs.com " )
Conn. Request ( " Get " , " /Coderzh/archive/2008/05/13/1194445 .html " )
R = Conn. getresponse ()
Print R. Read () # Get all content
Example 2: Use smtplib to send an email
Import Smtplib
Smtpserver = ' Smtp.xxx.com '
Fromaddr = ' Foo@xxx.com '
Toaddrs = ' Your@xxx.com '
MSG = ' Subject: XXXXXXXXX '
Server = Smtplib. SMTP (smtpserver)
Server. Sendmail (fromaddr, toaddrs, MSG)
Server. Quit ()
Python daily delicious series (total)
Python daily delicious (19)-time processing datetime
Python daily delicious (20)-command line parameter SYS. argv
Python daily delicious (21)-httplib, smtplib
Python daily delicious (22)-copy object (deep copy deepcopy and light copy)
Python daily delicious (23)-enumerate traversing Arrays
...