if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
def psw_gen():
lis1 = '123456789'
lis2 = 'qwertyuiopasdfghjklzxcvbnm'
lis3 = lis2.upper()
lis4 = lis1+lis2+lis3
ls = list(lis4)
random.shuffle(ls)
psw = ''.join([random.choice(ls) for x in range(15)])
ui.lineEdit.setText(psw)
def cop_psw():
pyperclip.copy(psw)
ui.pushButton.clicked.connect(psw_gen)
sys.exit(app.exec_())