I'm using python 2, and trying to delete two lists. Here is the code:
test_data1 = [img for img in glob.glob("/location/of/images/*png")]
test_data0 = [img for img in glob.glob("/location/of/other_images/*png")]
test_data = test_data1 + test_data0
Every list of images contains millions of file-names, so I would prefer to delete the unnecessary lists after I created the test_data
list. Just for make the code "easier" for the computer to run.
How can I do it?
I found few different ways, but no any of them refereed to memory issues. I'm not sure if test_data1=[]
actually delete the list completely from the memory.
also I'm afraid that the test_data = test_data1 + test_data0
line only combine the hashes of the lists, and when I'll delete the two lists, test_data
also become empty.
So.. what is the right way?
Really appreciate your help! Sorry if the English is bad, I'm not a native speaker :P
Thanks!