Skip to content

Instantly share code, notes, and snippets.

@lxneng
Created March 13, 2010 13:34
Show Gist options
  • Save lxneng/331323 to your computer and use it in GitHub Desktop.
Save lxneng/331323 to your computer and use it in GitHub Desktop.
Opens a url in the desktop's default browser
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