import Tkinter as tk import Image, time, datetime def splash_screen(): root = tk.Tk() root.overrideredirect(True) width = root.winfo_screenwidth() height = root.winfo_screenheight() root.geometry('%dx%d+%d+%d' % (width*0.8, height*0.8, width*0.1, height*0.1)) image_file = "NHK.gif" image = tk.PhotoImage(file=image_file) canvas = tk.Canvas(root, height=height*0.8, width=width*0.8, bg="black") canvas.create_image(width*0.8/2, height*0.8/2, image=image) canvas.pack() root.after(10000, root.destroy) root.mainloop() return splash_screen() my_menu()# is defined at beginning of program
When I call the definition the picture NHK.GIF shows on a black background then disappears after 10 seconds.
The problem starts here; the program just stalls and nothing happens. Control is not given back to the main program ie, my menu doesn't print. When I hit close I get the message " The program is still running kill it? "
Please help I am very frustrated. I know the only problem in my code is in the splash_screen() Definition. Everything else runs flawlessly. The main purpose of this program is to teach basic survival skills.
Edited 5 Years Ago by Python Joe: n/a