from gi.repository import Gtk

window = Gtk.Window()
spin = Gtk.SpinButton()
spin.set_range(0, 10)

def on_input(widget, value):
    pass

spin.connect('input', on_input)

window.add(spin)
window.show_all()

window.connect('delete-event', Gtk.main_quit)

Gtk.main()
