微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Python乌龟bgpic在python中瞬间消失

如何解决Python乌龟bgpic在python中瞬间消失

import turtle as t
t.bgpic(picname="image1.gif")

并且错误_tkinter.TclError: Couldn't open "image1.gif": no such file or directory

我不知道如何解决它。

解决方法

我是一个 12 岁的男孩,这是我的观点,我认为这是真的。)

嗨,你必须说

import turtle
wn=turtle.Screen()
wn.setup(width=700,height=400)
wn.title("image")

wn.addshape(currentDir+"")#where is you picture
#example wn.addshape(currentDir+"\\Resources\\image.gif")

image=turtle.Turtle()
image.speed(0)
image.shape(currentDir+"")# write where is your gif in ""
#so i am useing a mac so i say "downloads\\image.gif"
image.penup()

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。