【发布时间】:2015-03-30 15:34:42
【问题描述】:
我正在使用 IDLE 中的以下代码在 python 海龟图形中创建贺卡,但我想在不同位置插入几张图片。是否可以使用链接插入图像,例如在 HTML 中使用“...”链接“...”?我知道 .bgpic 功能,但这需要将图像下载到我的计算机,并且当我将代码发送给其他人时将无法使用。
wn = turtle.Screen()
wn.setworldcoordinates(-100,-100,100,100)
alex = turtle.Turtle()
alex.color("green")
alex.ht()
alex.speed(10)
alex.up()
alex.goto(-95,-95)
alex.down()
def drawPattern(t):
t.left(90)
for i in range(4):
for i in range(19):
t.stamp()
t.up()
t.forward(10)
t.right(90)
if pattern == "1":
alex.shape('turtle')
elif pattern == "2":
alex.shape('circle')
else:
alex.shape('arrow')
drawPattern(alex)
【问题讨论】:
标签: python image python-idle turtle-graphics