2018年8月15日

mysql_test

摘要: class mysql_conn(object): # 魔术方法, 初始化, 构造函数 def __init__(self): self.db = pymysql.connect(host='127.0.0.1', user='root', password='123456', port=3306, database='py1011') self.... 阅读全文

posted @ 2018-08-15 22:50 Pyton当歌人生几何 阅读(207) 评论(0) 推荐(0) 编辑

baisibudejie_requests

摘要: import requests #url url = 'http://www.budejie.com/' response = requests.get(url) with open('baidu.hrml' 'wb') as f: f.write(response.content) 阅读全文

posted @ 2018-08-15 22:47 Pyton当歌人生几何 阅读(154) 评论(0) 推荐(0) 编辑

baidu_urllib_requests

摘要: import requests import json # 1. url url = 'http://fanyi.baidu.com/sug' # 2. form/ data/ body def translate(kw): form = { 'kw': kw } # request 的post方法色使用 response = reque... 阅读全文

posted @ 2018-08-15 22:44 Pyton当歌人生几何 阅读(95) 评论(0) 推荐(0) 编辑

导航