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

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

示例1: square

​点赞 6

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

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

def square(x, y, size, name):

"""Draw square at `(x, y)` with side length `size` and fill color `name`.

The square is oriented so the bottom left corner is at (x, y).

"""

import turtle

turtle.up()

turtle.goto(x, y)

turtle.down()

turtle.color(name)

turtle.begin_fill()

for count in range(4):

turtle.forward(size)

turtle.left(90)

turtle.end_fill()

开发者ID:PacktPublishing,项目名称:Learning-Python-by-building-games,代码行数:20,

示例2: draw_leaf

​点赞 5

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

# 或者: from turtle import end_fill [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,

示例3: run_instruction

​点赞 5

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

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

def run_instruction(t):

if t.data == 'change_color':

turtle.color(*t.children) # We just pass the color names as-is

elif t.data == 'movement':

name, number = t.children

{ 'f': turtle.fd,

'b': turtle.bk,

'l': turtle.lt,

'r': turtle.rt, }[name](int(number))

elif t.data == 'repeat':

count, block = t.children

for i in range(int(count)):

run_instruction(block)

elif t.data == 'fill':

turtle.begin_fill()

run_instruction(t.children[0])

turtle.end_fill()

elif t.data == 'code_block':

for cmd in t.children:

run_instruction(cmd)

else:

raise SyntaxError('Unknown instruction: %s' % t.data)

开发者ID:lark-parser,项目名称:lark,代码行数:28,

示例4: head

​点赞 5

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

# 或者: from turtle import end_fill [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,

示例5: ear

​点赞 5

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

# 或者: from turtle import end_fill [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,

示例6: blusher

​点赞 5

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

# 或者: from turtle import end_fill [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,

示例7: s

​点赞 5

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

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

def s(n, l):

if n == 0: # stop conditions

# draw filled rectangle

turtle.color('black')

turtle.begin_fill()

for _ in range (4):

turtle.forward(l)

turtle.left(90)

turtle.end_fill()

else: # recursion

# around center point create 8 smalles rectangles.

# create two rectangles on every side

# so you have to repeat it four times

for _ in range(4):

# first rectangle

s(n-1, l/3)

turtle.forward(l/3)

# second rectangle

s(n-1, l/3)

turtle.forward(l/3)

# go to next corner

turtle.forward(l/3)

turtle.left(90)

# update screen

turtle.update()

# --- main ---

# stop updating screen (to make it faster)

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

示例8: hexagone

​点赞 5

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

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

def hexagone(point, longueur,c):

l = longueur

x, y = point

turtle.up()

turtle.goto(point)

turtle.color(c[0]) #black

turtle.down()

turtle.begin_fill()

turtle.goto(l * cos(4 / 3 * pi )+x, l * sin(4 / 3 * pi)+y)

turtle.goto(l * cos(5 / 3 * pi)+x, l * sin(5 / 3 * pi)+y)

turtle.goto(l * cos(0)+x, l * sin(0)+y)

turtle.goto(point)

turtle.end_fill()

turtle.color(c[1]) #blue

turtle.begin_fill()

turtle.goto(l * cos(0)+x, l * sin(0)+y)

turtle.goto(l * cos(pi / 3)+x, l * sin(pi / 3)+y)

turtle.goto(l * cos(pi * 2 / 3)+x, l * sin(pi * 2 / 3)+y)

turtle.goto(point)

turtle.end_fill()

turtle.color(c[2]) #red

turtle.begin_fill()

turtle.goto(l * cos(pi * 2 / 3)+x, l * sin(pi * 2 / 3)+y)

turtle.goto(-l+x, 0+y)

turtle.goto(l * cos(4 / 3 * pi)+x, l * sin(4 / 3 * pi)+y)

turtle.goto(point)

turtle.end_fill()

turtle.up()

return True

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

示例9: norse

​点赞 4

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

# 或者: from turtle import end_fill [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,

示例10: eye

​点赞 4

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

# 或者: from turtle import end_fill [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.end_fill方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。

python end用法_Python turtle.end_fill方法代码示例相关推荐

  1. python color属性_Python turtle.color方法代码示例

    本文整理汇总了Python中turtle.color方法的典型用法代码示例.如果您正苦于以下问题:Python turtle.color方法的具体用法?Python turtle.color怎么用?P ...

  2. python geometry用法_Python geometry.MultiPolygon方法代码示例

    本文整理汇总了Python中shapely.geometry.MultiPolygon方法的典型用法代码示例.如果您正苦于以下问题:Python geometry.MultiPolygon方法的具体用 ...

  3. python中right是什么意思_Python turtle.right方法代码示例

    本文整理汇总了Python中turtle.right方法的典型用法代码示例.如果您正苦于以下问题:Python turtle.right方法的具体用法?Python turtle.right怎么用?P ...

  4. python中stringvar的用法_Python tkinter.StringVar方法代码示例

    本文整理汇总了Python中tkinter.StringVar方法的典型用法代码示例.如果您正苦于以下问题:Python tkinter.StringVar方法的具体用法?Python tkinter ...

  5. python中formatter的用法_Python pyplot.FuncFormatter方法代码示例

    本文整理汇总了Python中matplotlib.pyplot.FuncFormatter方法的典型用法代码示例.如果您正苦于以下问题:Python pyplot.FuncFormatter方法的具体 ...

  6. python中geometry用法_Python geometry.Point方法代码示例

    本文整理汇总了Python中shapely.geometry.Point方法的典型用法代码示例.如果您正苦于以下问题:Python geometry.Point方法的具体用法?Python geome ...

  7. python中bind的用法_Python socket.bind方法代码示例

    本文整理汇总了Python中socket.bind方法的典型用法代码示例.如果您正苦于以下问题:Python socket.bind方法的具体用法?Python socket.bind怎么用?Pyth ...

  8. python中font的用法_Python font.nametofont方法代码示例

    本文整理汇总了Python中tkinter.font.nametofont方法的典型用法代码示例.如果您正苦于以下问题:Python font.nametofont方法的具体用法?Python fon ...

  9. python中fact用法_Python covariance.EllipticEnvelope方法代码示例

    本文整理汇总了Python中sklearn.covariance.EllipticEnvelope方法的典型用法代码示例.如果您正苦于以下问题:Python covariance.EllipticEn ...

最新文章

  1. Kong APIGW — Plugins — Traffic Control
  2. “代理”那点事儿-使用代理和搭建简单代理服务
  3. 负载均衡在分布式架构中是怎么玩起来的?
  4. java文件读写 outputstream_java IO文件读写例子(OutputStream,InputStream,Writer,Reader)...
  5. HTTP状态代码及其定义
  6. 关于SRAM,DRAM,SDRAM,以及NORFLASH,NANDFLASH
  7. 2021年下半年软考数据库系统工程师真题答案解析
  8. 基于LabVIEW 2018开发的自动化测试系统源码,该系统模仿TestStand编写
  9. 信息学竞赛学不学计算机史,关于信息学奥赛不得不知道的事
  10. Java读取Excel表格公式对应的值
  11. OpenRASP Java应用自我保护使用
  12. gmm聚类python_GMM-实现聚类的代码示例
  13. 记一次SPA项目打包优化的过程
  14. ETIMEDOU 104.16.20.35:443(已解决)
  15. 视频剪辑工具,教你批量分割视频并提取原音频单独保存
  16. 吕梁市服务器维修,终端服务器 吕梁知名智能车检网络摄像机 电话交通技术监控机柜...
  17. 为什么戏说php,戏说PHP——1.1切的开始
  18. boat启动器 minecraft_我的世界boat启动器
  19. 使用Django创建bolg的后台页面 (精简版)NO.2
  20. 十四届大学生数学竞赛补赛试题

热门文章

  1. Assignment | 05-week3 -Part_1-Neural Machine Translation
  2. 使用短信登录和注册的流程
  3. 不用身份证刷手就能坐飞机,掌静脉还能被应用在哪里领域?
  4. revit 二次开发之创建图纸和放置视图
  5. Pictures of Ascii Art
  6. 新一配:一篇看懂加油站产业链解决方案
  7. PCB电路板如何设计散热
  8. springboot使用FileAlterationMonitor完成对指定文件夹下面指定文件的动态监控
  9. 动态监控网卡流量异常
  10. 什么时候使用Redis缓存