473,545 Members | 1,717 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tkFileDialog.as kopenfilenames 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=tkFileDia log.askopenfile names()

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

~> tclsh
% info tclversion
8.3

Thanks for any help.
Jul 18 '05 #1
3 3763
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=tkFileDia log.askopenfile names()
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "tkFileDialog.p y", line 133, in askopenfilename s
return Open(**options) .show()
File "tkCommonDialog .py", line 52, in show
s = w.tk.call(self. command, *w._options(sel f.options))
_tkinter.TclErr or: bad option "-multiple": must be -defaultextensio n,
-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********@gat wick.westerngec o.slb.com>
Jul 18 '05 #2
Martin Franklin <mf********@gat wick.westerngec o.slb.com> wrote in message news:<ma******* *************** *************** *@python.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:5 781: 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:5 736: 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.go ogle.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:5 781: 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:5 736: 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
9424
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 the dialog is closed? Thanks. -- Stephen
0
2821
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 when I select Cancel. Python 2.2: Python 2.2.2 (#3, Jan 21 2003, 08:39:06) on linux2 Type "help", "copyright", "credits" or "license" for...
2
2499
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 tkFileDialog.askopenfilename() returns a tuple on Cancel instead of ''. I found that the Windows version still returns a string (''). Now I'm finding out that...
2
4143
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 things up. After the file dialog, I can no longer use the Text widget (typing, selecting, it doesn't work anymore!) What am I doing wrong? TIA,...
3
1636
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 handler which spawns a tkFileDialog. This works but the button __stays depressed__ after the handler returns! Any ideas why? class MyApp: def...
9
2130
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. ******************************************** import tkFileDialog file = tkFileDialog.askopenfile() print file
1
3256
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 -0800 Subject: Problem getting a file pathname with tkFileDialog Hello,
4
2105
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 program just dissappears) I have created a simple example and was able to reproduce the same thing with this. I've just started using tkinter so I...
2
16554
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 close once I've selected and opened the file. It just stays there and when clicked on says not responding. I am using Vista, writing this file in...
0
1491
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 blocked (i cannot type characters into it) when I call askopenfilename before I create the widget. Calling askopenfile again (by clicking the button)...
0
7453
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7390
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7802
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7410
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7742
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5318
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4940
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3441
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1007
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.