Hello, I am attempting to make a simple animation of a vibrating string using
Tkinter canvas.
I haven't been able to find much information on how to do it.
I have my data of position x on the string at time t. I can plot it with
Tkinter showing the string for all times at once:
width=1500
height=300
root = Tk()
root.title("SinWave")
canvas = Canvas(width=width,height=height,bg='white')
linecoords=[]
for i in range(mi):
for j in range(ni):
linecoords.append(width*x[j])
linecoords.append(height*(1/2+U[i,j]))
canvas.create_line(linecoords,fill='black')
root.update()
canvas.pack()
mainloop()
Now I know that to get animation involves a root.update() and a
root.update_idletasks() somewhere but I can't figure out how to use these!
Thank you for your help.
-Gerard.
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor