如何在 Python 中使用 turtle 模块播放 GIF?
How to play GIF's using turtle module in Python?
我想让GIF在龟屏中播放。但它只显示静止图像。请修复此问题,我们将不胜感激...
这是我的代码:
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。
我想让GIF在龟屏中播放。但它只显示静止图像。请修复此问题,我们将不胜感激...
这是我的代码:
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。