• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python turtle.seth函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中turtle.seth函数的典型用法代码示例。如果您正苦于以下问题:Python seth函数的具体用法?Python seth怎么用?Python seth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: main

def main():
    turtle.setup(1300, 800, 0, 0)   # 启动图形窗口
    pythonsize = 10
    turtle.pensize(pythonsize)
    turtle.pencolor("blue")
    turtle.seth(-40)        # 启动时运动的方向(角度)
    drawSnake(40, 80, 5, pythonsize/2)
开发者ID:xzlxiao,项目名称:Test,代码行数:7,代码来源:蟒蛇绘制.py


示例2: main

def main():
	turtle.setup(1300, 800, 0, 0)
	pythonsize = 30
	turtle.pensize(pythonsize)
	turtle.pencolor('blue')
	turtle.seth(-40)
	drawSnake(rad = 40, angle = 80, len = 5, neckrad = pythonsize/2 )
开发者ID:Andor-Z,项目名称:My-Learning-Note,代码行数:7,代码来源:week2.py


示例3: main

def main():
    turtle.setup(1300, 800, 0, 0)
    pythonsize = 30
    turtle.pensize(pythonsize)
    turtle.pencolor("blue")
    turtle.seth(-40)
    drawSnake(40, 80, 5, pythonsize / 2)
开发者ID:16348104,项目名称:Python,代码行数:7,代码来源:python.py


示例4: main

def main():
    file_name = "go"
    
    file_name = raw_input( 'Enter a file name or exit to quit program: ')
    while (file_name != "exit" and file_name != "Exit" and file_name != "quit" and file_name != "Quit"):

        f = open( file_name, 'r' )
    
        first_line = f.readline()
        first_line = first_line.split()
    
        distance = float( first_line[0] )
        angle = float( first_line[1] )
    
        stack = []

        wn = tur.Screen()

        for line in f:
            wn.clear()
            tur.penup()
            tur.seth(90)
            tur.setx(0)
            tur.sety(-200)
            tur.pendown()
            interprit_line(tur, line, angle, distance, stack)
        ts = tur.getscreen()
        ts.getcanvas().postscript(file=file_name +".eps")
        wn.exitonclick()

        file_name = raw_input( 'Enter a file name or exit to quit program: ')
开发者ID:CsmithSD,项目名称:SimulationHW,代码行数:31,代码来源:turtle_ol.py


示例5: circle

def circle(r, n, angle):
	turtle.seth(angle)
	a = 2*r*sin(pi/n)
	phi = 180*(1-2/n)
	for i in range(int(n/2)+1):
		turtle.forward(a)
		turtle.right(180-phi)
开发者ID:gunther-on-fire,项目名称:boris-the-parselmouth,代码行数:7,代码来源:spring.py


示例6: pop_right

def pop_right():
	x,y,h = pos_stack.pop()
	turtle.up()
	turtle.setpos(x,y)
	turtle.seth(h)
	turtle.right(45)
	turtle.down()
开发者ID:TravisWhitaker,项目名称:lsystems,代码行数:7,代码来源:stupid_tree.py


示例7: main

def main():  
    turtle.setup(1300,800,0,0)  
    pythonsize=1  
    turtle.pensize(pythonsize)  
    turtle.pencolor("black")  
    turtle.seth(-40)  
    drawSnack(40,80,5,pythonsize/2)  
开发者ID:lovexleif,项目名称:python,代码行数:7,代码来源:snake.py


示例8: main

def main():
    turtle.setup(1300, 800, 10, 10)
    pensize = 30
    turtle.pensize(pensize)
    turtle.pencolor('blue')
    turtle.seth(-40)
    draw_snake(40, 80, 5, pensize / 2)
    turtle.done()
开发者ID:ilikesongdandan,项目名称:python-data,代码行数:8,代码来源:python.py


示例9: pop

def pop(dummy):
    global stack
    turtle.up()
    turtle.goto(stack[-1][0])
    turtle.seth(stack[-1][1])
    stack = stack[:-1]
    turtle.down()
    return dummy[1:]
开发者ID:csoeder,项目名称:Lindenmeyer-system,代码行数:8,代码来源:phenotype.py


示例10: draw_background

def draw_background():
    t.setup(300, 500)
    t.title('Hangman')
    t.pu()
    t.setpos(-100, -200)
    t.seth(0)
    t.pd()
    t.fd(200)
开发者ID:dcbriccetti,项目名称:python-lessons,代码行数:8,代码来源:hangman.py


示例11: draw_wall

def draw_wall(x, y):
    goto(x, y)
    turtle.color("red")
    if y % 2 == 0:
        turtle.seth(0)
    else:
        turtle.seth(90)
    turtle.forward(5)
    turtle.back(10)
开发者ID:siddhi,项目名称:playful_python,代码行数:9,代码来源:util.py


示例12: main

def main():
#初始化窗口(宽度,高度,距屏幕左边距离,距屏幕顶边距离)
    turtle.setup(1300,700,0,20)
    pythonsize=30
    turtle.pensize(pythonsize)
    turtle.pencolor("blue")
    #定义初始爬行方向
    turtle.seth(-40)
    drawSnake(40,80,5,pythonsize/2)
开发者ID:guanmfei,项目名称:learngit,代码行数:9,代码来源:snake.py


示例13: dibujar_cuadrado

def dibujar_cuadrado(x, y, a):
    up()
    goto(x + 0.5 * a,
         y - 0.5 * a)
    seth(90)
    down()
    for i in range(4):
        forward(a)
        left(90)
开发者ID:OscarGonzalez14,项目名称:progra-utfsm,代码行数:9,代码来源:figuras.py


示例14: draw

	def draw(self):
		'''
		Draws the object at its current (x, y) coordinates.
		'''
		turtle.goto(self.x, self.y)
		turtle.seth(self.heading())
		turtle.shape(self.shape)
		turtle.color(self.color)
		return turtle.stamp()
开发者ID:sbihel,项目名称:retrogames,代码行数:9,代码来源:engine.py


示例15: drawSnake

def drawSnake(radius,angle,length):
    turtle.seth(-45)
    for i in range(length):
        turtle.circle(redius,angle)
        turtle.circle(-redius,angle)
    turtle.circle(redius,angle/2)
    turtle.fd(40)
    turtle.circle(16,180)
    turtle.fd(40*3/2)
开发者ID:BrandonSherlocking,项目名称:python_document,代码行数:9,代码来源:粗线条。(蟒蛇).py


示例16: main

def main():
	#width,height
	turtle.setup(1000,200,100,100)
	pythonsize = 50
	#trace width
	turtle.pensize(pythonsize)
	turtle.pencolor("red")
	#trace direction
	turtle.seth(-40)
	drawSnake(40,80,3,pythonsize/2)
开发者ID:pain400,项目名称:python_note,代码行数:10,代码来源:draw.py


示例17: owoc

def owoc():
    t.pu()
    t.lt(30)
    t.fd(B)
    t.lt(30)
    t.fd(B)
    t.seth(300)
    t.pd()


    for i in range(5):         #pierwsza warstwa
        wsk_romb("olive")
        t.rt(30)

    t.lt(30)                        #druga warstwa
    for i in range(4):
        t.fd(B)
        t.lt(30)
        szer_romb("green")
        t.rt(30)
        t.bk(B)
        t.lt(30)

    t.rt(120)                       # trzecia warstwa
    for i in range(3):
        for j in range(2):
            t.fd(B)
            t.lt(30)
        kwadrat("yellow")
        for j in range(2):
            t.rt(30)
            t.bk(B)
        t.lt(30)

    t.rt(30)                        #czwarta warstwa
    for i in range(2):
        for j in range(3):
            t.fd(B)
            t.rt(30)
        t.fd(B)
        t.lt(180)
        szer_romb("orange")
        t.rt(180)
        t.bk(B)
        for j in range(3):
            t.lt(30)
            t.bk(B)
            
        t.lt(30)

    for i in range(5):          #piąta warstwa
        t.fd(B)
        t.rt(30)

    wsk_romb("red")
开发者ID:chinski99,项目名称:minilogia,代码行数:55,代码来源:owoc.py


示例18: horizontal

	def horizontal(row):
		turtle.goto(xstart, ystart - length * (row + 1))
		turtle.seth(0)
		for x in range(0, maze.size):
			status = maze.cells[row * maze.size + x].edges[-1].walled
			if status:
				turtle.down()
			else:
				turtle.up()
			turtle.forward(length)
		turtle.up()
开发者ID:jeeves833,项目名称:Lost,代码行数:11,代码来源:Maze.py


示例19: heart

def heart(x,y,h=100):
    go(x,y)
    turtle.fillcolor("white")
    turtle.begin_fill()
    turtle.goto(x-h/2, y+0.75*h)
    turtle.seth(90)
    turtle.circle(-h/4, extent=180)
    turtle.seth(90)
    turtle.circle(-h/4, extent=180)
    turtle.goto(x,y)
    turtle.end_fill()
    go(x+h/2,y)
开发者ID:amin10,项目名称:meet-scripts,代码行数:12,代码来源:meet.py


示例20: main

def main():  
    turtle.setup(1300,800,0,0)  
    pythonsize=1  
    turtle.pensize(pythonsize)
    turtle.fd(100)  
    turtle.pencolor("black")  
    turtle.seth(120)
    turtle.fd(100)  
    turtle.pencolor("black")
    turtle.seth(240)
    turtle.fd(100)  
    turtle.pencolor("black")
开发者ID:lovexleif,项目名称:python,代码行数:12,代码来源:sjx.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python turtle.setheading函数代码示例发布时间:2022-05-27
下一篇:
Python turtle.rt函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap