473,394 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

tkFileDialog.askopenfilenames not regonizing -multiple option

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.
Jul 18 '05 #1
3 3756
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 <mf********@gatwick.westerngeco.slb.com>
Jul 18 '05 #2
Martin Franklin <mf********@gatwick.westerngeco.slb.com> wrote in message news:<ma**************************************@pyt hon.org>...
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.
Jul 18 '05 #3
ti**************@nvl.army.mil (Tim Williams) wrote in message news:<fa**************************@posting.google. com>...
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.
Jul 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Stephen Boulet | last post by:
I'm using the following code to get a file name: import tkFileDialog tkFileDialog.askopenfilename(filetypes=) How can I do this without an empty tk window popping up and hanging around after...
0
by: Tim Williams | last post by:
I just installed Python 2.3 on my Redhat system. When I tried to run one of my programs that use tkFileDialog.askopenfilename(), I got an error because it returns a tuple instead of a null string...
2
by: Tim Williams | last post by:
I'm using Python 2.3.2 and tkFileDialog in a program I have. I'm trying to use this on Linux (RH 8.0) and Windows 2000. When I first upgraded from v2.2 to v2.3. I noticed that...
2
by: Irmen de Jong | last post by:
Hi, I'm having trouble with the code below. It's just a regular Tk text widget in which you can type and select text as expected, however the call to tkFileDialog.askopenfilename() seems to screw...
3
by: jaime.suarez | last post by:
I am creating a very simple GUI with one Entry widget and one Button. The purpose of the Button widget is to Browse for a file using tkFileDialog.askopenfilename(). I bind the button to a...
9
by: cdroulers | last post by:
Hello, I am working on a school project that requires me to get the path of a filename for future treatment. I've tried getting a file with tkFileDialog.askopenfile. ...
1
by: Gheorghe Postelnicu | last post by:
In our example, try replacing the last line with print file.name ---------- Forwarded message ---------- From: cdroulers@hotmail.com To: python-list@python.org Date: 8 Nov 2006 11:01:08...
4
by: mdmdmd | last post by:
Hello, I wish to collect 4 files from a user. So I have decided to use tkFileDialog askopenfilename. My problem is that after a few file selections the root window is destroyed (the whole...
2
by: Traclo | last post by:
Hello all! I have a problem concerning tkFileDialog. When I use the the askopenfilename command to open a text file it opens a tkinter window (apart from the file browsing window) which refuses to...
0
by: Leonhard Vogt | last post by:
Hello I have the following problem in Python 2.5 on Windows XP. On Ubuntu I do not see the problem. I have a Tkinter application as in the following example The entry-widget is somehow...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.