I have a file with an array written in it, like:
[1, 2, 3, 4, 5, 6, 7]
How can I read it and get the array in a variable with python? So far what happens is that I just get the string.
def get_data():
myfile = open('random_array.txt', 'r')
data = myfile.read().replace('\n', '')
return data