if __name__ == "__main__":
import sys
app = QtGui.QApplication(sys.argv)
Dialog = QtGui.QDialog()
ui = Ui_Dialog()
ui.setupUi(Dialog)
Dialog.show()
def bp():
text4change = self.lineEdit_4.text()
whatzam = self.lineEdit.text()
whichzam = self.lineEdit_2.text()
ui.lineEdit_3.setText(text4change.replace(whatzam, whichzam))
ui.pushButton_2.clicked.connect(bp)
sys.exit(app.exec_())