Skip to content

Commit 3f22360

Browse files
committed
Webbrowser open from python script
1 parent 1e7abb2 commit 3f22360

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

web/pgAdmin4.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"""This is the main application entry point for pgAdmin 4. If running on
1111
a webserver, this will provide the WSGI interface, otherwise, we're going
1212
to start a web server."""
13+
1314

1415
import sys
1516
if sys.version_info <= (3, 9):
@@ -21,6 +22,9 @@
2122
import builtins
2223
import os
2324

25+
##
26+
import webbrowser
27+
2428
# We need to include the root directory in sys.path to ensure that we can
2529
# find everything we need when running in the standalone runtime.
2630
if sys.path[0] != os.path.dirname(os.path.realpath(__file__)):
@@ -173,6 +177,7 @@ def main():
173177
config.EFFECTIVE_SERVER_PORT)
174178
)
175179
sys.stdout.flush()
180+
webbrowser.open(f"http://{config.DEFAULT_SERVER}:{config.EFFECTIVE_SERVER_PORT}")
176181
else:
177182
# For unknown reason the runtime does not pass the environment
178183
# variables (i.e. PYTHONHOME, and PYTHONPATH), to the Python

0 commit comments

Comments
 (0)