I\'m trying to get a list of filenames from tkinter.filedialog.askopenfilenames() in Python 3.2.
files = askopenfilenames(initialdir=\"C:\\\\Users\\\\BVC
I support Eldererathis's answer as the best solution I have found for Python versions 2.X (mainly 2.5 and above) versions under Linux, Mac OS X and Windows. When a tkFileDialog calls the askopenfilename(...,multiple=1) methods with argument multiple=1, I could not get it work properly under Windows (Linux and Mac OS X were fine) when a single file was selected (the file is processed as a 'str' instead of a 'tuple').
I tried the files = re.findall('\{(.*?)\}', files suggested by Paul in the comments, but it did not change anything. I also tried files = tuple(files) and files = list(files), but it is not a viable workaround from what I have seen.
So far, files = tkRoot.master.splitlist(files) is what is working under all environments I have tested (Win32, Win64, Linux32, Linux64, Mac OS X).