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

Python turtle.bye函数代码示例

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

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



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

示例1: main

def main():
    while True:
        side = input("Please enter the total length of the figure: ")
        try:
            side = int(side)
        except:
            print('Please enter a valid number.\n')
            continue
        break

    while True:
        id = input("Please enter MSU ID (including the starting letter): ")
        if len(id) == 9 and id[0].isalpha() and all(d.isdigit() for d in id[1:]):
            break
        else:
            print('Please enter a valid MSU ID.\n')
            continue

    turtle.colormode(1.0)
    turtle.speed(0)

    drawQ1(id, side/2)
    drawQ2(id, side/2)
    drawQ3(id, side/2)
    drawQ4(id, side/2)

    time.sleep(20)
    turtle.bye()
开发者ID:GriffinMartin,项目名称:CSE231,代码行数:28,代码来源:proj11.py


示例2: main

def main():
    size=100
    initializeSpace()
    drawV(size)
    giveSpace(size)
    drawI(size)
    giveSpace(size)
    drawS(size)
    giveSpace(size)
    drawH(size)
    giveSpace(size)
    drawA(size)
    giveSpace(size)
    moveUp(size)
    drawL(size)
    changeSpace(size)
    drawG(size)
    giveSpace(size)
    drawA(size)
    giveSpace(size)
    drawR(size)
    giveSpace(size)
    moveUp(size)
    drawG(size)
    t.hideturtle()
    input("Press ENTER/RETURN")
    turtle.bye()
    return
开发者ID:wish343,项目名称:Python,代码行数:28,代码来源:typography.py


示例3: main

def main():
    pen = turtle.Turtle()
    
    lines = [Line((0,0),(40,20)), Line((0,20), (40,0), "red")]
    print(lines)
    for line in lines:
        print (line, end=" ")
        line.draw(pen)
    print()

    p = Polygon([(100,0),(200,0),(200,50),(100,50)], fillcolor="blue")
    p.draw(pen)
    print (p)
    t = Triangle((10,20),(20,0),(0,0),'black','blue')
    t.draw(pen)
    print (t)
    r = Rectangle([(-50,0),(0,50)],fillcolor = 'red')
    r.draw(pen)
    print(r)
    c = Circle((-50,0),100,fillcolor = 'red', pencolor = 'blue')
    c.draw(pen)
    print(c)
    pen.hideturtle()
    time.sleep(5)
    turtle.bye()
开发者ID:mukasama,项目名称:portfolio,代码行数:25,代码来源:lab11+(2).py


示例4: main

def main():
  ap = ArgumentParser()
  ap.add_argument('--speed', type=int, default=10,
                  help='Number 1-10 for drawing speed, or 0 for no added delay')
  ap.add_argument('program')
  args = ap.parse_args()

  for kind, number, path in parse_images(args.program):
    title = '%s #%d, path length %d' % (kind, number, path.shape[0])
    print(title)
    if not path.size:
      continue
    pen_up = (path==0).all(axis=1)
    # convert from path (0 to 65536) to turtle coords (0 to 655.36)
    path = path / 100.
    turtle.title(title)
    turtle.speed(args.speed)
    turtle.setworldcoordinates(0, 655.36, 655.36, 0)
    turtle.pen(shown=False, pendown=False, pensize=10)
    for i,pos in enumerate(path):
      if pen_up[i]:
        turtle.penup()
      else:
        turtle.setpos(pos)
        turtle.pendown()
        turtle.dot(size=10)
    _input('Press enter to continue')
    turtle.clear()
  turtle.bye()
开发者ID:perimosocordiae,项目名称:pyhrm,代码行数:29,代码来源:extract_images.py


示例5: skapur

def skapur():						
	print("Voo! Þú fannst lykill og fékkst aðgang að þessu herbergi!")
	print("Þú labbar inn í herbergið og þú sérð skáp og rúm")
	svarsvar1= input("Hvort viltu opna skápinn með lyklinnum eða kíkja undir rúmið?(opna skáp/undir rúm)")
	if(svarsvar1=='opna skáp'):
		breki = turtle.Turtle()
		breki.speed(10)
		for i in range(10):
			breki.forward(100)
			breki.right(30)
			breki.forward(20)
			breki.left(60)
			breki.forward(50)
			breki.right(30)

			breki.penup()
			breki.setposition(0, 0)
			breki.pendown()
			
			breki.right(2)
		turtle.bye()
		turtle.bye()
		svarsvar1=input("Jey! þú fannst hlutinn! labba út eða kíkja undir rúmið?(labba út/kíkja undir rúm")
		if svarsvar1=="labba út":
			pass

	if(svarsvar1=='kíkja undir rúm'):
		print("Þú gramsar undir rúminnu og finnur hlutinn úr herbergi 34!")
开发者ID:Forritarar-FS,项目名称:Kastali,代码行数:28,代码来源:room31.py


示例6: main

def main():
    """
    The main function.
    :pre: pos (0,0), heading (east), up
    :post: pos (
    0,0), heading (east), up
    :return: None
    """
    init()
    drawY()
    drawSpace()
    drawA()
    drawSpace()
    drawS()
    drawSpace()
    drawH()
    drawSpace()

    drawSpace()
    drawJ()
    drawSpace()
    drawA()
    drawSpace()
    drawI()
    drawSpace()
    drawN()
    drawSpace()
    hideTurtle()
    input('Hit enter to close...')
    turtle.bye()
开发者ID:yj29,项目名称:PythonAssignments,代码行数:30,代码来源:typography.py


示例7: main

def main():
    #uses functions to graph the data

    t = turtle.Turtle()
    
    t.hideturtle()
    drawLine(t,0,0,300,0) #draw x axis
    t.hideturtle()
    drawLine(t,0,0,0,300) #draw y axis  
  
    #draws the dotted lines
    x1 = 0    
    for i in range(5):
        x1 += 50
        if (i+1) < len(male):
            dottedLine(t,x1,male[i]*5,x1+50,male[i+1]*5,colorP='red')

        if (i+1) < len(female):
            dottedLine(t,x1,female[i]*5,x1+50,female[i+1]*5,colorP='blue')
        
    
    tickMarks(t)
    labels(t)

    
    time.sleep(5)
    turtle.bye()
开发者ID:sarahbyrum4,项目名称:Python-Honors-Projects,代码行数:27,代码来源:proj22.py


示例8: demanderLongueur

def demanderLongueur():
    try:
        cote = int(turtle.textinput("Longeurs","Entrez une longueur en px qui constitura la taille de votre carré, tapez q pour quitter"))
        return cote
    except ValueError:
        print("Vous n'avez pas entré un nombre. Je quitte.")
        turtle.bye()
        sys.exit()
开发者ID:paris-ci,项目名称:defis_isn,代码行数:8,代码来源:defi_6_3_v2.py


示例9: pleindre

 def pleindre(self):
     """Appelé pour protester"""
     print('Vous pouvez protester')
     dire = input('Entrez votre message: ')
     try:
         self.protester(dire)
     except:
         print("Vous quitter la partie suite à votre protestation")
         turtle.bye()
开发者ID:etiennedub,项目名称:battleship,代码行数:9,代码来源:interface.py


示例10: main

def main():
    """
        The program creates draws a ring of hexagons and
        waits for the user to respond before terminating.
    """
    initialize()
    drawRing(100)
    input("Hit ENTER to finish the program.")
    turtle.bye()
开发者ID:ArthuruhtrA,项目名称:Fall-2014,代码行数:9,代码来源:hexes-full.py


示例11: main

def main():
    """The program creates a picture canvas, draws a tiktaktoeboard with the Xs and Os, hides the turtle and
       waits for the user to respond before terminating.
    """
    initialize()
    drawFace()
    turtle.hideturtle()
    input( "Hit ENTER to finish the program." )
    turtle.bye()
开发者ID:dxa4481,项目名称:RITprojects,代码行数:9,代码来源:tic_tac_toe.py


示例12: main

def main():
    """The program creates a picture canvas, draws a homework thingy, hides the turtle and
       waits for the user to respond before terminating.
    """
    initialize()
    drawFace()
    turtle.hideturtle()
    input( "Hit ENTER to finish the program." )
    turtle.bye()
开发者ID:dxa4481,项目名称:RITprojects,代码行数:9,代码来源:homeworkone.py


示例13: testTurtle

def testTurtle(p,f):
    #installed Pillow for screen capture
    #https://pypi.python.org/pypi/Pillow/2.1.0#downloads

    try:
        myTurtle=imp.load_source('myMath',p+'/myTurtle.py')
    except Exception as e:
        print('\t\t',e, file=f)
        
    wn = turtle.Screen()
    t = turtle.Turtle()
    
    t.speed(0)
    try:
        myTurtle.draw_name( wn, t )
    except Exception as e:
        print('\t\t',e, file=f)
    
    t.speed(0)
    try:
        myTurtle.draw_axes( wn, t )
    except Exception as e:
        print('\t\t',e, file=f)
    
    t.speed(0)
    try:
        myTurtle.draw_line( wn, t, -3, 5 )
    except Exception as e:
        print('\t\t',e, file=f)
      
    my_goto( t,200, 200 )
    try:
        myTurtle.draw_triangle( wn, t, 50 )
    except Exception as e:
        print('\t\t',e, file=f)
        
    my_goto( t,200, -200 )
    try:
        myTurtle.draw_square( wn, t, 50 )
    except Exception as e:
        print('\t\t',e, file=f)
        
    my_goto( t,-200, 200 )
    try:
        myTurtle.draw_pent( wn, t, 50 )
    except Exception as e:
        print('\t\t',e, file=f)
        
    try:
        name=p.split('/')[-1]
        ImageGrab.grab().save(name+'.jpg', "JPEG")
    except Exception as e:
        print('\t\t',e, file=f)

    turtle.bye()
    print('\t\tmyTurtle finished.',file=f)
开发者ID:davidalanb,项目名称:PA_home,代码行数:56,代码来源:tests.py


示例14: main

def main():
    initBannerCanvas( 2, 2 )
    letter_library.drawLetter( "S" )
    letter_library.drawLetter( "s" )
    turtle.left( 180 )
    turtle.forward( 60 )
    turtle.left( 90 )
    turtle.forward( 30 )
    turtle.left( 90 )
    letter_library.drawLetter( "I" )
    letter_library.drawLetter( "i" )
    input( "Strike enter. " )
    turtle.bye()
开发者ID:jonobrien,项目名称:School_Backups,代码行数:13,代码来源:spell+out+original.py


示例15: main

def main():
    t = turtle.Turtle()
    outside(t)
    hair(t)

    eye_height = 100
    eye_offset = 60
    eye_radius = 25
    drawEye( t, eye_height, eye_offset, eye_radius )
    drawEye( t, eye_height, -eye_offset, eye_radius )

    input("Press enter to quit")
    turtle.bye()
开发者ID:yj29,项目名称:PythonAssignments,代码行数:13,代码来源:faces.py


示例16: main

def main():
    turtle.screensize(1000) 
        
    for i in range(1,5):
        turtle.speed = 2*i
        turtle.penup()
        turtle.goto(-340,-200)  #move to left hand side
        turtle.pendown()
        
        koch(i,i*250)           #draw a koch snowflake of ordwer i
        
        time.sleep(1)
        turtle.bye()            #close current window
开发者ID:NevilleVH,项目名称:koch,代码行数:13,代码来源:koch_snowflake.py


示例17: Main

def Main():
    pen = turtle.Turtle()
    sm = Snowman(position = (-100,-100), size = 75, fillcolor = "white", pencolor = "black", pensize = 1)
    print(sm)
    sm.draw(pen)
    
    sm = Snowwoman(position = (100,-100), size = 40, fillcolor = "white", pencolor = "black", pensize = 1)
    print(sm)
    sm.draw(pen)
    
    pen.hideturtle()
    time.sleep(15)
    turtle.bye()
开发者ID:junghoyo92,项目名称:SnowPeople,代码行数:13,代码来源:proj10.py


示例18: main

def main():
    """
    The main function.
    :pre: pos(0,0), heading (east), up
    :post: pos( (CHAR_WIDTH + CHAR_GAP) * No. of characters,0), heading (east), up
    :return:
    """
    init()
    h = math.sqrt(math.pow(CHAR_HYPOT,2) - math.pow(CHAR_HEIGHT/2,2))
    print(h)
    renderName()

    input('Hit enter to close...')
    turtle.bye()
开发者ID:AnushaBalusu,项目名称:PythonCodes,代码行数:14,代码来源:typography.py


示例19: collision

def collision(cells):
	global playing
	for i in cells:
		for j in cells:
			distance=((i.xcor()-j.xcor())**2 + (i.ycor()-j.ycor())**2)**0.5
			if distance<=i.get_radius() + j.get_radius():
				if i.get_radius()>j.get_radius():
					i.set_radius(i.get_radius() + 2)
					x=meet.get_random_x()
					y=meet.get_random_y()
					j.goto(x,y)
				if i == user_cell1 and i.get_radius()<j.get_radius():
					turtle.write('Game Over',align='center',font=('ariel',50,'bold'))
					time.sleep(3)
					turtle.bye()
开发者ID:noga17-meet,项目名称:MEET-YL1,代码行数:15,代码来源:game.py


示例20: main

def main():
    n = int(input("enter number of times to spiral"))
    if n == 0: #a fibonacci spiral image using 0 terms should draw nothing.
        return
    #init(fib(n+3))
    turtle.goto(0,0)
    drawSquaresIter(n,depth=4)
    turtle.goto(0,0)
    drawSpiral(n)
    
    input("Hit Enter to Continue")
    turtle.reset()
    drawSquaresRec(n,depth=4)
    drawSpiral(n)
    input("Hit Enter to Quit")
    turtle.bye()
开发者ID:jonobrien,项目名称:School_Backups,代码行数:16,代码来源:spiral.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python turtle.circle函数代码示例发布时间:2022-05-27
下一篇:
Python turtle.bgcolor函数代码示例发布时间: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