Решил я сделать простенькое приложение-генератор с GUI на PyQt5, но появилась ошибка.
Вот сам код:
import sys
import os
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import *
from PyQt5.uic import loadUi
import random, string
import time
class p_main(QWidget):
def __init__(self):
super(p_main, self).__init__()
loadUi("uno.ui", self)
self.PushButton.clicked.connect(gen)
def gen():
value = 1
while value <= amount:
code = "https://discord.gift/" + ('').join(random.choices(string.ascii_letters + string.digits, k=16))
value += 1
self.Label.setText(code)
app = QApplication(sys.argv[:1])
wind = p_main(QWidget)
wind.show()
sys.exit(app.exec_())
А вот ошибка:
Traceback (most recent call last):
File "C:\Users\Desmoke\Desktop\5.py", line 23, in <module>
wind = p_main(QWidget)
TypeError: __init__() takes 1 positional argument but 2 were given