Created
March 13, 2010 13:34
-
-
Save lxneng/331323 to your computer and use it in GitHub Desktop.
Opens a url in the desktop's default browser
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def open_url_in_browser(url): | |
""" | |
Opens a url in the desktop's default browser | |
""" | |
import threading | |
import webbrowser | |
class BrowserThread(threading.Thread): | |
def __init__(self, url): | |
threading.Thread.__init__(self) | |
self.url = url | |
def run(self): | |
webbrowser.open(self.url) | |
BrowserThread(url).start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment