I am working on a basic calculator using PyQt5. I have a class to create buttons so I don't have to do it manually each time. I defined 16 functions, but I couldn't manage to attach these functions on the buttons using .format
.
funclistq = ["sum", "takeaway", "multiply", "divide", "seven", "eight",
"nine", "clear", "four", "five", "six", "zero", "one",
"two", "three", "ok"]
for i in range(16):
self.button.clicked.connect(self.{}.format(funclistq[i]))