我希望 GIF 在 turtle 屏幕中播放。但它只显示静态图像。请解决这个问题,任何帮助将不胜感激...
这是我的代码:
import turtle
import os
# resources :
bgpic = r"C:\Users\intel\Desktop\xBDT7.gif"
win = turtle.Screen()
win.addshape(bgpic)
sh = turtle.Turtle()
sh.shape(bgpic)
# Shuting the window down :
turtle.mainloop()
最佳答案
通过阅读turtle
文档,here ,我没有看到任何说动画 gif 可以在 turtle 中播放的内容。你可以自己阅读文档,但是看起来虽然要在turtle中使用图像作为形状或背景,但它需要是.gif
文件,你实际上无法在turtle中播放动画gif .
关于python - 如何在Python中使用turtle模块播放GIF?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59126255/