So this is my text file
player_basic, [10, 1, "SCISSOR", True]
Enemy3, [10, 1, "SCISSOR", True]
Enemy2, [10, 1, "PAPER", True]
Enemy1, [10, 1, "ROCK", True]
My code creates a list of the lines in the file (minus the first line), but only in one string per line. I can't figure out a way to change each line into a tuple with different types in it.
num_enemys = 0
def initialize_enemy(num_enemys):
data_list = []
data = open("test.txt", "r")
raw_data_list = data.readlines()
for line in raw_data_list:
line.replace('\'', '')
data_list.append(line)
data.close()
data_list.pop(0)
return data_list[num_enemys:]
Any help would be great thanks