本文整理汇总了Python中menu.Menu.menu_input方法的典型用法代码示例。如果您正苦于以下问题:Python Menu.menu_input方法的具体用法?Python Menu.menu_input怎么用?Python Menu.menu_input使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类menu.Menu
的用法示例。
在下文中一共展示了Menu.menu_input方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: load_game
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import menu_input [as 别名]
def load_game():
os.system('clear')
print('\n')
i = 1
for files in list_json():
print(' '*5 + str(i) + ' - ' + files)
i += 1
load_game = Menu(list_json())
loaded = load_game.menu_input()
i = 1
for item in list_json():
if i == loaded:
filename = open(item, 'r')
loading = json.load(filename)
player1.name = loading['name']
player1.health = loading['health']
player1.max_health = loading['health']
player1.dexterity = loading['dexterity']
player1.luck = loading['luck']
player1.max_luck = loading['luck']
player1.inventory = loading['inventory']
filename.close()
i += 1
begin(player1)
示例2: potion
# 需要导入模块: from menu import Menu [as 别名]
# 或者: from menu.Menu import menu_input [as 别名]
def potion():
os.system('clear')
potion_submenu = Menu(menus.fifth_menu)
return_menu_name.get_name(menus.fifth_menu)
print('\n Choose one potion from below!')
potion_submenu.menu_print()
input_number = potion_submenu.menu_input()
potion_name = potion_submenu.get_item_name(input_number)
player1.add_inventory(potion_name)
potion_submenu.menu_selector(input_number)