摘要: import time,pymysqltry:#获取一个数据库连接,注意如果是UTF-8类型的,需要制定数据库conn=pymysql.connect(host='localhost',user='root',passwd='123456',db='test',port=3306,charset='... 阅读全文
posted @ 2015-01-08 16:41 chaotech 阅读(168) 评论(0) 推荐(0)
摘要: import urllib.requestresponse = urllib.request.urlopen('http://www.baidu.com/')html = response.read()z_data=html.decode('UTF-8')print(z_data) 阅读全文
posted @ 2015-01-08 16:38 chaotech 阅读(320) 评论(0) 推荐(0)