Quantity limitation for dialog window selecting files?

99封情书 提交于 2019-12-01 02:20:41

I think I can see where the issue is. I have done a little debugging and found that the data type returned into filez is a unicode string (where you seem to be expecting a list or tuple).

You will need to convert this before your loop. If none of your file names contain spaces this should just be a simple matter of:

file_list = files.split()

However, if this is not the case then the above will not work and and filenames that contain spaces with be enclosed with curly braces {}.

This may actually be a bug according to this page. However, a work around is also suggested to convert the string to a tuple:

file_list=  master.tk.splitlist(filez)

Hope this helps.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!