fix: 用os.startfile替代webbrowser打开浏览器

This commit is contained in:
2026-05-08 15:42:36 +08:00
parent d180ec5e56
commit 8657937214
+5 -2
View File
@@ -5,7 +5,7 @@ cDNA微阵列图像处理 - Web UI (Flask)
打开:http://localhost:5000 打开:http://localhost:5000
""" """
import os, sys, io, base64, webbrowser import os, sys, io, base64
from flask import Flask, render_template, request, jsonify from flask import Flask, render_template, request, jsonify
import matplotlib import matplotlib
matplotlib.use('Agg') matplotlib.use('Agg')
@@ -215,5 +215,8 @@ def process():
if __name__ == '__main__': 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) app.run(debug=True, port=5000)