You want to see the open window and simultaniously execute commands behind >>>
.
Two solutions I see:
remove
xxx.mainloop()
when you execute it with the Python Shell. I did it like this conditionally.import sys if 'idlelib' not in sys.modules: xxx.mainloop()
start the mainloop in another thread. You should not do this in production code because Tkinter is not threadsafe.
import threading t = threading.Thread(target = xxx.mainloop) t.start()
These are two solution I could think of because 1.
may not always work.