How in PyQt connect button to a function with a specific parameter?
<p>The idea is that when button is pressed, I need to start a function with the parameter that is that button's text. </p>

<pre><code># -*- coding: utf-8 -*-
import ftplib 
from PyQt4 import QtGui, QtCore
import sys
import socket

app = QtGui.QApplication(sys.argv)
window = QtGui.QWidget()

List = ['one', 'two', 'free']

layer = QtGui.QVBoxLayout()
window.setLayout(layer)

def btn_clicked(btn):
    print 'button with text &lt;%s&gt; clicked' %(btn)

for i in List:
    button = QtGui.QPushButton(i)
    layer.addWidget(button)
    QtCore.QObject.connect(button, QtCore.SIGNAL('clicked()'),  btn_clicked(button.text())) # &lt;--- the problem is here 

window.show()
sys.exit(app.exec_())
</code></pre>