【发布时间】:2020-10-31 23:28:18
【问题描述】:
我尝试解决此代码的错误。我正在使用 mac 操作系统 文件在正确的目录中并使用 gif 文件。 但我不断收到错误。我该如何解决这个问题(请帮助我)
import turtle
import random
screen=turtle.Screen()
image1="/Users/jameslee/Downloads/front.gif"
image2="/Users/jameslee/Downloads/back.gif"
screen.addshape(image1)
screen.addshape(image2)
t1=turtle.Turtle()
coin=random.randint(0, 1)
if coin==0:
t1.shape(image1)
t1.stamp()
else :
t1.shape(image2)
t1.stamp()
【问题讨论】:
-
这与 C 或 C++ 没有任何关系。
标签: python python-3.x image turtle-graphics python-turtle