From the following code, I wish for the output of names to contain an array of names taken from a column in a csv file. When the function is run, the array remains empty. Why?
def cp_identifier():
global names
names = []
array_dec()
print(names)
def array_dec():
with open("card_list_currents.csv", "r") as file:
card_list_table = csv.DictReader(file, delimiter=',')
for row in card_list_table:
names.append(row["Card Name"])
Current Output:
[]
Expected output:
['Card Name', 'Card Name', ... , 'Card Name']