返回顶部
扩大
缩小

Heaton

Python基础(十四) 空气质量指数demo

空气质量指数1.0




'''
空气质量指数1.0
'''
def cal_linear(iaqi_lo, iaqi_hi, bp_lo, bp_hi, cp):
    """
        范围缩放 直接写出公式
    """
    iaqi = (iaqi_hi - iaqi_lo) * (cp - bp_lo) / (bp_hi - bp_lo) + iaqi_lo
    return iaqi

def cal_pm_iaqi(pm_val):
    """
        计算pm2.5的IAQI
    """
    if 0 <= pm_val < 36:
        iaqi = cal_linear(0, 50, 0, 35, pm_val)
    elif 36 <= pm_val < 76:
        iaqi = cal_linear(50, 100, 35, 75, pm_val)
    elif 76 <= pm_val < 116:
        iaqi = cal_linear(100, 150, 75, 115, pm_val)
    else:
        pass
    return iaqi

def cal_co_iaqi(co_val):
    """
        计算CO的IAQI
    """
    if 0 <= co_val < 3:
        iaqi = cal_linear(0, 50, 0, 3, co_val)
    elif 3 <= co_val < 5:
        iaqi = cal_linear(50, 100, 2, 4, co_val)
    else:
        pass
    return iaqi

def cal_aqi(param_list):
    """
        AQI计算
    """
    pm_val = param_list[0]
    co_val = param_list[1]
    pm_iaqi = cal_pm_iaqi(pm_val)
    co_iaqi = cal_co_iaqi(co_val)

    iaqi_list = []
    iaqi_list.append(pm_iaqi)
    iaqi_list.append(co_iaqi)

    aqi = max(iaqi_list)
    return aqi

def main():
    """
        主函数
    """
    print('请输入以下信息,用空格分割')
    input_str = input('(1)PM2.5 (2)CO:')
    str_list = input_str.split(' ')

    pm_val = float(str_list[0])
    co_val = float(str_list[1])
    param_list = []
    param_list.append(pm_val)
    param_list.append(co_val)

    # 调用AQI计算函数
    aqi_val = cal_aqi(param_list)

    print('空气质量指数为:{}'.format(aqi_val))

if __name__ == '__main__':
    main()

测试结果:

请输入以下信息,用空格分割
(1)PM2.5 (2)CO:55 3
空气质量指数为:75.0

空气质量指数2.0




#beijing_aqi.json
[
   {
      "aqi":47,
      "area":"北京",
      "pm2_5":32,
      "pm2_5_24h":33,
      "position_name":"万寿西宫",
      "primary_pollutant":null,
      "quality":"优",
      "station_code":"1001A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":63,
      "area":"北京",
      "pm2_5":37,
      "pm2_5_24h":20,
      "position_name":"定陵",
      "primary_pollutant":"颗粒物(PM10)",
      "quality":"良",
      "station_code":"1002A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":57,
      "area":"北京",
      "pm2_5":40,
      "pm2_5_24h":36,
      "position_name":"东四",
      "primary_pollutant":"细颗粒物(PM2.5)",
      "quality":"良",
      "station_code":"1003A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":44,
      "area":"北京",
      "pm2_5":24,
      "pm2_5_24h":30,
      "position_name":"天坛",
      "primary_pollutant":null,
      "quality":"优",
      "station_code":"1004A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":46,
      "area":"北京",
      "pm2_5":28,
      "pm2_5_24h":38,
      "position_name":"农展馆",
      "primary_pollutant":null,
      "quality":"优",
      "station_code":"1005A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":58,
      "area":"北京",
      "pm2_5":41,
      "pm2_5_24h":32,
      "position_name":"官园",
      "primary_pollutant":"细颗粒物(PM2.5)",
      "quality":"良",
      "station_code":"1006A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":54,
      "area":"北京",
      "pm2_5":38,
      "pm2_5_24h":28,
      "position_name":"海淀区万柳",
      "primary_pollutant":"细颗粒物(PM2.5)",
      "quality":"良",
      "station_code":"1007A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":102,
      "area":"北京",
      "pm2_5":76,
      "pm2_5_24h":38,
      "position_name":"顺义新城",
      "primary_pollutant":"细颗粒物(PM2.5)",
      "quality":"轻度污染",
      "station_code":"1008A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":80,
      "area":"北京",
      "pm2_5":48,
      "pm2_5_24h":21,
      "position_name":"怀柔镇",
      "primary_pollutant":"臭氧1小时",
      "quality":"良",
      "station_code":"1009A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":77,
      "area":"北京",
      "pm2_5":46,
      "pm2_5_24h":20,
      "position_name":"昌平镇",
      "primary_pollutant":"颗粒物(PM10)",
      "quality":"良",
      "station_code":"1010A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":60,
      "area":"北京",
      "pm2_5":43,
      "pm2_5_24h":32,
      "position_name":"奥体中心",
      "primary_pollutant":"细颗粒物(PM2.5)",
      "quality":"良",
      "station_code":"1011A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":50,
      "area":"北京",
      "pm2_5":35,
      "pm2_5_24h":27,
      "position_name":"古城",
      "primary_pollutant":null,
      "quality":"优",
      "station_code":"1012A",
      "time_point":"2017-07-29T14:00:00Z"
   },
   {
      "aqi":58,
      "area":"北京",
      "pm2_5":40,
      "pm2_5_24h":29,
      "position_name":null,
      "primary_pollutant":"颗粒物(PM2.5),颗粒物(PM10)",
      "quality":"良",
      "station_code":null,
      "time_point":"2017-07-29T14:00:00Z"
   }
]
'''
空气质量指数2.0
'''
import json

def process_json_file(filepath):
    """
        解码json文件
    """
    f = open(filepath, mode='r', encoding='utf-8')
    city_list = json.load(f)
    return city_list

def main():
    """
        主函数
    """
    filepath = input('请输入json文件名称:')
    city_list = process_json_file(filepath)
    city_list.sort(key=lambda city: city['aqi'])
    top5_list = city_list[:5]

    f = open('top5_aqi.json', mode='w', encoding='utf-8')
    json.dump(top5_list, f, ensure_ascii=False)
    f.close()

if __name__ == '__main__':
    main()

测试结果:

请输入json文件名称:beijing_aqi.json

空气质量指数3.0


'''
空气质量指数3.0
'''
import json
import csv

def process_json_file(filepath):
    """
        解码json文件
    """
    f = open(filepath, mode='r', encoding='utf-8')
    city_list = json.load(f)
    return city_list

def main():
    """
        主函数
    """
    filepath = input('请输入json文件名称:')
    city_list = process_json_file(filepath)
    city_list.sort(key=lambda city: city['aqi'])

    lines = []
    # 列名
    lines.append(list(city_list[0].keys()))
    for city in city_list:
        lines.append(list(city.values()))

    f = open('aqi.csv', 'w', encoding='utf-8', newline='')
    writer = csv.writer(f)
    for line in lines:
        writer.writerow(line)
    f.close()

if __name__ == '__main__':
    main()

测试结果:

请输入json文件名称:beijing_aqi.json

空气质量指数4.0



'''
空气质量指数4.0
'''
import json
import csv
import os

def process_json_file(filepath):
    """
        解码json文件
    """
    with open(filepath, mode='r', encoding='utf-8') as f:
        city_list = json.load(f)
    print(city_list)

def process_csv_file(filepath):
    """
        处理csv文件
    """
    with open(filepath, mode='r', encoding='utf-8', newline='') as f:
        reader = csv.reader(f)
        for row in reader:
            print(', '.join(row))

def main():
    """
        主函数
    """
    filepath = input('请输入文件名称:')
    filename, file_ext = os.path.splitext(filepath)

    if file_ext == '.json':
        # json文件
        process_json_file(filepath)
    elif file_ext == '.csv':
        # csv文件
        process_csv_file(filepath)
    else:
        print('不支持的文件格式!')

if __name__ == '__main__':
    main()

测试结果1:

请输入文件名称:beijing_aqi.json
[{'aqi': 47, 'area': '北京', 'pm2_5': 32, 'pm2_5_24h': 33, 'position_name': '万寿西宫', 'primary_pollutant': None, 'quality': '优', 'station_code': '1001A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 63, 'area': '北京', 'pm2_5': 37, 'pm2_5_24h': 20, 'position_name': '定陵', 'primary_pollutant': '颗粒物(PM10)', 'quality': '良', 'station_code': '1002A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 57, 'area': '北京', 'pm2_5': 40, 'pm2_5_24h': 36, 'position_name': '东四', 'primary_pollutant': '细颗粒物(PM2.5)', 'quality': '良', 'station_code': '1003A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 44, 'area': '北京', 'pm2_5': 24, 'pm2_5_24h': 30, 'position_name': '天坛', 'primary_pollutant': None, 'quality': '优', 'station_code': '1004A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 46, 'area': '北京', 'pm2_5': 28, 'pm2_5_24h': 38, 'position_name': '农展馆', 'primary_pollutant': None, 'quality': '优', 'station_code': '1005A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 58, 'area': '北京', 'pm2_5': 41, 'pm2_5_24h': 32, 'position_name': '官园', 'primary_pollutant': '细颗粒物(PM2.5)', 'quality': '良', 'station_code': '1006A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 54, 'area': '北京', 'pm2_5': 38, 'pm2_5_24h': 28, 'position_name': '海淀区万柳', 'primary_pollutant': '细颗粒物(PM2.5)', 'quality': '良', 'station_code': '1007A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 102, 'area': '北京', 'pm2_5': 76, 'pm2_5_24h': 38, 'position_name': '顺义新城', 'primary_pollutant': '细颗粒物(PM2.5)', 'quality': '轻度污染', 'station_code': '1008A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 80, 'area': '北京', 'pm2_5': 48, 'pm2_5_24h': 21, 'position_name': '怀柔镇', 'primary_pollutant': '臭氧1小时', 'quality': '良', 'station_code': '1009A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 77, 'area': '北京', 'pm2_5': 46, 'pm2_5_24h': 20, 'position_name': '昌平镇', 'primary_pollutant': '颗粒物(PM10)', 'quality': '良', 'station_code': '1010A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 60, 'area': '北京', 'pm2_5': 43, 'pm2_5_24h': 32, 'position_name': '奥体中心', 'primary_pollutant': '细颗粒物(PM2.5)', 'quality': '良', 'station_code': '1011A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 50, 'area': '北京', 'pm2_5': 35, 'pm2_5_24h': 27, 'position_name': '古城', 'primary_pollutant': None, 'quality': '优', 'station_code': '1012A', 'time_point': '2017-07-29T14:00:00Z'}, {'aqi': 58, 'area': '北京', 'pm2_5': 40, 'pm2_5_24h': 29, 'position_name': None, 'primary_pollutant': '颗粒物(PM2.5),颗粒物(PM10)', 'quality': '良', 'station_code': None, 'time_point': '2017-07-29T14:00:00Z'}]

测试结果2:

请输入文件名称:aqi.csv
aqi, area, pm2_5, pm2_5_24h, position_name, primary_pollutant, quality, station_code, time_point
44, 北京, 24, 30, 天坛, , 优, 1004A, 2017-07-29T14:00:00Z
46, 北京, 28, 38, 农展馆, , 优, 1005A, 2017-07-29T14:00:00Z
47, 北京, 32, 33, 万寿西宫, , 优, 1001A, 2017-07-29T14:00:00Z
50, 北京, 35, 27, 古城, , 优, 1012A, 2017-07-29T14:00:00Z
54, 北京, 38, 28, 海淀区万柳, 细颗粒物(PM2.5), 良, 1007A, 2017-07-29T14:00:00Z
57, 北京, 40, 36, 东四, 细颗粒物(PM2.5), 良, 1003A, 2017-07-29T14:00:00Z
58, 北京, 41, 32, 官园, 细颗粒物(PM2.5), 良, 1006A, 2017-07-29T14:00:00Z
58, 北京, 40, 29, , 颗粒物(PM2.5),颗粒物(PM10), 良, , 2017-07-29T14:00:00Z
60, 北京, 43, 32, 奥体中心, 细颗粒物(PM2.5), 良, 1011A, 2017-07-29T14:00:00Z
63, 北京, 37, 20, 定陵, 颗粒物(PM10), 良, 1002A, 2017-07-29T14:00:00Z
77, 北京, 46, 20, 昌平镇, 颗粒物(PM10), 良, 1010A, 2017-07-29T14:00:00Z
80, 北京, 48, 21, 怀柔镇, 臭氧1小时, 良, 1009A, 2017-07-29T14:00:00Z
102, 北京, 76, 38, 顺义新城, 细颗粒物(PM2.5), 轻度污染, 1008A, 2017-07-29T14:00:00Z

空气质量指数5.0




http://docs.python-requests.org/en/master/



'''
空气质量指数5.0
'''
import requests

def get_html_text(url):
    """
        返回url的文本
    """
    r = requests.get(url, timeout=30)
    # print(r.status_code)
    return r.text

def main():
    """
        主函数
    """
    city_pinyin = input('请输入城市拼音:')
    url = 'http://pm25.in/' + city_pinyin
    url_text = get_html_text(url)

    aqi_div = '''<div class="span12 data">
        <div class="span1">
          <div class="value">
          '''

    index = url_text.find(aqi_div)
    begin_index = index + len(aqi_div)
    end_index = begin_index + 2
    aqi_val = url_text[begin_index: end_index]
    print('空气质量为:{}'.format(aqi_val))

if __name__ == '__main__':
    main()

测试结果1:

请输入城市拼音:beijing
空气质量为:58

测试结果2:

请输入城市拼音:beijing
空气质量为:70

空气质量指数6.0







#注意需要安装lxml库
'''
空气质量指数6.0
'''
import requests
from bs4 import BeautifulSoup

def get_city_aqi(city_pinyin):
    """
        获取城市的AQI
    """
    url = 'http://pm25.in/' + city_pinyin
    r = requests.get(url, timeout=30)
    soup = BeautifulSoup(r.text, 'lxml')
    div_list = soup.find_all('div', {'class': 'span1'})

    city_aqi = []
    for i in range(8):
        div_content = div_list[i]
        caption = div_content.find('div', {'class': 'caption'}).text.strip()
        value = div_content.find('div', {'class': 'value'}).text.strip()

        city_aqi.append((caption, value))
    return city_aqi

def main():
    """
        主函数
    """
    city_pinyin = input('请输入城市拼音:')
    city_aqi = get_city_aqi(city_pinyin)
    print(city_aqi)

if __name__ == '__main__':
    main()

测试结果:

请输入城市拼音:beijing
[('AQI', '70'), ('PM2.5/1h', '50'), ('PM10/1h', '46'), ('CO/1h', '1.02'), ('NO2/1h', '35'), ('O3/1h', '71'), ('O3/8h', '48'), ('SO2/1h', '5')]

空气质量指数7.0




'''
空气质量指数7.0
'''
import requests
from bs4 import BeautifulSoup

def get_city_aqi(city_pinyin):
    """
        获取城市的AQI
    """
    url = 'http://pm25.in/' + city_pinyin
    r = requests.get(url, timeout=30)
    soup = BeautifulSoup(r.text, 'lxml')
    div_list = soup.find_all('div', {'class': 'span1'})

    city_aqi = []
    for i in range(8):
        div_content = div_list[i]
        caption = div_content.find('div', {'class': 'caption'}).text.strip()
        value = div_content.find('div', {'class': 'value'}).text.strip()

        city_aqi.append((caption, value))
    return city_aqi

def get_all_cities():
    """
        获取所有城市
    """
    url = 'http://pm25.in/'
    city_list = []
    r = requests.get(url, timeout=30)
    soup = BeautifulSoup(r.text, 'lxml')

    city_div = soup.find_all('div', {'class': 'bottom'})[1]
    city_link_list = city_div.find_all('a')
    for city_link in city_link_list:
        city_name = city_link.text
        city_pinyin = city_link['href'][1:]
        city_list.append((city_name, city_pinyin))
    return city_list

def main():
    """
        主函数
    """
    city_list = get_all_cities()
    for city in city_list:
        city_name = city[0]
        city_pinyin = city[1]
        city_aqi = get_city_aqi(city_pinyin)
        print(city_name, city_aqi)

if __name__ == '__main__':
    main()

测试结果(可以看见一直在请求):

空气质量指数8.0

'''
空气质量指数8.0
'''
import requests
from bs4 import BeautifulSoup
import csv

def get_city_aqi(city_pinyin):
    """
        获取城市的AQI
    """
    url = 'http://pm25.in/' + city_pinyin
    r = requests.get(url, timeout=30)
    soup = BeautifulSoup(r.text, 'lxml')
    div_list = soup.find_all('div', {'class': 'span1'})

    city_aqi = []
    for i in range(8):
        div_content = div_list[i]
        caption = div_content.find('div', {'class': 'caption'}).text.strip()
        value = div_content.find('div', {'class': 'value'}).text.strip()

        # city_aqi.append((caption, value))
        city_aqi.append(value)
    return city_aqi

def get_all_cities():
    """
        获取所有城市
    """
    url = 'http://pm25.in/'
    city_list = []
    r = requests.get(url, timeout=30)
    soup = BeautifulSoup(r.text, 'lxml')

    city_div = soup.find_all('div', {'class': 'bottom'})[1]
    city_link_list = city_div.find_all('a')
    for city_link in city_link_list:
        city_name = city_link.text
        city_pinyin = city_link['href'][1:]
        city_list.append((city_name, city_pinyin))
    return city_list

def main():
    """
        主函数
    """
    city_list = get_all_cities()
    # for city in city_list:
    #     city_name = city[0]
    #     city_pinyin = city[1]
    #     city_aqi = get_city_aqi(city_pinyin)
    #     print(city_name, city_aqi)
    header = ['City', 'AQI', 'PM2.5/1h', 'PM10/h', 'CO/1h', 'NO2/1h', 'O3/1h', 'O3/8h', 'SO2/1h']

    with open('china_city_aqi.csv', 'w', encoding='utf-8', newline='') as f:
        writer = csv.writer(f)
        writer.writerow(header)
        for i, city in enumerate(city_list):
            if (i + 1) % 10 == 0:
                print('已处理{}条记录。(共{}条记录)'.format(i + 1, len(city_list)))

            city_name = city[0]
            city_pinyin = city[1]
            city_aqi = get_city_aqi(city_pinyin)
            row = [city_name] + city_aqi
            writer.writerow(row)

if __name__ == '__main__':
    main()

测试结果:

空气质量指数9.0











'''
空气质量指数9.0
'''
import pandas as pd

def main():
    """
        主函数
    """
    aqi_data = pd.read_csv('china_city_aqi.csv')
    print('基本信息:')
    print(aqi_data.info())

    print('数据预览:')
    print(aqi_data.head())

    # 基本统计
    print('AQI最大值:', aqi_data['AQI'].max())
    print('AQI最小值:', aqi_data['AQI'].min())
    print('AQI均值:', aqi_data['AQI'].mean())

    # top10
    top10_cities = aqi_data.sort_values(by=['AQI']).head(10)
    print('空气质量最好的10个城市:')
    print(top10_cities)

    # bottom10
    # bottom10_cities = aqi_data.sort_values(by=['AQI']).tail(10)
    bottom10_cities = aqi_data.sort_values(by=['AQI'], ascending=False).head(10)
    print('空气质量最差的10个城市:')
    print(bottom10_cities)

    # 保存csv文件
    top10_cities.to_csv('top10_aqi.csv', index=False)
    bottom10_cities.to_csv('bottom10_aqi.csv', index=False)


if __name__ == '__main__':
    main()

测试结果:

基本信息:
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 375 entries, 0 to 374
Data columns (total 9 columns):
City 375 non-null object
AQI 375 non-null int64
PM2.5/1h 375 non-null int64
PM10/h 375 non-null int64
CO/1h 375 non-null float64
NO2/1h 375 non-null int64
O3/1h 375 non-null int64
O3/8h 375 non-null int64
SO2/1h 375 non-null int64
dtypes: float64(1), int64(7), object(1)
memory usage: 26.4+ KB
None
数据预览:
City AQI PM2.5/1h PM10/h CO/1h NO2/1h O3/1h O3/8h SO2/1h
0 阿坝州 45 7 20 0.30 1 131 89 6
1 阿克苏地区 199 87 345 0.90 43 47 36 12
2 阿拉善盟 62 43 71 0.73 14 115 96 17
3 阿勒泰地区 40 2 8 0.70 27 89 78 76
4 阿里地区 0 0 0 0.00 0 0 46 0
AQI最大值: 500
AQI最小值: 0
AQI均值: 78.344
空气质量最好的10个城市:
City AQI PM2.5/1h PM10/h CO/1h NO2/1h O3/1h O3/8h SO2/1h
234 荣成 0 0 0 0.0 0 0 0 0
294 吴江 0 0 0 0.0 0 0 0 0
288 文登 0 0 0 0.0 0 0 0 0
284 瓦房店 0 0 0 0.0 0 0 0 0
270 太仓 0 0 0 0.0 0 0 0 0
257 寿光 0 0 0 0.0 0 0 0 0
54 大兴安岭地 0 0 0 0.0 0 0 0 0
235 乳山 0 0 0 0.0 0 0 0 0
72 富阳 0 0 0 0.0 0 0 0 0
212 平度 0 0 0 0.0 0 0 0 0
空气质量最差的10个城市:
City AQI PM2.5/1h PM10/h CO/1h NO2/1h O3/1h O3/8h SO2/1h
154 库尔勒 500 71 666 0.67 8 62 54 5
312 邢台 370 319 414 3.65 88 52 29 18
320 许昌 354 303 0 1.67 28 90 57 11
9 安阳 337 286 338 3.53 47 63 24 11
95 邯郸 324 273 353 2.40 47 56 20 23
242 商丘 317 266 286 1.61 47 61 34 13
254 石家庄 308 257 344 2.69 55 65 33 24
14 保定 298 247 278 2.28 49 60 25 8
98 鹤壁 290 239 285 1.93 48 40 21 7
361 郑州 290 239 266 1.50 75 43 16 10

空气质量指数10.0




https://pandas.pydata.org/pandas-docs/stable/user_guide/visualization.html

'''
空气质量指数10.0
'''
import pandas as pd
import matplotlib.pyplot as plt

plt.rcParams['font.sans-serif'] = ['SimHei']
plt.rcParams['axes.unicode_minus'] = False

def main():
    """
        主函数
    """
    aqi_data = pd.read_csv('china_city_aqi.csv')
    print('基本信息:')
    print(aqi_data.info())

    print('数据预览:')
    print(aqi_data.head())

    # 数据清洗
    # 只保留AQI>0的数据

    clean_aqi_data = aqi_data[aqi_data['AQI'] > 0]

    # 基本统计
    print('AQI最大值:', clean_aqi_data['AQI'].max())
    print('AQI最小值:', clean_aqi_data['AQI'].min())
    print('AQI均值:', clean_aqi_data['AQI'].mean())

    # top50
    top50_cities = clean_aqi_data.sort_values(by=['AQI']).head(50)
    top50_cities.plot(kind='bar', x='City', y='AQI', title='空气质量最好的50个城市',
                      figsize=(20, 10))
    plt.savefig('top50_aqi_bar.png')
    plt.show()

if __name__ == '__main__':
    main()

测试结果:

posted on 2019-02-21 16:50  咘雷扎克  阅读(524)  评论(0编辑  收藏  举报

导航