Python动态获取一个城市天气信息
导入第三方库import requests from bs4 import BeautifulSoup import json定义函数动态获取城市名以及编码将拿到的城市名以及编码存入字典info中def get_city_code(src, headers, info): # 异常处理 try: r = requests.get(url=src, headers=h
//
导入第三方库import requests from bs4 import BeautifulSoup import json定义函数动态获取城市名以及编码将拿到的城市名以及编码存入字典info中def get_city_code(src, headers, info): # 异常处理 try: r = requests.get(url=src, headers=h
官网下载python + PyCharm(不推荐)官网网址:https://www.python.org/downloads/windows/下载Anaconda + PyCharm(推荐)内置大量的python库节省安装库的繁琐操作官网网址:https://www.anaconda.com/Anaconda镜像安装包可以到:https://mirrors.tuna.tsinghua.edu.cn