Code highlighting produced by Actipro CodeHighlighter (freeware)
http://HdhCmsTestCodeHighlighter测试数据/
--> import httplib
conn = httplib.HTTPConnection( " HdhCmsTestcnblogs测试数据 " )
conn.request( " GET " , " /coderzh/archive/2008/05/13/1194445.html " )
r = conn.getresponse()
print r.read() # 获取所有内容
例二:使用smtplib发送邮件
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://HdhCmsTestCodeHighlighter测试数据/
--> import smtplib
smtpServer = ' smtp.xxx测试数据 '
fromaddr = ' foo@xxx测试数据 '
toaddrs = ' your@xxx测试数据 '
msg = ' Subject: xxxxxxxxx '
server = smtplib.SMTP(smtpServer)
server.sendmail(fromaddr, toaddrs, msg)
server.quit( )
查看更多关于Pythonhttplib,smtplib使用方法的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did83093
阅读:41次