>>> from PyQt4 import QtGui
>>> import sys
>>> app = QtGui.QApplication(sys.argv)
>>> button = QtGui.QPushButton("Click me")
>>> button.move(QtGui.QCursor.pos())
>>> button.show()
>>> button.raise_()
>>> def hello():
... print "hello"
...
>>> hello()
hello
>>> button.clicked.connect(hello)
>>> hello
hello
hello
hello
hello
hello
hello
hello
hello
button.clicked.disconnect(hello)
>>>