Answer the question
In order to leave comments, you need to log in
Python how to pass string to lineEdit (Pyqt5)?
def rand_password(self):
massive = []
from random import choice
from string import digits
string.ascii_letters # Подключение ASCII символов
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
a = int(self.ui.lineEdit.text())
count = 0
while count < a:
num_or_letter = random.randint(1, 2)
if num_or_letter < 2:
massive.append(random.choice(string.ascii_letters))
else:
massive.append(random.randint(0, 9))
count = count + 1
print(*massive, sep = '')
self.ui.lineEdit_5.setText(*massive, sep = '')
Traceback (most recent call last):
File "C:\Users\mayer\Desktop\╨рэфюьрщч 4.0\main.py", line 62, in rand_password
self.ui.lineEdit_5.setText(*massive, sep = '')
TypeError: setText() takes no keyword arguments
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question