def main(): rel_path = "data/teams.json" args = init_argparse() data = read_file(rel_path) for team, stats in data.items(): stats['wins'] = 0 stats['losses'] = 0 stats['ties'] = 0 write_file(rel_path, data)
def main(): rel_path = "data/teams.json" args = init_argparse() data = read_file(rel_path) data[args.city] = { 'city': args.city, 'mascot': args.mascot, 'wins': args.wins, 'losses': args.losses, 'ties': args.ties } write_file(rel_path, data)
def main(): rel_path = "data/schedule.json" args = init_argparse() data = read_file(rel_path) from pprint import pprint pprint(data) key = args.away + " at " + args.home if not data[args.week]: data[args.week] = {} print(data) data[args.week][key] = { 'away team': args.away, 'home team': args.home, 'away score': args.away_score, 'home score': args.home_score } print("asdfasdfasdf") pprint(data) write_file(rel_path, data)
def get_schedules(): schedules = read_file("data/schedule.json") return schedules
def get_teams(): teams = read_file("data/teams.json") return teams