Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Multiple file select with tkFileDialog passes back 'decorated' strings (sometimes)

Reply
Thread Tools

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

 
 
Alex van der Spek
Guest
Posts: n/a
 
      05-23-2011
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,initi aldir=initdir,filetypes=filetype)
tkroot.destroy()

 
Reply With Quote
 
 
 
 
Gabriel Genellina
Guest
Posts: n/a
 
      05-24-2011
En Mon, 23 May 2011 10:00:53 -0300, Alex van der Spek <(E-Mail Removed)>
escribió:

> 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)?


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

--
Gabriel Genellina

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tkinter, tkFileDialog - how to select multiple files ? Steve Offutt Python 1 04-07-2009 07:33 PM
Strings, Strings and Damned Strings Ben C Programming 14 06-24-2006 05:09 AM
tkFileDialog.Open to select a large number of files Alexandre Guimond Python 0 05-25-2006 01:56 PM
select of select box will select multiple in another box palmiere Javascript 1 02-09-2004 01:11 PM
tkFileDialog.askopenfilenames not regonizing -multiple option Tim Williams Python 3 12-11-2003 05:15 PM



Advertisments