Python version: 2.7 Tk version: 8.5
Refer to my previous question how to add the selected files from dialog window to a dictionary?
I am trying to select 500 files from dialog window and extract their name as keys for a dictionary. Total files size is around 200M. I have no idea why I got an empty dictionary. However, if I choose less files like 100 each time, it works very well at each time. So my question is that is there any quantity limitation for dialog window selecting files or for keys in a dictionary?
sys.path.append("C:\MY PATH")
os.environ['PATH']+=";C:\MY PATH"
print "Please select your txt files in the dialog window >>"
filez = tkFileDialog.askopenfilenames(parent=root,multiple='multiple',title='Choose a file',filetypes=[('txt file','.txt'),('All files','.*')])
mydict = {}
for FilenameWithPath in filez:
path, Filename = os.path.split(str(FilenameWithPath))
## Filename = sys.path.basename(FilenameWithPath)
mydict[Filename] = len(mydict)
print "mydict " + str(mydict)
print "\n"
if I selec all 500 files, it only gives
mydict {}
Any solution? Thanks.