#!/usr/bin/python3 import sys from gi.repository import Gtk class PythonApp(Gtk.Application): def __init__(self): Gtk.Application.__init__( self, application_id="org.example.PythonGnome") self.connect("activate", self.on_activate) def on_activate(self, app): window = Gtk.ApplicationWindow(application=app) window.show_all() app = PythonApp() exit_status = app.run(None) sys.exit(exit_status)