View Full Version : overlapping function with python

April 29th, 2008, 05:27 PM
Can we make overlapping functions in python???
if yes,how to do it ??
I tryed:

def fct2(self):
return rep

def fct1(self):

But it announced that there is no fct2
Thank you

April 29th, 2008, 05:41 PM
I think you want


in fct1().

EDIT: Oops, that should be


as Can+~ explains below.

April 29th, 2008, 06:03 PM
This message appear:
fct2() takes exactly 1 argument (2given)
it blocks my interface QT and then when I choose "NO" in the message box error the interface is no more blocked

April 29th, 2008, 06:12 PM
When calling methods from a class, the self statement is passed implicitly. So what WW said is right, but without the (self).

April 29th, 2008, 06:33 PM
It's Ok.
But Do you have an idea why my interface is still blocking??
It's an interface for chating between a server and a client with QT4.
thank u for help.

April 29th, 2008, 08:05 PM
How could I know? I have never seen your application, nor it's code.

Notice that GUI's usually lock up when there's a long task going, that pauses the interface main loop.

May 13th, 2008, 09:36 AM
I program an interface customer with PYTHON2.5 AND QT4.In my interface there is a button to send messages.In the debuginning I put it: " self.ui.button_send.setEnabled (False) " As soon as the customer is connected to the server (from a menu) the button changes : " self.ui.buton_send.setEnabled (True) " This action causes me an interuption of connection. I don't know why????

How to fix it?
Thank you for help