problem in the compiler ?

Glauco Silva glauco.silva at cenpra.gov.br
Tue May 3 07:54:55 EDT 2005


I´m sorry if i don´t write correct.
My code is like this:

MyClass()

class MyClass:
     def __init__(self):
         btn = RadioButton(command=self.Function)
     def Function(self):
         print "Enter in the function"

python : 2.3.5
os: win 2K

When a do this, the function 'Function' is call. And i don´t want this.
What´s wrong ?
Thank you
Glauco

----- Original Message ----- 
From: "Delaney, Timothy C (Timothy)" <tdelaney at avaya.com>
To: "Glauco Silva" <glauco.silva at cenpra.gov.br>; <python-list at python.org>
Sent: Monday, May 02, 2005 8:50 PM
Subject: RE: problem in the compiler ?


Glauco Silva wrote:

> when i creat a RadioButton and put a command = self.Function , this
> function is called in the creation of RadioButton. It´s right this or
> it´s wrong ?

http://www.catb.org/~esr/faqs/smart-questions.html

I'm pretty sure I can guess exactly what the problem is. I suspect your code
looks somewhat like:

    btn = RadioButton(command=self.Function())

Follow the instructions in the above link and you should be able to work out
why this is wrong.

If I've failed to read your mind correctly, the above link should also teach
you how to make it easier for me to do so.

Tim Delaney




-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.1 - Release Date: 2/5/2005




More information about the Python-list mailing list