MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / open

Function open

tools/python-3.11.9-amd64/Lib/webbrowser.py:72–89  ·  view source on GitHub ↗

Display url using the default browser. If possible, open url in a location determined by new. - 0: the same browser window (the default). - 1: a new browser window. - 2: a new browser page ("tab"). If possible, autoraise raises the window (the default) or not.

(url, new=0, autoraise=True)

Source from the content-addressed store, hash-verified

70# instead of "from webbrowser import *".
71
72def open(url, new=0, autoraise=True):
73 """Display url using the default browser.
74
75 If possible, open url in a location determined by new.
76 - 0: the same browser window (the default).
77 - 1: a new browser window.
78 - 2: a new browser page ("tab").
79 If possible, autoraise raises the window (the default) or not.
80 """
81 if _tryorder is None:
82 with _lock:
83 if _tryorder is None:
84 register_standard_browsers()
85 for name in _tryorder:
86 browser = get(name)
87 if browser.open(url, new, autoraise):
88 return True
89 return False
90
91def open_new(url):
92 """Open url in a new window of the default browser.

Callers 3

open_newFunction · 0.70
open_new_tabFunction · 0.70
mainFunction · 0.70

Calls 3

getFunction · 0.70
openMethod · 0.45

Tested by

no test coverage detected