RE: tkFileDialog question

2009-11-16 Thread Matt Mitchell
Subject: Re: tkFileDialog question Matt, There is also a nice thing you need to know about Python if you already do not know. That is the fact that all empty collections bool to False. This makes Truth testing easier. >>> bool([]) False >>> bool('') False >>> bool(

Re: tkFileDialog question

2009-11-15 Thread r
Matt, There is also a nice thing you need to know about Python if you already do not know. That is the fact that all empty collections bool to False. This makes Truth testing easier. >>> bool([]) False >>> bool('') False >>> bool({}) False >>> bool([1]) True >>> bool([[]]) True >>> bool(' ') True

Re: tkFileDialog question

2009-11-15 Thread r
On Nov 15, 8:56 pm, "Gabriel Genellina" wrote: > En Fri, 13 Nov 2009 11:32:37 -0300, Matt Mitchell   > escribió: > > > answer = tkFileDialog.askdirectory() > > > if answer is not '': > >    #do stuff > > Although it "reads well", this is *wrong*. You want != here, not the `is   > not` operator. >

Re: tkFileDialog question

2009-11-15 Thread Gabriel Genellina
En Fri, 13 Nov 2009 11:32:37 -0300, Matt Mitchell escribió: answer = tkFileDialog.askdirectory() if answer is not '': #do stuff Although it "reads well", this is *wrong*. You want != here, not the `is not` operator. if answer != '': ... If you want to compare the *values* of t

Re: tkFileDialog question

2009-11-13 Thread r
Opps, i see you answered your own question ;-) To save you more hours of Googling take a look at these two sites! #great reference http://infohost.nmt.edu/tcc/help/pubs/tkinter/ #more in-depth http://effbot.org/tkinterbook/ you'll want to keep them both under your pillow. -- http://mail.python

Re: tkFileDialog question

2009-11-13 Thread r
On Nov 13, 2:47 pm, "Matt Mitchell" wrote: > --- > The information contained in this electronic message and any attached > document(s) is intended only for the personal and confidential use of the > designated recipients named above. This message may be confidenti

RE: tkFileDialog question

2009-11-13 Thread Matt Mitchell
--- The information contained in this electronic message and any attached document(s) is intended only for the personal and confidential use of the designated recipients named above. This message may be confidential. If the reader of this message is not the in

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
On Apr 13, 2:29 pm, Alan G Isaac wrote: > > On Apr 13, 11:26 am, Alan G Isaac > > wrote: > >> Why do I get the ImportError below? > >> What is the right way to do this? > >> Thanks, > >> Alan Isaac > >> Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC > >> v.1310 32 bit (Intel)] on win32 Typ

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Alan G Isaac
On Apr 13, 11:26 am, Alan G Isaac wrote: Why do I get the ImportError below? What is the right way to do this? Thanks, Alan Isaac Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information.

Re: tkFileDialog -> ImportError: No module named shell

2009-04-13 Thread Mike Driscoll
On Apr 13, 11:26 am, Alan G Isaac wrote: > Why do I get the ImportError below? > What is the right way to do this? > Thanks, > Alan Isaac > > Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] > on win32 > Type "help", "copyright", "credits" or "license" for more informa

Re: tkFileDialog, askopenfiles in v2.6 question

2008-11-26 Thread MRAB
fransstil wrote: To select a group of files works fine in 2.5 ... from tkFileDialog import askopenfiles fnames = askopenfiles(title = "Select files", initialdir = "C:\\temp", filetypes=[("All", "*.*")]) for i in range(len(fnames)):

Re: tkFileDialog closes main application

2006-12-22 Thread Eric Brunel
On Thu, 21 Dec 2006 22:37:37 +0100, James Stroud <[EMAIL PROTECTED]> wrote: > Eric Brunel wrote: >> BTW, why do you create a sub-class of Frame for your application? Why >> not create a sub-class of Tk instead? >> > > The short answer is that inhereting from Frame will allow embedding of >

Re: tkFileDialog closes main application

2006-12-21 Thread mdmdmd
Thanks for the reply. I used your modified code to test. I ran the code on Windows Python 2.4 tcl/tk 8.4. When I opened the ui I: 1) click browse button 2) file dialog opens and I double click the file. When I do this, the selected file path is entered in Entry field. I don't need to close d

Re: tkFileDialog closes main application

2006-12-21 Thread James Stroud
Eric Brunel wrote: > BTW, why do you create a sub-class of Frame for your application? Why > not create a sub-class of Tk instead? > The short answer is that inhereting from Frame will allow embedding of the application in another application. A Tk() can not be embedded like this. Tk is appro

Re: tkFileDialog closes main application

2006-12-21 Thread Eric Brunel
On Wed, 20 Dec 2006 18:37:10 +0100, mdmdmd <[EMAIL PROTECTED]> wrote: > 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 > dissapp

Re: tkFileDialog

2006-11-09 Thread Mohammad Tayseer
use askopenfilename() instead of askopenfile()> > import tkFileDialog> file = tkFileDialog.askopenfile()> print file> Access over 1 million songs - Yahoo! Music Unlimited.-- http://mail.python.org/mailman/l

Re: tkFileDialog

2006-11-08 Thread James Stroud
Gheorghe Postelnicu wrote: > -- Forwarded message -- > From: [EMAIL PROTECTED] > To: python-list@python.org > > import tkFileDialog > file = tkFileDialog.askopenfile() > print file > Its ill-a

Re: tkFileDialog question

2005-05-13 Thread jaime . suarez
James, thank you very much for your answer. Jaime -- http://mail.python.org/mailman/listinfo/python-list

Re: tkFileDialog question

2005-05-12 Thread James Stroud
Oops, That should have been, class MyApp: def __init__(self, parent): self.myParent = parent self.myContainer1 = Frame(parent) self.myContainer1.pack() self.entry = Entry(self.myContainer1) self.entry.grid(r

Re: tkFileDialog question

2005-05-12 Thread James Stroud
I think you are better off not binding a button like you are doing. Use the "command" option to get the behavior you want. E.g: class MyApp: def __init__(self, parent): self.myParent = parent self.myContainer1 = Frame(parent) self.myContainer