Advertisement
here2share

# webbrowser_newtabs.py

Apr 18th, 2015
359
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. # webbrowser_newtabs.py
  2.  
  3. import webbrowser
  4. new = 2 # open in a new tab, if possible
  5.  
  6. # open a public URL, in this case, the webbrowser docs
  7. url = "http://docs.python.org/library/webbrowser.html"
  8. webbrowser.open(url,new=new)
  9.  
  10. # open an HTML file on my own (Windows) computer
  11.  
  12. url = "file://C:/Users/test/Sample_HTML.html" # Note: foward slashes
  13. webbrowser.open(url,new=new)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement