Multiple file select with tkFileDialog passes back 'decorated' strings (sometimes)

A

Alex van der Spek

I switched from Mark Hammonds pywin32 extensions for file choosers as the
multiselect there seems to crash on me when selecting more than a few dozen.
Using Tk now. Works well but the resulting string passed back seems to
'decorated' when the files are on local disk and not decorated when
retrieved over a USB interface from an external disk?

I do this:

From local disk I get back:

'{file1.bin} {file2.bin}'

From external disk I get back:

'file1.bin file2.bin'

I can handle/parse both, not an issue but it raises the question: Are these
the only two possibilities? Is it the same across platforms (I use Python
2.7 on Win Vista)?

See code below.

Thanks for the insight!
Alex van der Spek
+++++++++++++++++++

from Tkinter import *
import tkFileDialog as tkf

tkroot=Tk()
tkroot.withdraw()

initdir=os.environ['HOME']
filetype=[('Binary Timeseries','*.bin'),('All files','*.*')]
filenames=tkf.askopenfilenames(parent=tkroot,initialdir=initdir,filetypes=filetype)
tkroot.destroy()
 
G

Gabriel Genellina

I switched from Mark Hammonds pywin32 extensions for file choosers as
the multiselect there seems to crash on me when selecting more than a
few dozen. Using Tk now. Works well but the resulting string passed back
seems to 'decorated' when the files are on local disk and not decorated
when retrieved over a USB interface from an external disk?

I do this:


'{file1.bin} {file2.bin}'


'file1.bin file2.bin'

I can handle/parse both, not an issue but it raises the question: Are
these the only two possibilities? Is it the same across platforms (I use
Python 2.7 on Win Vista)?

An old bug. See http://bugs.python.org/issue5712 for a workaround.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Tkinter FileDialog 0

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top