It isn't Gtk.window
, but Gtk.Window
. Because each widgets is a class, usually it uses Capital Letter as the first letter.
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
win = Gtk.Window()
win.connect("destroy", Gtk.main_quit)
win.show_all()
Gtk.main()
My reference when building gui application: https://python-gtk-3-tutorial.readthedocs.io/en/latest/index.html
EDITED: Also my reference for library other than GTK (Gdk, Glib, Libpeas, etc): https://lazka.github.io/pgi-docs/