Skip to content

Commit 08b5bf2

Browse files
committed
start browser automatically
1 parent fb109cb commit 08b5bf2

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/mnt/designer/app.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import uuid
44
from contextlib import redirect_stdout
55
import logging
6+
import webbrowser
67

78
from flask import Flask, jsonify, render_template, request, send_file, session, cli
89

@@ -1832,6 +1833,9 @@ def start_server():
18321833
"To stop it, interrupt the process (e.g., via CTRL+C). \n",
18331834
)
18341835
cli.show_server_banner = lambda *_args: None
1836+
# Automatically open the default browser
1837+
url = "http://127.0.0.1:5001"
1838+
webbrowser.open(url)
18351839
app.run(debug=False, port=5001)
18361840

18371841

0 commit comments

Comments
 (0)