当前位置: 首页>>代码示例>>Python>>正文


Python turtle.seth函数代码示例

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


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


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