from gi.repository import Gtk, WebKit

window = Gtk.Window()
window.connect("destroy", Gtk.main_quit)
window.show()

def on_error(webview, frame, uri, error):
    print "Error:", webview, frame, uri, error

webview = WebKit.WebView()
webview.connect('load-error', on_error)
webview.load_uri("http://localhost:8000/")
window.add(webview)
webview.show()

Gtk.main()
