Last active
August 29, 2015 14:11
-
-
Save ncornette/3f2af51ce787fdcd0590 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python | |
import sys | |
import gtk | |
from gtk import gdk | |
import webkit | |
import gobject | |
page_url = len(sys.argv)>1 and sys.argv[1] or 'http://www.google.com' | |
gobject.threads_init() | |
win = gtk.Window() | |
web_view = webkit.WebView() | |
web_view.open(page_url) | |
win.connect('destroy', lambda w: gtk.main_quit()) | |
web_view.connect("key-release-event",lambda w,ev: gdk.keyval_name(ev.keyval) == 'Escape' and gtk.main_quit() or None) | |
win.add(web_view) | |
win.show_all() | |
gtk.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment