小学生python circle教案_Python turtle.circle方法代码示例

本文整理汇总了Python中turtle.circle方法的典型用法代码示例。如果您正苦于以下问题:Python turtle.circle方法的具体用法?Python turtle.circle怎么用?Python turtle.circle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块turtle的用法示例。

在下文中一共展示了turtle.circle方法的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: body

​点赞 6

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def body():

'''

身体

'''

t.color("red", (255, 99, 71))

t.pu()

t.seth(90)

t.fd(-20)

t.seth(0)

t.fd(-78)

t.pd()

t.begin_fill()

t.seth(-130)

t.circle(100, 10)

t.circle(300, 30)

t.seth(0)

t.fd(230)

t.seth(90)

t.circle(300, 30)

t.circle(100, 3)

t.color((255, 155, 192), (255, 100, 100))

t.seth(-135)

t.circle(-80, 63)

t.circle(-150, 24)

t.end_fill()

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:27,

示例2: tail

​点赞 6

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def tail():

'''

尾巴

'''

t.pensize(4)

t.color((255, 155, 192))

t.pu()

t.seth(90)

t.fd(70)

t.seth(0)

t.fd(95)

t.pd()

t.seth(0)

t.circle(70, 20)

t.circle(10, 330)

t.circle(70, 30)

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:18,

示例3: draw_pattern_rectangle

​点赞 6

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def draw_pattern_rectangle(x, y, width, height, count, radius, color='red'):

rotation = 360 / count

turtle.goto(x, y)

for _ in range(count):

# move from center to circle

turtle.pu()

#turtle.color('black')

turtle.forward(radius)

turtle.right(90+rotation/2)

draw_rectangle(width, height, color)

# move from circle to center

turtle.pu()

#turtle.color('black')

turtle.left(90+rotation/2)

turtle.backward(radius)

# rotate in circle

turtle.right(rotation)

开发者ID:furas,项目名称:python-examples,代码行数:24,

示例4: draw_pattern_circle

​点赞 6

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def draw_pattern_circle(x, y, r, count, radius, color='red'):

rotation = 360 / count

turtle.goto(x, y)

for _ in range(count):

# move from center to circle

#turtle.pu()

turtle.color('black')

turtle.forward(radius)

turtle.right(90)

draw_circle(r, color)

# move from circle to center

#turtle.pu()

turtle.color('black')

turtle.left(90)

turtle.backward(radius)

# rotate in circle

turtle.right(rotation)

开发者ID:furas,项目名称:python-examples,代码行数:24,

示例5: draw_triangle

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def draw_triangle(turtle_name, radius):

turtle_name.circle(radius,360,3)

开发者ID:remon,项目名称:pythonCodes,代码行数:4,

示例6: draw_square

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def draw_square(turtle_name, radius):

turtle_name.circle(radius,360,4)

开发者ID:remon,项目名称:pythonCodes,代码行数:4,

示例7: draw_leaf

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def draw_leaf(turtle):

turtle.fillcolor("greenyellow")

turtle.begin_fill()

base = turtle.pos()

turtle.circle(100,75)

turtle.goto(base)

turtle.circle(-100,75)

turtle.goto(base)

turtle.end_fill()

开发者ID:remon,项目名称:pythonCodes,代码行数:12,

示例8: draw_circle

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def draw_circle(x, y, radius, red=50, green=255, blue=10, width=7):

""" Draw a circle at a specific x, y location.

Then draw four smaller circles recursively"""

colour = (red, green, blue)

# Recursively drawn smaller circles

if radius > 50:

# Calculate colours and line width for smaller circles

if red < 216:

red = red + 33

green = green - 42

blue = blue + 10

width -= 1

else:

red = 0

green = 255

# Calculate the radius for the smaller circles

new_radius = int(radius / 1.3)

# Drawn four circles

draw_circle(int(x + new_radius), y, new_radius, red, green, blue, width)

draw_circle(x - new_radius, y, new_radius, red, green, blue, width)

draw_circle(x, int(y + new_radius), new_radius, red, green, blue, width)

draw_circle(x, int(y - new_radius), new_radius, red, green, blue, width)

# Draw the original circle

turtle.goto(x, y)

turtle.color(colour)

turtle.width(width)

turtle.pendown()

turtle.circle(radius)

turtle.penup()

# Run the program

开发者ID:johnehunt,项目名称:advancedpython3,代码行数:36,

示例9: head

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def head():

'''

'''

t.color((255, 155, 192), "pink")

t.pu()

t.seth(90)

t.fd(41)

t.seth(0)

t.fd(0)

t.pd()

t.begin_fill()

t.seth(180)

t.circle(300, -30) # 顺时针画一个半径为300,圆心角为30°的园

t.circle(100, -60)

t.circle(80, -100)

t.circle(150, -20)

t.circle(60, -95)

t.seth(161)

t.circle(-300, 15)

t.pu()

t.goto(-100, 100)

t.pd()

t.seth(-30)

a = 0.4

for i in range(60):

if 0 <= i < 30 or 60 <= i < 90:

a = a + 0.08

t.lt(3) # 向左转3度

t.fd(a) # 向前走a的步长

else:

a = a - 0.08

t.lt(3)

t.fd(a)

t.end_fill()

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:37,

示例10: ear

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def ear():

'''

耳朵

'''

t.color((255, 155, 192), "pink")

t.pu()

t.seth(90)

t.fd(-7)

t.seth(0)

t.fd(70)

t.pd()

t.begin_fill()

t.seth(100)

t.circle(-50, 50)

t.circle(-10, 120)

t.circle(-50, 54)

t.end_fill()

t.pu()

t.seth(90)

t.fd(-12)

t.seth(0)

t.fd(30)

t.pd()

t.begin_fill()

t.seth(100)

t.circle(-50, 50)

t.circle(-10, 120)

t.circle(-50, 56)

t.end_fill()

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:31,

示例11: blusher

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def blusher():

'''

'''

t.color((255, 155, 192))

t.pu()

t.seth(90)

t.fd(-95)

t.seth(0)

t.fd(65)

t.pd()

t.begin_fill()

t.circle(30)

t.end_fill()

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:16,

示例12: hand

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def hand():

'''

'''

t.color((255, 155, 192))

t.pu()

t.seth(90)

t.fd(-40)

t.seth(0)

t.fd(-27)

t.pd()

t.seth(-160)

t.circle(300, 15)

t.pu()

t.seth(90)

t.fd(15)

t.seth(0)

t.fd(0)

t.pd()

t.seth(-10)

t.circle(-20, 90)

t.pu()

t.seth(90)

t.fd(30)

t.seth(0)

t.fd(237)

t.pd()

t.seth(-20)

t.circle(-300, 15)

t.pu()

t.seth(90)

t.fd(20)

t.seth(0)

t.fd(0)

t.pd()

t.seth(-170)

t.circle(20, 90)

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:39,

示例13: arc

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def arc(sa, ea, x, y, r): # start angle,end angle,circle center,radius

turtle.penup()

turtle.goto(x, y)

turtle.setheading(0)

turtle.left(sa)

turtle.fd(r)

turtle.pendown()

turtle.left(90)

turtle.circle(r, (ea - sa))

return turtle.position()

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:12,

示例14: draw_circle

​点赞 5

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def draw_circle(radius, color='red'):

turtle.pd()

turtle.color(color)

turtle.circle(radius)

开发者ID:furas,项目名称:python-examples,代码行数:6,

示例15: norse

​点赞 4

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def norse():

'''

鼻子

'''

t.pu() # 提笔

t.goto(-100, 100) # 画笔前往坐标(-100,100)

t.pd() # 下笔

t.seth(-30) # 笔的角度为-30°

t.begin_fill() # 外形填充的开始标志

a = 0.4

for i in range(120):

if 0 <= i < 30 or 60 <= i < 90:

a = a + 0.08

t.lt(3) # 向左转3度

t.fd(a) # 向前走a的步长

else:

a = a - 0.08

t.lt(3)

t.fd(a)

t.end_fill() # 依据轮廓填充

t.pu() # 提笔

t.seth(90) # 笔的角度为90度

t.fd(25) # 向前移动25

t.seth(0) # 转换画笔的角度为0

t.fd(10)

t.pd()

t.pencolor(255, 155, 192) # 设置画笔颜色

t.seth(10)

t.begin_fill()

t.circle(5) # 画一个半径为5的圆

t.color(160, 82, 45) # 设置画笔和填充颜色

t.end_fill()

t.pu()

t.seth(0)

t.fd(20)

t.pd()

t.pencolor(255, 155, 192)

t.seth(10)

t.begin_fill()

t.circle(5)

t.color(160, 82, 45)

t.end_fill()

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:44,

示例16: eye

​点赞 4

# 需要导入模块: import turtle [as 别名]

# 或者: from turtle import circle [as 别名]

def eye():

'''

眼睛

'''

t.color((255, 155, 192), "white")

t.pu()

t.seth(90)

t.fd(-20)

t.seth(0)

t.fd(-95)

t.pd()

t.begin_fill()

t.circle(15)

t.end_fill()

t.color("black")

t.pu()

t.seth(90)

t.fd(12)

t.seth(0)

t.fd(-3)

t.pd()

t.begin_fill()

t.circle(3)

t.end_fill()

t.color((255, 155, 192), "white")

t.pu()

t.seth(90)

t.fd(-25)

t.seth(0)

t.fd(40)

t.pd()

t.begin_fill()

t.circle(15)

t.end_fill()

t.color("black")

t.pu()

t.seth(90)

t.fd(12)

t.seth(0)

t.fd(-3)

t.pd()

t.begin_fill()

t.circle(3)

t.end_fill()

开发者ID:MiracleYoung,项目名称:You-are-Pythonista,代码行数:46,

注:本文中的turtle.circle方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值