📜  Python中的 turtle.begin_fill()函数

📅  最后修改于: 2022-05-13 01:55:15.464000             🧑  作者: Mango

Python中的 turtle.begin_fill()函数

turtle 模块以面向对象和面向过程的方式提供海龟图形原语。因为它使用 Tkinter 作为底层图形,所以它需要安装一个支持 Tk 的Python版本。

turtle.begin_fill()

此方法用于在绘制要填充的形状之前调用。它不需要任何争论。

句法 :

turtle.begin_fill()

下面是上述方法的一个例子的实现:

例子:

Python3
# importing package
import turtle
 
# set turtle position
# and color
turtle.up()
turtle.goto(0,-30)
turtle.down()
turtle.color("yellow")
 
# start fill block
turtle.begin_fill()
 
# all instruction within this
# block are filled with turtle
# color as set above
turtle.circle(60)
 
# end fill block
turtle.end_fill()
 
# hide the turtle
turtle.hideturtle()


输出 :