tkFileDialog.askopenfilenames not regonizing -multiple option

Discussion in 'Python' started by Tim Williams, Dec 5, 2003.

  1. Tim Williams

    Tim Williams Guest

    Hi.

    I'm using Python 2.3 and trying to use tkFileDialog to get a list of
    files. I get a message about the '-multiple' option is not a valid
    option in the call to Open.


    Python 2.3 (#1, Aug 4 2003, 10:43:11)
    [GCC 3.2 20020903 (Red Hat Linux 8.0 3.2-7)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> from Tkinter import *
    >>> import tkFileDialog
    >>> root=Tk()
    >>> files=tkFileDialog.askopenfilenames()

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "tkFileDialog.py", line 133, in askopenfilenames
    return Open(**options).show()
    File "tkCommonDialog.py", line 52, in show
    s = w.tk.call(self.command, *w._options(self.options))
    _tkinter.TclError: bad option "-multiple": must be -defaultextension,
    -filetypes, -initialdir, -initialfile, -parent, or -title



    ~> tclsh
    % info tclversion
    8.3

    Thanks for any help.
     
    Tim Williams, Dec 5, 2003
    #1
    1. Advertising

  2. On Fri, 2003-12-05 at 13:32, Tim Williams wrote:
    > Hi.
    >
    > I'm using Python 2.3 and trying to use tkFileDialog to get a list of
    > files. I get a message about the '-multiple' option is not a valid
    > option in the call to Open.
    >
    >
    > Python 2.3 (#1, Aug 4 2003, 10:43:11)
    > [GCC 3.2 20020903 (Red Hat Linux 8.0 3.2-7)] on linux2
    > Type "help", "copyright", "credits" or "license" for more information.
    > >>> from Tkinter import *
    > >>> import tkFileDialog
    > >>> root=Tk()
    > >>> files=tkFileDialog.askopenfilenames()

    > Traceback (most recent call last):
    > File "<stdin>", line 1, in ?
    > File "tkFileDialog.py", line 133, in askopenfilenames
    > return Open(**options).show()
    > File "tkCommonDialog.py", line 52, in show
    > s = w.tk.call(self.command, *w._options(self.options))
    > _tkinter.TclError: bad option "-multiple": must be -defaultextension,
    > -filetypes, -initialdir, -initialfile, -parent, or -title
    >
    >
    >
    > ~> tclsh
    > % info tclversion
    > 8.3
    >


    You will need to upgrade to tcl/tk 8.4 as the multiple option was not
    added until then.

    Regards,
    Martin.


    > Thanks for any help.

    --
    Martin Franklin <>
     
    Martin Franklin, Dec 5, 2003
    #2
    1. Advertising

  3. Tim Williams

    Tim Williams Guest

    Martin Franklin <> wrote in message news:<>...
    > On Fri, 2003-12-05 at 13:32, Tim Williams wrote:
    > > Hi.
    > >
    > > I'm using Python 2.3 and trying to use tkFileDialog to get a list of
    > > files. I get a message about the '-multiple' option is not a valid
    > > option in the call to Open.
    > >
    > >

    (snip)
    >
    > You will need to upgrade to tcl/tk 8.4 as the multiple option was not
    > added until then.
    >
    > Regards,
    > Martin.
    >
    >
    > > Thanks for any help.



    I installed Tcl/Tk 8.4.5 and now I'm having a problem installing
    Python 2.3.2:

    ########################################
    ranlib libpython2.3.a
    c++ -pthread -Xlinker -export-dynamic -o python \
    Modules/python.o \
    libpython2.3.a -lpthread -ldl -lutil
    -L/vps/pkg/Linux/lib -ltk8.4 -ltcl8.4 -lm
    libpython2.3.a(posixmodule.o): In function `posix_tmpnam':
    /vps/pkg/Linux/src/Python-2.3.2/Modules/posixmodule.c:5781: the use of
    `tmpnam_r' is dangerous, better use `mkstemp'
    libpython2.3.a(posixmodule.o): In function `posix_tempnam':
    /vps/pkg/Linux/src/Python-2.3.2/Modules/posixmodule.c:5736: the use of
    `tempnam' is dangerous, better use `mkstemp'
    case $MAKEFLAGS in \
    *-s*) CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG
    -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build;; \
    *) CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g
    -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py build;; \
    esac
    ../python: error while loading shared libraries: libtk8.4.so: cannot
    open shared object file: No such file or directory
    make: *** [sharedmods] Error 127


    ###############################

    I installed Tcl/Tk in a non-standard directory, since I don't have
    root, but I edited the Modules/Setup file to have

    # *** Always uncomment this (leave the leading underscore in!):
    _tkinter _tkinter.c tkappinit.c -DWITH_APPINIT \

    # *** Uncomment and edit to reflect where your Tcl/Tk headers are:
    # -I/usr/local/include \
    -I/vps/pkg/Linux/include \

    # *** Uncomment and edit to reflect your Tcl/Tk versions:
    # -ltk8.2 -ltcl8.2 \
    -ltk8.4 -ltcl8.4 \


    gumbo:/vps/pkg/Linux/src/Python-2.3.2> ls -l --color=none
    /vps/pkg/Linux/lib/libt*8.4*
    -r-xr-xr-x 1 williams c4i 753972 Dec 10 08:22
    /vps/pkg/Linux/lib/libtcl8.4.so*
    -rw-r--r-- 1 williams c4i 1696 Dec 10 08:22
    /vps/pkg/Linux/lib/libtclstub8.4.a
    -r-xr-xr-x 1 williams c4i 870936 Dec 10 08:31
    /vps/pkg/Linux/lib/libtk8.4.so*
    -rw-r--r-- 1 williams c4i 3094 Dec 10 08:31
    /vps/pkg/Linux/lib/libtkstub8.4.a


    I can install python 2.3 (w/o changing Setup) w/o problems.
     
    Tim Williams, Dec 10, 2003
    #3
  4. Tim Williams

    Tim Williams Guest

    (Tim Williams) wrote in message news:<>...
    > I installed Tcl/Tk 8.4.5 and now I'm having a problem installing
    > Python 2.3.2:
    >
    > ########################################
    > ranlib libpython2.3.a
    > c++ -pthread -Xlinker -export-dynamic -o python \
    > Modules/python.o \
    > libpython2.3.a -lpthread -ldl -lutil
    > -L/vps/pkg/Linux/lib -ltk8.4 -ltcl8.4 -lm
    > libpython2.3.a(posixmodule.o): In function `posix_tmpnam':
    > /vps/pkg/Linux/src/Python-2.3.2/Modules/posixmodule.c:5781: the use of
    > `tmpnam_r' is dangerous, better use `mkstemp'
    > libpython2.3.a(posixmodule.o): In function `posix_tempnam':
    > /vps/pkg/Linux/src/Python-2.3.2/Modules/posixmodule.c:5736: the use of
    > `tempnam' is dangerous, better use `mkstemp'
    > case $MAKEFLAGS in \
    > *-s*) CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG
    > -g -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build;; \
    > *) CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-DNDEBUG -g
    > -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py build;; \
    > esac
    > ./python: error while loading shared libraries: libtk8.4.so: cannot
    > open shared object file: No such file or directory
    > make: *** [sharedmods] Error 127
    >
    >
    > ###############################
    >


    I found a post with this problem. After I modified LD_LIBRARY_PATH,
    everything is fine.
     
    Tim Williams, Dec 11, 2003
    #4
    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. Stephen Boulet

    tkFileDialog without a parent window

    Stephen Boulet, Jul 3, 2003, in forum: Python
    Replies:
    2
    Views:
    517
    klappnase
    Jul 20, 2003
  2. Tim Williams
    Replies:
    0
    Views:
    668
    Tim Williams
    Aug 4, 2003
  3. Replies:
    0
    Views:
    495
  4. Steve Offutt
    Replies:
    1
    Views:
    2,035
    Steve Offutt
    Apr 7, 2009
  5. Alex van der Spek
    Replies:
    1
    Views:
    807
    Gabriel Genellina
    May 24, 2011
Loading...

Share This Page