I am creating a game for a user to choose a characters color and proceed to lead them through a maze. Originally I had the user input the name of their character and the direction they wanted them to go, but changed the input to use the arrow keys with tkinter. Now I am running into a problem because the tkinter opens a new window for its input.
import view,datetime,Tkinter as tk
def main():
global root
if __name__ == "__main__":
view.root.update()
command = raw_input( "choose a player:" )
run1( command )
view.root.update()
while True:
root = tk.Tk()
print( "Press a key (Escape key to exit):" )
root.bind_all( '<Key>', key )
root.mainloop()
root.withdraw()
root.destroy()
view.root.destroy()
main()
This shows what I imported and my main function.
root.mainloop()blocks until the application is destroyed. Where is the code for your secondary window?