<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def connect(self, funct):
 """Call funct when the text was changed. Parameters funct : function function that broadcasts a change. Notes ----- There is something wrong here. When you run this function, it calls for opening a directory three or four times. This is obviously wrong but I don't understand why this happens three times. Traceback did not help. """

        def get_directory():
            rec = QFileDialog.getExistingDirectory(self,
                                                   'Path to Recording'
                                                   ' Directory')
            if rec == '':
                return

            self.setText(rec)
            funct()

        self.clicked.connect(get_directory)