python
zhen12321
贪心选择
展开
-
爬取csdn博主文章
#!/usr/bin/env pythonimport reimport requestsimport osimport sysfrom lxml import etreeheaders = { "User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.106 Safari/537.36"}# 传递的非单个博客地址,而是博客列表原创 2020-06-28 19:32:46 · 572 阅读 · 0 评论 -
如何制作离线tts?
tts->把文字转化为语音。先把中文转化为拼音。这个主要依靠1个字典,能把汉字和读音对应。下面提供字典:丂yu丄shang丅xia丆shi丏mian丗shi丟diu丠qiu両liang丣you並bing丩jiu丮ji丯jie丱kuang丳chan丵zhuo丷ba丼jing乀fu乁yi乂yi乆jiu乊hu乑yin乕hu乗sheng乚yin乛zhe乢gai乣jiu乨shi乪nang乴xue乵yan乸na乹qian乿luan原创 2020-06-27 07:42:41 · 50997 阅读 · 0 评论 -
python智能查询天气
python根据接口去解析本地的ip,得到本地的地址。根据代码中的city_id查询到city的id。然后到国家气象局提供的免费查询天气的接口去获取json数据。调了几项进行输出。#!/usr/bin/env python# 根据ip查询地址,查询天气import reimport jsonimport requestsr_json0 = requests.get('https://myip.ipip.net/json').textweather_dict = json.loads(r_j原创 2020-06-23 15:09:40 · 603 阅读 · 0 评论 -
查询天气python
#!/usr/bin/env python# 以北京市为例import reimport jsonimport requeststext = '''北京:101010100朝阳:101010300顺义:101010400怀柔:101010500通州:101010600昌平:101010700延庆:101010800丰台:101010900石景山:101011000大兴:101011100房山:101011200密云:101011300门头沟:101011400平谷:101011500八达岭:10原创 2020-06-23 14:59:47 · 311 阅读 · 3 评论 -
获得ip的小脚本
#!/usr/bin/env pythonimport requestsimport jsonr_json = requests.get('https://myip.ipip.net/json').text#r_json = '''#{"ret":"ok","data":{"ip":"223.90.33.23","location":["中国","河南","焦作","","移动"]}}#'''weather_dict = json.loads(r_json)location = weath原创 2020-06-23 14:12:20 · 171 阅读 · 0 评论 -
python
包裹搜索pyaudio原创 2020-06-23 11:56:34 · 78 阅读 · 0 评论