473,659 Members | 2,985 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 3775
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
9449
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
2849
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 more information.
2
2509
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 tkFileDialog.Directory().show() does this too. >>> d1=tkFileDialog.Directory().show() >>>...
2
4149
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, --Irmen de Jong
3
1644
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 __init__(self, parent):
9
2139
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
3262
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
2118
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 have no idea what I may be doing wrong. If anyone has any ideas please let me know.
2
16564
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 Wing, and have the latest version of python My code for this interaction goes like this: import...
0
1499
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) releases the block, I can type into the entry as expected.
0
8428
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8851
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8747
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8528
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7356
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6179
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
1976
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.