Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def check_kde():
- return os.environ.get("KDE_FULL_SESSION", None) != None
- def open_url(url):
- # We could use Python's webbrowser.open() here, but unfortunately,
- # it doesn't have the same semantics under UNIX as under other
- # OSes. Sometimes it blocks, sometimes it doesn't.
- if check_kde():
- os.spawnlp(os.P_NOWAIT, "kfmclient", "kfmclient", "exec", url)
- else:
- os.spawnlp(os.P_NOWAIT, "gnome-open", "gnome-open", url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement