import urllib.request as r #联网包
from prttytable import PrettyTable #美化包
from colorama import init,Fore #颜色包
import json #json包
import requests #联网包
init(autoreset=False)
########颜色类
class Colored(object):
# 前景色:红色 背景色:默认
def red(self, s):
return Fore.LIGHTRED_EX + s + Fore.RESET
# 前景色:绿色 背景色:默认
def green(self, s):
return Fore.LIGHTGREEN_EX + s + Fore.RESET
def yellow(self, s):
return Fore.LIGHTYELLOW_EX + s + Fore.RESET
def white(self,s):
return Fore.LIGHTWHITE_EX + s + Fore.RESET
def blue(self,s):
return Fore.LIGHTBLUE_EX + s + Fore.RESET
#火车站三字码
urlr=‘https://kyfw.12306.cn/otn/resources/js/framework/station_na