【发布时间】:2019-08-02 00:02:59
【问题描述】:
我正在尝试制作一个简单的程序,当您转到烧瓶中的特定 URL 时,它会打开 Web 浏览器。
我将 nginx 与 uwsgi 一起使用,与烧瓶一起工作,在 ubuntu 桌面 18.04 上运行。
from flask import Flask
import webbrowser
app = Flask(__name__)
@app.route("/test")
def test():
#this is where a new webbrowser should be opened:
webbrowser.open_new_tab("https://google.com")
return "test!"
if __name__ == "__main__":
app.run(host='0.0.0.0')
我希望在服务器机器上打开一个新的网络浏览器选项卡,但没有任何反应
【问题讨论】:
-
仍在寻求帮助