예제 #1
0
def run():
    athlete_data = read_data("athlete_events.csv")
    # keeps repeating unless break
    while True:
        selection = tui.menu()
        if selection == "years":
            process.list_years(athlete_data)
        elif selection == "tally":
            process.tally_medals(athlete_data)
        elif selection == "team":
            process.tally_team_medals(athlete_data)
        elif selection == "exit":
            break
        else:
            tui.error("Invalid Selection!")
예제 #2
0
def run():
    data = read_data("athlete_events.csv")          # Data variable is the result of the call to function 'read_data'

    while True:                                     # Menu selection
        selection = tui.menu()
        if selection == "years":
            process.list_years(data)
        elif selection == "tally":
            process.tally_medals(data)
        elif selection == "ctally":
            process.tally_team_medals(data)
        elif selection == "exit":
            break                                   # Exits (or breaks) the run of the program
        else:
            tui.error("Invalid Selection!")
예제 #3
0
파일: process.py 프로젝트: beniewaku/com728
def run():
    athlete_data = read_data("athlete_events.csv")
    # The run function also contains the keywords pass.
    # These should be replaced with appropriate calls to the functions in the module process once this has been implemented

    while True:
        selection = tui.menu()
        if selection == "years":
            process.list_years(athlete_data)
        elif selection == "tally":
            process.tally_medals(athlete_data)
        elif selection == "team":
            process.tally_team_medals(athlete_data)
        elif selection == "exit":
            break
        else:
            tui.error("Invalid Selection!")