import tkinter root = tkinter.Tk() root.withdraw() root.bind('', lambda x: print('testing')) root.event_generate('') root.update()