I'm using the code below (Python 2.7 and Python 3.2) to show an Open Files dialog that supports multiple-selection. On Linux filenames is a python list, but on Windows filenames is returned as {C:/Documents and Settings/IE User/My Documents/VPC_EULA.txt} {C:/Documents and Settings/IE User/My Documents/VPC_ReadMe.txt}
, i.e. a raw TCL list.
Is this a python bug, and does anyone here know a good way to convert the raw TCL list into a python list?
if sys.hexversion >= 0x030000F0:
import tkinter.filedialog as filedialog
else:
import tkFileDialog as filedialog
options = {}
options['filetypes'] = [('vnote files', '.vnt') ,('all files', '.*')]
options['multiple'] = 1
filenames = filedialog.askopenfilename(**options)