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

Discussion in 'Python' started by Alex van der Spek, May 23, 2011.

  1. 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()
    Alex van der Spek, May 23, 2011
    #1
    1. Advertising

  2. Re: Multiple file select with tkFileDialog passes back 'decorated'strings (sometimes)

    En Mon, 23 May 2011 10:00:53 -0300, Alex van der Spek <>
    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
    Gabriel Genellina, May 24, 2011
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Saunders
    Replies:
    0
    Views:
    464
    John Saunders
    Aug 28, 2003
  2. Nehmo Sergheyev
    Replies:
    1
    Views:
    504
    Andrew Urquhart
    May 9, 2004
  3. Marcin Vorbrodt

    ::std sometimes needed, sometimes not

    Marcin Vorbrodt, Sep 16, 2003, in forum: C++
    Replies:
    24
    Views:
    761
    Jerry Coffin
    Sep 17, 2003
  4. Replies:
    1
    Views:
    502
    gkelly
    Nov 29, 2006
  5. Steve Offutt
    Replies:
    1
    Views:
    1,926
    Steve Offutt
    Apr 7, 2009
Loading...

Share This Page