[NCLUG] Dumb Python Question

marciot marciot at holly.colostate.edu
Tue Jul 30 12:41:17 MDT 2002


>===== Original Message From nclug at nclug.org =====
>* On 2002-07-30 16:28 marciot <marciot at holly.colostate.edu> wrote:
>> What's wrong with this line?
>>
>>         popupMenu = Menu(self, tearoff=0)
>>         popupMenu.add_command(label="water", command=lambda: pass )
>>
>> Python whines about a syntax error right after "pass". I've tried to RTFM, 
but
>
>What package is "Menu" from?

tkinter

>
>> there is so much documentation out there I can't find one that addresses my
>> specific problem. There is such a thing as *too* much docs...
>
>pydoc2 'name of package containing Menu'
>look for 'add_command'

Actually, I think my problem relates to lambda functions, not to the Menu per 
se. For example, at the interactive prompt, I can type:

a = lambda: sys.exit()

But not:

a = lambda: pass

I wanted a lambda function that was equivalent to:

def doNothing():
   pass

Why doesn't python let me do that?

Marcio Luis Teixeira







>
>
>--
>Regards,                    tummy.com, ltd
>Evelyn Mitchell             Linux Consulting since 1995
>efm at tummy.com               Senior System and Network Administrators
>                            http://www.tummy.com/
>_______________________________________________
>NCLUG mailing list       NCLUG at nclug.org
>
>To unsubscribe, subscribe, or modify your settings, go to:
>http://www.nclug.org/mailman/listinfo/nclug





More information about the NCLUG mailing list