Python 2.7 time.sleep() with Canvas Tkinter (OS X)
<p>I am making program in Python 2.7 using Tkinter and I want to create 3 sec intro. The intro is just canvas image that should show for 3 seconds and then be deleted. The problem is that my program is launching 3 seconds and then the code is done, so there is no intro. I read that it is because of output buffering. I don't know how to disable it, because everyone is talking about time.sleep and print function. That's my code:</p>

<pre><code> root = Tk()
 root.resizable(0,0)
 root.geometry('800x600+200+200')

 #canvas UI
 w = Tkinter.Canvas(root, bd=0, height=600, width=800)

 def intro():
     w.pack()
     intro = Tkinter.PhotoImage(file=r'intro.ppm')
     root.intro = intro
     w.create_image((0,0), image=intro, anchor='nw', tags=("intro"))
     time.sleep(3)
     w.delete("intro")

 intro()

 w.pack()

 root.mainloop ()
</code></pre>