I have a program which outputs a list in a .txt file on a server and I want to save that list in a new variable.
I'm doing:
with open ("file.txt", "r") as myfile:
data = myfile.read().replace('\n', '')
var = data
but obviously print(var)
returns a string "[list, of, stuff]"
Yeah I can bypass the txt-save procedure but what in case I could not?