app_dongri.py 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. # -*- coding: utf-8 -*-
  2. from flask import Flask, render_template,jsonify
  3. from flask_socketio import SocketIO, emit
  4. from scriptBase.comon import *
  5. import pyautogui
  6. import base64
  7. import threading
  8. from dongri_task import *
  9. from collections import deque
  10. import json
  11. from concurrent.futures import ThreadPoolExecutor
  12. from flask_caching import Cache
  13. # 全局线程池,限制最大线程数为1
  14. executor = ThreadPoolExecutor(max_workers=1)
  15. cache = Cache(config={'CACHE_TYPE': 'null'}) # 使用 null 缓存类型
  16. app = Flask(__name__)
  17. cache.init_app(app)
  18. app.config['TEMPLATES_AUTO_RELOAD'] = True
  19. socketio = SocketIO(app, cors_allowed_origins="*", max_http_buffer_size=1e8)
  20. event = threading.Event()
  21. g_status_list = []
  22. last_time = 0.0
  23. task_queue = deque()
  24. last_process = ''
  25. isGameBegin = True
  26. autoTask = None
  27. isReset = False
  28. g_times = 0
  29. g_cureNum = 500
  30. g_switch = False
  31. g_isRestart = True
  32. last_change_time = time.time()
  33. @app.after_request
  34. def add_no_cache_header(response):
  35. # 添加禁用缓存的响应头
  36. response.headers["Cache-Control"] = "no-cache, no-store, must-revalidate"
  37. response.headers["Pragma"] = "no-cache"
  38. response.headers["Expires"] = "0"
  39. return response
  40. def thread_runTask():
  41. global last_process
  42. global task_queue,isReset
  43. while True:
  44. if event.is_set():
  45. task_queue.clear()
  46. if len(task_queue) != 0:
  47. # 初始时间
  48. current_time = time.time()
  49. task = task_queue[-1]
  50. task_queue.pop()
  51. last_process = task.name
  52. task.run()
  53. cost_time = int(time.time() - current_time)
  54. send_status(f"{task.name} 执行完成,耗时{cost_time}秒")
  55. myTimeSleep_small()
  56. else:
  57. myTimeSleep_big()
  58. if isReset:
  59. isReset = False
  60. cfg = read_cfg()
  61. if cfg['switch']:
  62. type = update_rungame_type()
  63. print(f'启动游戏{type}')
  64. restart_game(type)
  65. else:
  66. restart_game(0)
  67. @app.route('/')
  68. def index():
  69. return render_template('index_dongri.html')
  70. @socketio.on('connect')
  71. def handle_connect():
  72. print('Client connected')
  73. @socketio.on('disconnect')
  74. def handle_disconnect():
  75. print('Client disconnected')
  76. def send_hint(msg):#数组信息
  77. emit('processing_hint', msg)
  78. def send_todo():
  79. emit('processing_todo', get_todo_msgList())
  80. def send_status(msg):#软件执行状态
  81. global g_status_list, g_times
  82. try:
  83. if not msg == "":
  84. # 添加新的状态消息和时间到列表
  85. timestamp = datetime.now().strftime('%H:%M:%S') # 获取当前时间
  86. status_entry = {'msg': msg, 'time': timestamp} # 存储消息和时间
  87. g_status_list.append(status_entry)
  88. # 如果列表超过 5 条,移除最早的一条
  89. if len(g_status_list) > 5:
  90. g_status_list.pop(0)
  91. else:
  92. sendStr = ''
  93. for item in g_status_list:
  94. sendStr = f"{g_times}次-{item['time']}-{item['msg']}<br>" + sendStr
  95. emit('processing_status', sendStr)
  96. # 如果消息是 "结束",发送所有状态并清空列表
  97. if msg == "结束":
  98. g_status_list = [] # 清空列表
  99. event.clear()
  100. except Exception as e:
  101. print(f"Error in send_status: {e}")
  102. return
  103. @socketio.on('monitor_begin')
  104. def monitor_begin():
  105. global last_time, last_process
  106. current_time = time.time()
  107. elapsed_time = current_time - last_time
  108. if elapsed_time < 0.5:
  109. return
  110. last_time = current_time
  111. regionRet, regionPos = game_region()
  112. screenshot = pyautogui.screenshot(region=regionPos)
  113. #binary_img = binarize_image(screenshot)
  114. compressed_data = compress_image(screenshot)
  115. image_data_base64 = base64.b64encode(compressed_data).decode('utf-8')
  116. socketio.emit('image_data', image_data_base64)
  117. task_arr = []
  118. if not event.is_set():
  119. task_arr.append(last_process)
  120. for item in reversed(task_queue):
  121. task_arr.append(item.name)
  122. latest_tasks = task_arr[-5:] # only show the last 5 tasks
  123. send_hint(json.dumps(latest_tasks, ensure_ascii=False))
  124. send_todo()
  125. send_status('')
  126. #print("send img")
  127. @socketio.on('end_script')
  128. def handle_end_script():
  129. event.set()
  130. @socketio.on('end_game')
  131. def handle_end_game():
  132. event.set()
  133. task_close_game()
  134. send_status("结束2")
  135. event.clear()
  136. @socketio.on('get_title')
  137. def handle_get_title():
  138. str = task_getComputerName()
  139. dst = str + ' machine'
  140. emit('processing_title', dst)
  141. @socketio.on('reset_script')
  142. def handle_reset_script():
  143. python = sys.executable
  144. while '--reset' in sys.argv:
  145. # 从 sys.argv 列表中删除 --reset 参数
  146. sys.argv.remove('--reset')
  147. os.execl(python, python, *sys.argv)
  148. @socketio.on('restart_game')
  149. def handle_restart_game():
  150. python = sys.executable
  151. script = os.path.abspath(sys.argv[0]) # 获取当前脚本的绝对路径
  152. # 构建新的参数列表,移除旧的 --reset 并添加新的
  153. new_args = [arg for arg in sys.argv[1:] if arg != '--reset'] # 排除脚本名和旧的 --reset
  154. print(f"当前 Python 解释器: {python}")
  155. print(f"当前脚本路径: {script}")
  156. print(f"重启参数: {[python, script, *new_args, '--reset']}")
  157. try:
  158. # 使用 os.execv 是一种更“彻底”的重启方式,它会替换当前进程
  159. # 但 subprocess.Popen 也可以,前提是旧进程退出
  160. # subprocess.Popen([python, script, *new_args, '--reset'])
  161. os.execv(python, [python, script, *new_args, '--reset'])
  162. except Exception as e:
  163. print(f"重启失败: {e}")
  164. # 如果 os.execv 失败,可以尝试 subprocess.Popen 作为备用
  165. subprocess.Popen([python, script, *new_args, '--reset'])
  166. sys.exit(0) # 终止当前进程
  167. @app.route('/restart_game', methods=['POST'])
  168. def http_restart_game():
  169. print("HTTP 触发 restart_game")
  170. socketio.start_background_task(handle_restart_game)
  171. return jsonify({"status": "success", "message": "已重启"})
  172. @socketio.on('close_game')
  173. def handle_close_game():
  174. task_close_game()
  175. send_status("结束2")
  176. event.clear()
  177. @app.route('/close_game', methods=['POST'])
  178. def http_close_game():
  179. print("HTTP 触发 close_game")
  180. handle_close_game()
  181. socketio.start_background_task(handle_end_script)
  182. return jsonify({"status": "success", "message": "已关闭"})
  183. @socketio.on('read_cfg')
  184. def handle_read_cfg():
  185. cfg = read_cfg()
  186. emit('processing_cfg', cfg)
  187. def restart_game(type=0):
  188. global isGameBegin
  189. isGameBegin = False
  190. while True:
  191. task_close_game()
  192. if True == task_start_game(type):
  193. break
  194. else:
  195. send_status("启动失败")
  196. isGameBegin = True
  197. send_status("结束")
  198. config = read_cfg()
  199. print("config", config)
  200. auto_task(config)
  201. def auto_participate():
  202. task_queue.appendleft(task_returnAllLine())
  203. timeout = 40 * 60
  204. start_time = time.time() # 记录开始时间
  205. while not event.is_set():
  206. if len(task_queue) < 4:
  207. task_queue.appendleft(task_useAnnimalSkill(True))
  208. task_queue.appendleft(task_paticipateInTeam(False))
  209. task_queue.appendleft(task_paticipateInTeam())
  210. task_queue.appendleft(task_paticipateInTeam(False))
  211. task_queue.appendleft(task_paticipateInTeam())
  212. myTimeSleep_big()
  213. # 每次循环检查已用时间
  214. current_time = time.time()
  215. elapsed_time = current_time - start_time
  216. if elapsed_time >= timeout:
  217. handle_restart_game()
  218. break
  219. def auto_palace():
  220. global g_times, g_cureNum
  221. timeout = 180 * 60
  222. start_time = time.time() # 记录开始时间
  223. read_cfg()
  224. while not event.is_set():
  225. g_times += 1
  226. if len(task_queue) < 4:
  227. task_queue.appendleft(task_cure(True, g_cureNum * 5))
  228. task_queue.appendleft(task_cure(True, g_cureNum * 3))
  229. task_queue.appendleft(task_fight_enemy())
  230. myTimeSleep_big()
  231. current_time = time.time()
  232. elapsed_time = current_time - start_time
  233. if elapsed_time >= timeout:
  234. handle_restart_game()
  235. def add_auto_task(isMaxCollect, isJina, isSimple = False, isAddStrengh = False, activity = 'None', isAutoParticipate = True, isDailyConfig = False, train_type = 'None', always = False):
  236. global g_times, g_cureNum, g_switch, g_isRestart
  237. collectArr = [int(x) for x in isMaxCollect.split(",")]
  238. print("collectArr", collectArr)
  239. if len(collectArr) == 1:
  240. collectArr = collectArr[0]
  241. while not event.is_set():
  242. config = read_Dailycfg()
  243. print("config, check daily", config)
  244. if isSimple == False and is_within_n_minutes(get_todo_time("巨熊行动"), 20, 30):
  245. print("in fight bear")
  246. if len(task_queue) < 5:
  247. start_recording()
  248. task_queue.appendleft(task_returnAllLine())
  249. task_queue.appendleft(task_useAnnimalSkill(True))
  250. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  251. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  252. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  253. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  254. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  255. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  256. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  257. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  258. task_queue.appendleft(task_paticipateInTeam(not g_switch))
  259. myTimeSleep_big()
  260. send_status(f'巨熊行动中')
  261. continue
  262. elif isSimple == False and is_within_n_minutes(get_todo_time("巨熊行动"), 60, 0):
  263. # 设置无尽运行和启动的游戏为0
  264. always = True
  265. update_rungame_type(0)
  266. send_status(f'巨熊行动:在60min内,切换到无尽模式')
  267. stop_recording()
  268. print("add special activity")
  269. # special activity
  270. if activity == 'lianmeng':
  271. task_queue.appendleft(task_activity_lianmeng())
  272. elif activity == 'cure':
  273. task_queue.appendleft(task_cure(True, g_cureNum))
  274. elif activity == 'only_cure':
  275. task_queue.appendleft(task_cure(True, g_cureNum))
  276. task_queue.appendleft(task_cure(True, g_cureNum))
  277. task_queue.appendleft(task_cure(True, g_cureNum))
  278. return
  279. print("add normal activity")
  280. task_queue.appendleft(task_checkActivities())
  281. if g_switch == True:
  282. task_queue.appendleft(task_checkBenifitStatus())
  283. # first run
  284. #if g_times % 3 == 1:
  285. # task_queue.appendleft(check_safe_collect())
  286. if isSimple == False:
  287. task_queue.appendleft(task_information())
  288. task_queue.appendleft(task_check_Research())
  289. task_queue.appendleft(task_checkStoreRoom())
  290. if not isSimple:
  291. if isJina == 'jina':
  292. task_queue.appendleft(task_fight_jina(isAddStrengh))
  293. elif isJina == 'yongbing':
  294. task_queue.appendleft(task_fight_yongbing(isAddStrengh))
  295. elif isJina == 'monster':
  296. task_queue.appendleft(task_fightMonster(isAddStrengh, False, isSimple))
  297. elif isJina == 'big_monster' or isJina == 'bigMonster_max':
  298. task_queue.appendleft(task_fightMonster(isAddStrengh, True, isSimple))
  299. elif isJina == 'jina_call':
  300. ### 全部聊天记录都是新吉娜
  301. task_queue.appendleft(task_call_jina())
  302. task_queue.appendleft(task_call_jina())
  303. task_queue.appendleft(task_call_jina())
  304. task_queue.appendleft(task_call_jina())
  305. elif isJina == 'jina_onlyFight':
  306. task_queue.appendleft(task_fight_jina_only())
  307. task_queue.appendleft(task_collect(collectArr, isSimple, isAddStrengh))
  308. task_queue.appendleft(task_train(train_type))
  309. if isSimple == False:
  310. if not isAddStrengh: # 如果不是添加体力,则添加一次采集
  311. task_queue.appendleft(task_collect(collectArr, isSimple, isAddStrengh))
  312. if isJina == 'monster' and isAddStrengh:
  313. task_queue.appendleft(task_fightMonster(isAddStrengh, False, isSimple))
  314. else:
  315. task_queue.appendleft(task_collect(collectArr, isSimple, isAddStrengh))
  316. else:
  317. task_queue.appendleft(task_collect(collectArr, isSimple, isAddStrengh))
  318. print("add rare activity")
  319. if g_times % 5 == 1:
  320. if get_rungame_type() == 0:
  321. task_queue.appendleft(check_buildOrResearch())
  322. task_queue.appendleft(task_cure(True, g_cureNum))
  323. task_queue.appendleft(task_information())
  324. task_queue.appendleft(task_checkDonata())
  325. task_queue.appendleft(task_checkMaster())
  326. task_queue.appendleft(task_checkAdventure())
  327. task_queue.appendleft(task_train(train_type))
  328. task_queue.appendleft(task_useAnnimalSkill())
  329. task_queue.appendleft(task_read_mails())
  330. task_queue.appendleft(task_getStrength())
  331. if auto_participate:
  332. task_queue.appendleft(task_checkConfilits())
  333. task_queue.appendleft(task_checkDiamond())
  334. task_queue.appendleft(task_fight_campion())
  335. task_queue.appendleft(task_get_fire_crystal())
  336. task_queue.appendleft(task_checkUnionTreasure())
  337. #task_queue.appendleft(task_checkBenifitStatus())
  338. task_queue.appendleft(task_gotoTree())
  339. task_queue.appendleft(task_checkHelp())
  340. if activity == 'redPackage':
  341. task_queue.appendleft(task_get_redPackage())
  342. if isJina == 'bigMonster_max':
  343. task_queue.appendleft(task_fightMonster(isAddStrengh, True, isSimple))
  344. print("check restart")
  345. g_times += 1
  346. restart_times = 7
  347. if g_switch:
  348. restart_times = 4
  349. if g_times % restart_times == 0 and g_times != 0:
  350. if g_isRestart:
  351. handle_end_game()
  352. if g_switch == False:
  353. if always:
  354. myTimeSleep(random.randint(400, 450), send_status)
  355. else:
  356. myTimeSleep(random.randint(1000, 2000), send_status)
  357. else:
  358. myTimeSleep(random.randint(20, 50), send_status)
  359. if g_isRestart:
  360. handle_restart_game()
  361. else:
  362. myTimeSleep(random.randint(400, 450), send_status)
  363. task_queue.clear()
  364. send_status(f'自动模式结束')
  365. event.clear()
  366. daily_config = {
  367. "login_task": False,
  368. "fight_bigMonster_times": 0
  369. }
  370. def check_daily_config(config):
  371. today = datetime.now().strftime('%Y-%m-%d') # 获取当前日期
  372. print(f"Today: {today}") # 打印当前日期
  373. print(f"Config: {config}") # 打印传入的配置
  374. if "daily" not in config:
  375. print("Daily key not found, creating it.") # 调试信息
  376. config["daily"] = {}
  377. return False
  378. if today not in config["daily"]:
  379. print(f"Today's config not found: {today}") # 调试信息
  380. return False
  381. else:
  382. print(f"Today's config found: {today}") # 调试信息
  383. return True
  384. def update_rungame_type(dstType=None):
  385. config = read_Dailycfg()
  386. runTypeStr = 'runType'
  387. if runTypeStr not in config:
  388. if dstType is not None:
  389. config[runTypeStr] = dstType
  390. else:
  391. config[runTypeStr] = 1
  392. write_Dailycfg(config)
  393. print(f"更新下次启动{config[runTypeStr]}")
  394. return 0
  395. else:
  396. value = config[runTypeStr]
  397. if dstType is not None:
  398. config[runTypeStr] = dstType
  399. else:
  400. config[runTypeStr] = (value + 1) % 2
  401. write_Dailycfg(config)
  402. print(f"更新下次启动{config[runTypeStr]}")
  403. return value
  404. def get_rungame_type():
  405. config = read_Dailycfg()
  406. runTypeStr = 'runType'
  407. if runTypeStr not in config:
  408. return 0
  409. else:
  410. if config[runTypeStr] == 0:
  411. return 1
  412. else:
  413. return 0
  414. # 修改或添加 "login_task" 的值
  415. def set_login_task(config, value):
  416. today = datetime.now().strftime('%Y-%m-%d') # 获取当前日期
  417. if today not in config["daily"]: # 如果当天的配置不存在
  418. config["daily"][today] = {} # 创建当天的配置
  419. config["daily"][today]["login_task"] = value # 设置或更新 "login_task"
  420. return config
  421. # 修改或添加 "fight_bigMonster_times" 的值
  422. def set_fight_big_monster_times(config, value):
  423. today = datetime.now().strftime('%Y-%m-%d') # 获取当前日期
  424. if today not in config["daily"]: # 如果当天的配置不存在
  425. config["daily"][today] = {} # 创建当天的配置
  426. config["daily"][today]["fight_bigMonster_times"] = value # 设置或更新 "fight_bigMonster_times"
  427. return config
  428. def add_today_daily_config(config, daily_config, overwrite=False):
  429. today = datetime.now().strftime('%Y-%m-%d') # 获取当前日期
  430. if today not in config["daily"] or overwrite: # 如果不存在或允许覆盖
  431. config["daily"][today] = daily_config # 添加或更新
  432. return config
  433. # 清理非当天的每日配置
  434. def clean_old_daily_configs(config):
  435. today = datetime.now().strftime('%Y-%m-%d') # 获取当前日期
  436. keys_to_remove = [key for key in config["daily"] if key != today] # 找到非当天的每日配置
  437. for key in keys_to_remove:
  438. del config["daily"][key] # 删除非当天的每日配置
  439. return config
  440. def write_cfg(config):
  441. with open('config.json', 'w') as config_file:
  442. json.dump(config, config_file, indent=4)
  443. def read_cfg():
  444. global g_cureNum
  445. try:
  446. with open('config.json', 'r') as config_file:
  447. config = json.load(config_file)
  448. g_cureNum = config['cureNumber']
  449. return config
  450. except FileNotFoundError:
  451. print("配置文件不存在,请检查文件路径。")
  452. return None
  453. except PermissionError:
  454. print("没有权限读取配置文件。")
  455. return None
  456. except json.JSONDecodeError:
  457. print("配置文件格式错误,请检查文件内容是否为有效的 JSON。")
  458. return None
  459. def write_Dailycfg(config):
  460. with open('daily.json', 'w') as config_file:
  461. json.dump(config, config_file, indent=4)
  462. def read_Dailycfg():
  463. try:
  464. with open('daily.json', 'r') as config_file:
  465. config = json.load(config_file)
  466. return config
  467. except FileNotFoundError:
  468. print("配置文件不存在,请检查文件路径。")
  469. return None
  470. except PermissionError:
  471. print("没有权限读取配置文件。")
  472. return None
  473. except json.JSONDecodeError:
  474. print("配置文件格式错误,请检查文件内容是否为有效的 JSON。")
  475. return None
  476. @socketio.on('begin_auto')
  477. def handle_auto(data):
  478. write_cfg(data)
  479. config = read_cfg()
  480. print("config", config)
  481. auto_task(config)
  482. def auto_task(data):
  483. global autoTask, g_cureNum,g_isRestart,g_switch
  484. if data == None:
  485. isMaxCollect = '4,3,2,1'
  486. isSimple = False
  487. isJina = 'jina'
  488. isAddStrengh = False
  489. activity = 'none'
  490. participateJijie = False
  491. auto_daily = False
  492. train_type = 'none'
  493. always = False
  494. cureNumber = 500
  495. lineCheck = False
  496. switch = False
  497. g_isRestart = True
  498. else:
  499. isMaxCollect = data['maxCollect']
  500. isSimple = data['simple']
  501. isJina = data['jina']
  502. isAddStrengh = data['add_strength']
  503. activity = data['activity']
  504. participateJijie = data['participate_jijie']
  505. auto_daily = data['auto_daily']
  506. train_type = data['train']
  507. always = data['always']
  508. cureNumber = data['cureNumber']
  509. lineCheck = data['lineCheck']
  510. switch = data['switch']
  511. g_isRestart = data['is_restart']
  512. g_cureNum = cureNumber
  513. g_switch = switch
  514. set_lineCheck(lineCheck)
  515. send_status(f'开始自动模式')
  516. executor.submit(add_auto_task, isMaxCollect, isJina, isSimple, isAddStrengh, activity, participateJijie, auto_daily, train_type, always)
  517. @socketio.on('begin_auto_participate')
  518. def handle_auto_participate():
  519. global autoTask
  520. send_status(f'开始自动集结模式')
  521. executor.submit(auto_participate)
  522. @socketio.on('begin_testNewFun')
  523. def handle_auto_testNewFun():
  524. global autoTask
  525. send_status(f'开始自动测试新功能')
  526. task_testFun().run()
  527. @socketio.on('auto_palace')
  528. def handle_auto_palace():
  529. global autoTask
  530. send_status(f'开始自动王城')
  531. executor.submit(auto_palace)
  532. def monitor_game_runtime():
  533. global g_times, last_change_time
  534. last_value = g_times
  535. while True:
  536. current_value = g_times
  537. if current_value != last_value:
  538. last_value = current_value
  539. last_change_time = time.time()
  540. print(f"g_times changed to {current_value}")
  541. # 检查是否超过60分钟没有变化
  542. if time.time() - last_change_time > 3600: # 3600秒=60分钟
  543. print("g_times hasn't changed for 60 minutes!")
  544. handle_restart_game()
  545. time.sleep(10)
  546. if __name__ == '__main__':
  547. init()
  548. if '--reset' in sys.argv:
  549. time.sleep(2)
  550. isReset = True
  551. print("需要重启游戏")
  552. runTask = threading.Thread(target=thread_runTask)#启动线程往里面添加任务
  553. runTask.daemon = True
  554. runTask.start()
  555. monitor_thread = threading.Thread(target=monitor_game_runtime, daemon=True)
  556. monitor_thread.start()
  557. socketio.run(app, host= '0.0.0.0', debug=True, use_reloader=False)#关闭自动重载