Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #6072 > unrolled thread
| Started by | "Alex van der Spek" <zdoor@xs4all.nl> |
|---|---|
| First post | 2011-05-23 15:00 +0200 |
| Last post | 2011-05-23 21:41 -0300 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.python
Multiple file select with tkFileDialog passes back 'decorated' strings (sometimes) "Alex van der Spek" <zdoor@xs4all.nl> - 2011-05-23 15:00 +0200
Re: Multiple file select with tkFileDialog passes back 'decorated' strings (sometimes) "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> - 2011-05-23 21:41 -0300
| From | "Alex van der Spek" <zdoor@xs4all.nl> |
|---|---|
| Date | 2011-05-23 15:00 +0200 |
| Subject | Multiple file select with tkFileDialog passes back 'decorated' strings (sometimes) |
| Message-ID | <4dda5a89$0$49175$e4fe514c@news.xs4all.nl> |
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()
[toc] | [next] | [standalone]
| From | "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> |
|---|---|
| Date | 2011-05-23 21:41 -0300 |
| Message-ID | <mailman.1992.1306197690.9059.python-list@python.org> |
| In reply to | #6072 |
En Mon, 23 May 2011 10:00:53 -0300, Alex van der Spek <zdoor@xs4all.nl>
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
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web