【发布时间】:2013-03-13 14:57:11
【问题描述】:
我有一个创建窗口的函数:
import turtle
t=turtle.Pen()
def drawindow(dis):
t.down()
t.seth(0)
drawshape(4, 15)
t.up()
t.fd(7.5)
t.seth(90)
t.down()
t.fd(15)
t.up()
t.seth(180)
t.fd(7.5)
t.seth(270)
t.fd(7.5)
t.seth(0)
t.down()
t.fd(15)
t.end_fill()
我希望笔的颜色为黑色,但填充为另一种颜色。我已经定义了一个函数drawhouse(),它包含了这个函数,在此之前,笔的颜色设置为黑色,然后开始填充。我尝试做t.begin_fill('blue'),但这不起作用。请帮忙。
drawshape(x, y) 绘制一个具有 x 边的多边形,每边 y 长。
【问题讨论】:
标签: python python-2.7 turtle-graphics