From 8657937214355bca489a5257d15e5ded99747bfe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E8=88=AA=E5=AE=87?= <3364451258@qq.com> Date: Fri, 8 May 2026 15:42:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=94=A8os.startfile=E6=9B=BF=E4=BB=A3w?= =?UTF-8?q?ebbrowser=E6=89=93=E5=BC=80=E6=B5=8F=E8=A7=88=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/app.py b/web/app.py index d3f9efc..d6c14fc 100644 --- a/web/app.py +++ b/web/app.py @@ -5,7 +5,7 @@ cDNA微阵列图像处理 - Web UI (Flask) 打开:http://localhost:5000 """ -import os, sys, io, base64, webbrowser +import os, sys, io, base64 from flask import Flask, render_template, request, jsonify import matplotlib matplotlib.use('Agg') @@ -215,5 +215,8 @@ def process(): if __name__ == '__main__': - webbrowser.get('microsoft-edge').open('http://localhost:5000') + import threading + def open_browser(): + os.startfile('http://localhost:5000') + threading.Timer(1.5, open_browser).start() app.run(debug=True, port=5000)