I've seen this question a few times before, and invariably I see that people always respond by saying that this is a bad idea. What is a good way to approach this issue? I have a code that reads in data from several csv files in a for loop, i.e for each loop iteration a different csv is read. At the end of my for loop, I make a dictionary with some data in it. All I would like to do is name this dictionary after the original csv file's name.
At the moment I have:
sessionname=str(inputList).replace(".csv",'').replace("'",'').replace("[",'').replace("]",'')
session_dict={}
What I would like is for session_dict to be named using the string in sessionname. Therefore at the end of my for loop, I would have a number of dictionaries each with the name of its orginal csv file.
Thank you!