本文整理汇总了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)
示例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 )
示例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)
示例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: ')
示例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)
示例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()
示例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)
示例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()
示例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:]
示例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)
示例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)
示例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)
示例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)
示例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()
示例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)