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

Python menu.menu函数代码示例

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

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



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

示例1: ysha512

def ysha512():

    print ("\n\t [>] 1: ASCII -> sha512")
    # print('\t [>] 2: sha512 -> ASCII')
    print ("\t [>] m: Menu principal")
    print ("\t [>] q: Quitter\n")

    choice_var = raw_input(" [>] Que souhaitez vous faire? (1/2/m/q): ")

    if choice_var == "1":
        __hashsha512__()

    # if(choice_var=='2'):
    # __cracksha512__()

    if choice_var == "m":
        menu.menu()

    if choice_var == "q":
        print ("\nMerci d'avoir utilise cet utilitaire.")
        quit()

    else:
        print "Votre souhait est invalide. \n"
        ysha512()
开发者ID:Maxou56800,项目名称:Python-AlgoToolKit,代码行数:25,代码来源:xsha512.py


示例2: mainmenu

def mainmenu(icon,level,path,isQuit):
  
    SCREEN.fill(BGCOLOR)
    drawGrid()
    pygame.display.update()
    pygame.display.set_caption('Menu')
    font = pygame.font.Font(None,80)
    text = font.render("Guitar Game", 20,(WHITE))
    SCREEN.blit(text,(10,10))
    SCREEN.blit(icon, (350,150))

    if level[0]!=None and path[0]!=None:
        option = menu.menu(SCREEN, 
                      ['Start','Level: %d' % level[0],'Load: %s' % path[0].split("/")[-1] ,'Exit'],
                      128,128,None,64,1.2,WHITE,RED)
    elif level[0]!=None:
        option = menu.menu(SCREEN, 
                      ['Start','Level: %d' % level[0],'Load','Exit'],
                      128,128,None,64,1.2,WHITE,RED)
    elif path[0]!=None:
        option = menu.menu(SCREEN, 
                      ['Start','Level: %d','Load: %s' % path[0].split("/")[-1],'Exit'],
                      128,128,None,64,1.2,WHITE,RED)
    else:
        option = menu.menu(SCREEN, 
                      ['Start','Level','Load' ,'Exit'],
                      128,128,None,64,1.2,WHITE,RED)

    if option == -1:
        terminate(isQuit)
    if option == 0:     
        if path[0]!=None and level[0]!=None:
            pygame.mixer.music.stop()
            option = 0
            print level[0]
            #################### startGame ####################
            main2(path[0],level[0],path[0].split("/")[-1])
            
            level[0]=None
            path[0]=None
            isQuit[0]=0
            
            #terminate(isQuit)
        else:
            print "Please choose level and load a music first"
            
    elif option == 1:
        levelload(level)
        option = 0
            
    elif option == 2:
        if level[0]!= None:
            load(path,level[0])
        else:
            level[0]=2
            load(path,level[0])
        option = 0
            
    elif option == 3:
        terminate(isQuit)
开发者ID:yangz3,项目名称:LaserGuitarGame,代码行数:60,代码来源:GameInterface.py


示例3: create_new_user

 def create_new_user(self,address,password,root):
     
     import menu as menu
     check=0
     match = re.match('^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$', address)
     
     if match == None:
         print("It's not an E-Mail address")
     elif password=="":
         print("Please Enter a valid password")
     else:
         connection = sqlite3.connect('listplayer.db')
         connection.execute("""CREATE TABLE IF NOT EXISTS players (Email TEXT,Password TEXT,Score INTEGER)""")
         cursor = connection.execute("SELECT Email, Password FROM players")
         for i in cursor:
             if i[0]==address:
                 print("This Email is already registered")
                 check=1
         if check==0:
             connection.execute('''INSERT INTO players (Email, Password, Score) VALUES ("'''+address+'''","'''+password+'''",'''+str(0)+''')''')
             connection.commit()
             connection.close()
             print("Account created")
             root.destroy()
             menu.menu(address)
开发者ID:Maxxidt,项目名称:projet_python,代码行数:25,代码来源:apifile.py


示例4: ybase2

def ybase2():

    print ("\n\t [>] 1: ASCII -> Base2")
    print ("\t [>] 2: Base2 -> ASCII")
    print ("\t [>] m: Menu principal")
    print ("\t [>] q: Quitter\n")

    choice_var = raw_input(" [>] Que souhaitez vous faire? (1/2/m/q): ")

    if choice_var == "1":
        __encodezb2__()

    if choice_var == "2":
        __decodezb2__()

    if choice_var == "m":
        menu.menu()

    if choice_var == "q":
        print ("\nMerci d'avoir utilise cet utilitaire.")
        quit()

    else:
        print "Votre souhait est invalide. \n"
        ybase2()
开发者ID:Maxou56800,项目名称:Python-AlgoToolKit,代码行数:25,代码来源:xbase2.py


示例5: ycrc32

def ycrc32():

  print('\n\t [>] 1: ASCII -> crc32')
  # print('\t [>] 2: crc32 -> ASCII')
  print('\t [>] m: Menu principal')
  print('\t [>] q: Quitter\n')

  choice_var=raw_input(' [>] Que souhaitez vous faire? (1/2/m/q): ')

  if(choice_var=='1'):
    __hashcrc32__()

  # if(choice_var=='2'):
    # __crackcrc32__()

  if(choice_var=='m'):
    menu.menu()

  if(choice_var=='q'):
    print('\nMerci d\'avoir utilise cet utilitaire.')
    quit()

  else:
    print "Votre souhait est invalide. \n"
    ycrc32()
开发者ID:Maxou56800,项目名称:Python-AlgoToolKit,代码行数:25,代码来源:xcrc32.py


示例6: ybase32

def ybase32():

  print('\n\t [>] 1: ASCII -> Base32')
  print('\t [>] 2: Base32 -> ASCII')
  print('\t [>] m: Menu principal')
  print('\t [>] q: Quitter\n')

  choice_var=raw_input(' [>] Que souhaitez vous faire? (1/2/m/q): ')

  if(choice_var=='1'):
    __encodezb32__()

  if(choice_var=='2'):
    __decodezb32__()

  if(choice_var=='m'):
    menu.menu()

  if(choice_var=='q'):
    print('\nMerci d\'avoir utilise cet utilitaire.')
    quit()

  else:
    print "Votre souhait est invalide. \n"
    ybase32()
开发者ID:Maxou56800,项目名称:Python-AlgoToolKit,代码行数:25,代码来源:xbase32.py


示例7: main

def main():
    pygame.init()

    if pygame.mixer and not pygame.mixer.get_init():
        print ('Warning, no sound')
        pygame.mixer = None

    pygame.mixer.music.load('data/tchtada.ogg')
    pygame.mixer.music.play(-1)

    joysticks = [pygame.joystick.Joystick(x) for x in range(pygame.joystick.get_count())]
    if joysticks:
        joystick=joysticks[0]
        joystick.init()


    const.font_init()
    # Set the display mode
    winstyle = 0  # |FULLSCREEN
    bestdepth = pygame.display.mode_ok(SCREENRECT.size, winstyle, 32)
    screen = pygame.display.set_mode(SCREENRECT.size, winstyle, bestdepth)

    todo = menu.menu(screen)
    while todo != 'quit':
        if todo == 'play':
            score = game(screen)
            highscore.call(screen,score)
        elif todo == 'score':
            highscore.call(screen,None)
        todo = menu.menu(screen)

    if pygame.mixer:
        pygame.mixer.music.fadeout(1000)
    pygame.quit()
开发者ID:vanicat,项目名称:pushme,代码行数:34,代码来源:main.py


示例8: username1

def username1(client) :
	temporary = getstatusoutput("dir /home/")
	names = temporary[1]			
	temp = send_recv("dialog --inputbox \" Enter User Name : \" 10 30")
	if names.rfind(temp) == -1 :
		send("recieve only")
		send("dialog --infobox \" No such Directory Exists...\n Sending to Main Menu...\" 7 35")
		sleep(2.5)
		import menu
		menu.menu(client)
	return temp
开发者ID:krishna1401,项目名称:Linux_Automation,代码行数:11,代码来源:file4.py


示例9: main

def main():
    environ["SDL_VIDEO_CENTERED"] = "1"
    pygame.init()
    if not pygame.font:
        print "Warning, fonts disabled, game not playable"
        pygame.time.delay(1500)
        sysexit()
    if not pygame.mixer:
        print "Warning, sound disabled"
    screen = pygame.display.set_mode((800, 800))
    pygame.display.set_caption("Hanjie")
    pygame.display.update()
    menu.menu(screen)
开发者ID:Morgus,项目名称:Hanjie,代码行数:13,代码来源:Hanjie.py


示例10: launch

def launch():

    pygame.init()
    clock = pygame.time.Clock()

    if conf.fullscreen:
        window = pygame.display.set_mode((800, 600), FULLSCREEN)
    else:
        window = pygame.display.set_mode((800, 600))

    # hide cursor
    pygame.mouse.set_visible(False)

    menu(window, clock)
开发者ID:rmonin,项目名称:dung-console,代码行数:14,代码来源:launcher.py


示例11: main

def main(): #主函数
    a=0#锁定判断标志位
    while True:
        if a == 3:#用户输入超过3次执行lock函数并退出循环
            lock_user(u_name)
            print("尝试3次登录失败,用户%s 锁定 程序退出"%(u_name))
            break
        else:
            u_name = input("Enter your username:")
            u_passwd = input("Enter you password:")
            if login(u_name,u_passwd)  == False:#如果login函数返回的结果为False则让a自加1
                a+=1
                continue
            else:
                menu.menu()
开发者ID:248808194,项目名称:python-study,代码行数:15,代码来源:login.py


示例12: main

def main():
    Liste = {}
    Liste['1'] = 'Text -> Morse'
    Liste['2'] = 'Morse -> Text'
    Liste['3'] = 'Beenden'
    setup()
    try:
        while 1:
            os.system("clear")
            off(green)
            off(red)
            off(yellow)
            choice = menu(Liste, "Modus Wählen")
            if choice == 1:
                message = input('Text: ').lower()
                toMorse(message)
            elif choice == 2:
                print('Nicht Implementiert')
                input('Press OK')
            elif choice == 3:
                off(green)
                off(red)
                off(yellow)
                break
        print("fertig")
        G.cleanup()
    except (KeyboardInterrupt, SystemExit):
        print("/n abgebrochen/n")
        G.cleanup()
开发者ID:hpcchkop,项目名称:schuhlager,代码行数:29,代码来源:morse.py


示例13: yhelp

def yhelp():

  print("\
  \tAIDE:\n\n\
  Dans le menu principal ci-contre, vous pouvez avoir acces a différentes\n\
  options en fonctions de ce que vous cherchez a faire. Apres avoir entré\n\
  le numero de l'option souhaitez vous aurez accès a différentes propositions\n\
  vous permettant de convertir votre \"String\" en ASCII.\n\n\
  \tINFO SUR LE PROGRAMME:\n\n\
  Cette utilitaire a été réalisé par Maxime Berthault (Maxou56800) sous license\n\
  GPL (GENERAL PUBLIC LICENCE) afin de permettre à d'autres personnes de le \n\
  modifier et l'amélioré a sa façon. Ce programme a pour but d'entreiner les \n\
  débutants à s'intéresser à toute la partie algorithmes de chiffrements en \n\
  informatique.")
  menu.menu()
#############################
开发者ID:Maxou56800,项目名称:Python-AlgoToolKit,代码行数:16,代码来源:help.py


示例14: check_level_up

def check_level_up():
    level_up_xp = settings.LEVEL_UP_BASE + settings.player.level * \
        settings.LEVEL_UP_FACTOR
    if settings.player.fighter.xp >= level_up_xp:
        settings.player.level += 1
        settings.player.fighter.xp -= level_up_xp
        message('Your battle skills grow stronger. You reached level ' +
                str(settings.player.level) + '.', color.yellow)

        choice = None
        while choice is None:
            choice = menu('Level up! Choose a stat to raise:\n',
                          ['Constitution (+20 HP, from ' +
                           str(settings.player.fighter.max_hp) + ')',
                           'Strength (+1 attack, from ' +
                           str(settings.player.fighter.power) + ')',
                           'Agility (+1 defense, from ' +
                           str(settings.player.fighter.defense) + ')'],
                          settings.LEVEL_SCREEN_WIDTH)

        if choice == 0:
            settings.player.fighter.max_hp += 20
            settings.player.fighter.hp += 20
        elif choice == 1:
            settings.player.fighter.power += 1
        elif choice == 2:
            settings.player.fighter.defense += 1
开发者ID:Akhier,项目名称:Py-TutMut,代码行数:27,代码来源:play_game.py


示例15: main

def main(client) :
	temporary = getstatusoutput("dir /home/")
	names = temporary[1]
	names = names + "root"	
	client.send("dialog --inputbox \" User Name : \" 9 30")
	user = client.recv(2048)
	client.send("dialog --insecure --passwordbox \" Password : \" 9 30")
	password = client.recv(2048)	
	if names.rfind(user) == -1 or password != "redhat" :
		client.send("recieve only")
		client.send("dialog --infobox \"Incorrect Password or User Name \n Terminating....\" 5 40")
		sleep(2)
		client.send("false")
	else :
		client.send("recieve only")
		client.send("dialog --infobox \"Authentified User \n Processing...\" 5 25")	
		sleep(2)
		import menu
		menu.menu(client)
开发者ID:krishna1401,项目名称:Linux_Automation,代码行数:19,代码来源:main.py


示例16: get_menu

def get_menu(file, title="Menu"):
    csvfile = open(file, "rU")
    dialect = csv.Sniffer().sniff(csvfile.read(1024))
    csvfile.seek(0)
    menuReader = csv.reader(csvfile, dialect)
    myMenu = menu.menu(title)
    for row in menuReader:
        myMenuItem = menuItem.MenuItem(row[0], float(row[1]), row[2])
        myMenu.items.append(myMenuItem)
    return myMenu
开发者ID:stephaniehatch,项目名称:msmba-workflow-winter2016-team8,代码行数:10,代码来源:cerealterminator_api2.py


示例17: test_encodeMenu

    def test_encodeMenu(self):
        """
        Tests if encodeMenu correctly converts a menu to string form
        """
        testMenu = menu()
        item1 = menuItem(1, "Veggie", 12.95)
        item2 = menuItem(2, "Meat", 11.95)
        testMenu.add(item1)
        testMenu.add(item2)

        correctString = "1 Veggie $12.95\n  2 Meat $11.95"
        self.assertEquals(testMenu.encodeMenu(), correctString)
开发者ID:Vabster,项目名称:Python-Pizza-Protocol,代码行数:12,代码来源:menuTest.py


示例18: main_menu

def main_menu(domain):
    options = {'1': 'Linode API', '2': 'System', 
               '3': 'Cherokee', 'q': 'Quit'}
    choice = menu('Main Menu:', domain, options)
    if choice == '1':
        linode.linode_menu(domain)
    elif choice == '2':
        system.system_menu(domain)
    elif choice == '3':
        cherokee.cherokee_menu(domain)
    elif choice == 'q':
        sys.exit(0)
开发者ID:adamgreig,项目名称:manage.py,代码行数:12,代码来源:manage.py


示例19: __init__

 def __init__(self, screen, hud):
     self.battleField = pygame.Surface( (300,300) )
     self.battleField.fill( black )
     self.images = range(3)
     
     self.screen = screen
     
     self.myMenu = menu.menu()
     
     self.images[0], r = load_image('cursor.bmp')
     
     self.myHud = hud
开发者ID:dusty141,项目名称:ransack-python,代码行数:12,代码来源:battle.py


示例20: addMenu

    def addMenu(self):
        self.simplemenu = menu.menu(self.gv, 58, "left")
        self.simplemenu.addButton((50,50), (3, 3), self.nextPage, \
                                  "Next Page", \
                                  "images/menu/newpagenormal.png", \
                             "images/menu/newpagehover.png", \
                              "images/menu/newpagepressed.png")
        
        self.simplemenu.addButton((50,50), (3,57), self.newPage, \
                                  "New Page", \
                                  "images/menu/newpagenormal.png", \
                             "images/menu/newpagehover.png", \
                              "images/menu/newpagepressed.png")
        
        self.simplemenu.addButton((50,50), (3,111), self.previousPage, \
                                  "Previous Page", \
                                  "images/menu/newpagenormal.png", \
                             "images/menu/newpagehover.png", \
                              "images/menu/newpagepressed.png")
        
        self.simplemenu.addButton((50,50), (3,199), self.clearCurrentSurface, \
                                  "Delete Page", \
                                  "images/menu/newpagenormal.png", \
                             "images/menu/newpagehover.png", \
                              "images/menu/newpagepressed.png")

        #we'll hold on to this reference to update it later
        self.playButton = self.simplemenu.addButton((50,50), (3,277), \
                                                    self.doNothing, \
                                  "Play", \
                                  "images/menu/newpagenormal.png", \
                             "images/menu/newpagehover.png", \
                              "images/menu/newpagepressed.png")

        self.simplemenu.addButton((25,50), (3,385), self.doNothing, \
                                  "Slower", \
                                  "images/menu/newpagenormal.png", \
                             "images/menu/newpagehover.png", \
                              "images/menu/newpagepressed.png")

        self.simplemenu.addButton((25,50), (28,385), self.doNothing, \
                                  "Faster", \
                                  "images/menu/newpagenormal.png", \
                             "images/menu/newpagehover.png", \
                              "images/menu/newpagepressed.png")
        
        #..and we'll hold onto a reference to this for later updates.        
        self.statusText = self.simplemenu.addStatusText((62,4), "Page 1 of 1", \
                                                        (210,210,210))
        
        
        self.menuList.append(self.simplemenu)
开发者ID:zsouthboy,项目名称:Flippy-Pad,代码行数:52,代码来源:flippy_pad.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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