fix: 用os.startfile替代webbrowser打开浏览器
This commit is contained in:
+5
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user