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({})
False
bool([1])
True
bool([[]])
True
En Fri, 13 Nov 2009 11:32:37 -0300, Matt Mitchell
mmitch...@transparent.com 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
On Nov 15, 8:56 pm, Gabriel Genellina gagsl-...@yahoo.com.ar
wrote:
En Fri, 13 Nov 2009 11:32:37 -0300, Matt Mitchell
mmitch...@transparent.com escribió:
answer = tkFileDialog.askdirectory()
if answer is not '':
#do stuff
Although it reads well, this is *wrong*. You want != here,
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
any empty
---
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
On Nov 13, 2:47 pm, Matt Mitchell mmitch...@transparent.com 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
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.
--
James, thank you very much for your answer.
Jaime
--
http://mail.python.org/mailman/listinfo/python-list
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)