Skip to content

Instantly share code, notes, and snippets.

@yipyip
Created August 6, 2013 09:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yipyip/6163205 to your computer and use it in GitHub Desktop.
Save yipyip/6163205 to your computer and use it in GitHub Desktop.
nicht root menu, sondern nur submenu aendern.
def rename_team(team_number):
"""rename teamnames in the teamnamces dict and in the menu dict"""
# hier kommt nicht der neue name
new_name = input("please enter new name for team number {}: ".format(
team_number))
if new_name == "":
print("nothing renamed")
return
team_names[team_number] = new_name
# outcommented code does not works, renames root entry :-(
# access the value of key "root" , entry [team_number], first entry
#menu["root"][team_number][0] = "Manage team {}".format(new_name)
# submenus
# hier wird das submenu geaendert
key = "team{0}".format(team_number)
menu[key][0][0] = "show info of team {}".format(new_name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment