You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Print out all the state names from the csv# Showing an "event-driven" stylefrom electiondata import ElectionResultsimport sysfilename = '2012_US_election_state.csv'results = ElectionResults(filename)while True: command = raw_input('Enter your input (1 to load, 2 to print, 3 to quit):') if command=="1": results.load(); print "Loaded ("+str(results.state_count())+" lines)" elif command=="2": state_names = results.states() for state in state_names: print " "+state elif command=="3": print "bye!" sys.exit() else: print "Uknown command :-("