0

I have a working animation, but I'm wondering how to save the animation after it displays once.

gui = Tk()
canvas = Canvas(gui, width=800,height=600,bg='white')
(objects/shapes created here)
for i in range(num_frames):
     canvas.move(blah blah)
     gui.update()
     time.sleep(.01)

gui.mainloop()
Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • 1
    Save it for what purpose? Save it as an animated gif? A movie? A python script? – Bryan Oakley Feb 23 '21 at 20:55
  • 1
    You can create animated gif files using the [Pillow fork of the PIL](https://pypi.org/project/Pillow/). You will need to save the canvas multiple times to create a series of frames comprising the result. – martineau Feb 23 '21 at 21:45
  • Also see [How can I convert canvas content to an image?](https://stackoverflow.com/questions/9886274/how-can-i-convert-canvas-content-to-an-image) – martineau Feb 23 '21 at 21:51

0 Answers0