Skip to content

Instantly share code, notes, and snippets.

@AndreaPasqualini
Created February 5, 2020 15:24
Show Gist options
  • Save AndreaPasqualini/0850540799f5cce63df0f0cce915f98e to your computer and use it in GitHub Desktop.
Save AndreaPasqualini/0850540799f5cce63df0f0cce915f98e to your computer and use it in GitHub Desktop.
A simple WebKit wrapper opening a website in a GTK window, all written in Python. (tested on Ubuntu 19.10)
#!/usr/bin/env python
from gi.repository import Gtk
from gi.repository import GObject
from gi.repository import WebKit2
GObject.threads_init()
win = Gtk.Window()
bro = WebKit2.WebView()
bro.load_uri("https://www.google.com")
win.add(bro)
win.show_all()
Gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment