kaka_zheng 2021-09-25 20:41 采纳率: 20%
浏览 84

python的turtle导入图片报错,帮帮忙呗

python的turtle导入图片报错

img

img

##1##
##11
##2##
import turtle as c
import random as r
c.setup(600,600)
c.register_shape('house.gif')
h=c.Turtle()
h.shape('house.gif')
# c.register_shape('无标题.png')
d=c.Turtle()
# c.shape('无标题.png')
x1=r.randint(-300,300)
x2=r.randint(-300,300)
y1=r.randint(-300,300)
y2=r.randint(-300,300)
d.penup()
h.penup()
d.goto(x1,y1)
h.goto(x2,y2)
# 小海龟前进
def ahead():
    t.penup()
    t.forward(10)
    collect()

    
# 小海龟后退
def back():
    t.penup()
    t.backward(10)
    collect()

    
# 小海龟左转
def turnLeft():
    t.left(30)


# 小海龟右转
def turnRight():
    t.right(30)
c.done()

img

  • 写回答

1条回答 默认 最新

  • Python-ZZY 2021-10-01 09:37
    关注

    名字输错了?函数用错了?文件不在同一路径?

    评论

报告相同问题?

问题事件

  • 创建了问题 9月25日

悬赏问题

  • ¥15 关于#.net#的问题:End Function
  • ¥50 用AT89C52单片机设计一个温度测量与控制电路
  • ¥15 无法import pycausal
  • ¥15 VS2022创建MVC framework提示:预安装的程序包具有对缺少的注册表值的引用
  • ¥15 weditor无法连接模拟器Local server not started, start with?
  • ¥20 6-3 String类定义
  • ¥15 嵌入式--定时器使用
  • ¥20 51单片机学习中的问题
  • ¥30 Windows Server 2016利用兩張網卡處理兩個不同網絡
  • ¥15 Python中knn问题