I am trying to read a csv file, copy it, close the file and use the copy. I need to move away from the with or csv.reader block. after hours of searching i found this:
fr = open('my_symbols.csv', 'r') csv.reader(fr) my_symbol_list = deepcopy(fr) fr.close()
But that does not work either. Anybody have any hints or suggestions? There must be a simple answer rigth?
Thanks in advance
#make variable outside of 'with' filelines =  with open('my_symbols.csv','r') as fr: filelines = fr.readlines() #after with (file is now closed), use the variable. #you may need to split up the lines further in to columns print(filelines)