MCPcopy Index your code
hub / github.com/python/cpython / open

Function open

Lib/webbrowser.py:75–95  ·  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. If opening th

(url, new=0, autoraise=True)

Source from the content-addressed store, hash-verified

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

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…