Advertisement
Guest User

Untitled

a guest
Feb 10th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. def check_kde():
  2. return os.environ.get("KDE_FULL_SESSION", None) != None
  3.  
  4. def open_url(url):
  5. # We could use Python's webbrowser.open() here, but unfortunately,
  6. # it doesn't have the same semantics under UNIX as under other
  7. # OSes. Sometimes it blocks, sometimes it doesn't.
  8. if check_kde():
  9. os.spawnlp(os.P_NOWAIT, "kfmclient", "kfmclient", "exec", url)
  10. else:
  11. os.spawnlp(os.P_NOWAIT, "gnome-open", "gnome-open", url)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement