#include all nessecary lib import os import json #load file locations into ram root = os.getcwd() lists = os.path.join(root,"lists") card_folder = os.path.join(root,"cards") expan_list = os.path.join(lists,"otCards.json") #load json data for the expansions list expansion = json.load(expan_list) #program boolean for the state of continue cont_set = True #functions print("please note inputing improper data may result in an error and a crash") def get_mode(): print("please enter a number from 1-7 the following will describe the corresponding mode") print("1 = print all the cards and their status and have patience(false for unobtained true for obtained)") print("2 = add a new obtained card") print("3 = remove a obtained card") print("4 = show data on all cards(wip will cause error/crash)") print("5 = print programed expansions") print("6 = end program") print("7 = show data on a specific card(wip will cause error/crash)(must know file #)") return int(input(": ")) def print_ot_cards(): global expansion locations = None for i in expansion: current_item = expansion[i] current_file = json.load(locations[i]) print(current_file) def add_ot_cards(): global lists,expansion expansion_location_num = input("what is the cards expansion number") card_collectors_num = input("what is the cards collectors number") if os.path.join(lists,expansion[expansion_location_num]): card_locator_list = os.path.join(lists,expansion[expansion_location_num]) data = json.load(card_locator_list) if data[card_collector_num] == False: data[card_collector_num] = True json.dump(card_locator_list,data) else: print("error. restarting program") else: print("error. restarting program") def rmv_ot_cards(): global lists,expansion expansion_location_num = input("what is the cards expansion number") card_collectors_num = input("what is the cards collectors number") if os.path.join(lists,expansion[expansion_location_num]): card_locator_list = os.path.join(lists,expansion[expansion_location_num]) data = json.load(card_locator_list) if data[card_collectors_num] == False: data[card_collectors_num] = True json.dump(card_locator_list,data) else: print("error. restarting program") else: print("error. restarting program") def show_card_data_all(): for i in range(1,9722): current_file = str(i) + ".json" current_json = os.path,join(card_folder,current_file) json_var = json.load(current_json) print(json_var) #main loop while cont_set: mode = get_mode() if mode == 1: print_ot_cards() elif mode == 2: add_ot_cards() elif mode == 3: rmv_ot_cards() elif mode == 4: show_card_data() elif mode == 5: print(expansion) elif mode == 6: cont_set = False else: print("error. restarting program") quit()