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


Python menu.menu函数代码示例

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


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


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