# open page in default browser
>>> import webbrowser
>>> webbrowser.open('http://www.python.org')
True
# open page in firefox
>>> c = webbrowser.get('firefox')
>>> c.open('http://www.python.org')
True
# open page in chrome
>>> c = webbrowser.get('google-chrome')
>>> c.open('http://www.python.org')
True
# open in a new browser tab
>>> c.open_new_tab('http://www.python.org')
True
# open in a new browser window
>>> c.open_new('http://www.python.org')
True
>>> import webbrowser
>>> webbrowser.open('http://www.python.org')
True
# open page in firefox
>>> c = webbrowser.get('firefox')
>>> c.open('http://www.python.org')
True
# open page in chrome
>>> c = webbrowser.get('google-chrome')
>>> c.open('http://www.python.org')
True
# open in a new browser tab
>>> c.open_new_tab('http://www.python.org')
True
# open in a new browser window
>>> c.open_new('http://www.python.org')
True
Comments
Post a Comment
https://gengwg.blogspot.com/