I am trying to have my program format properly in a tkinter GUI but for some reason I get the error message:
product += ('%-10s%-10s%-0s%-0s') % (str(names[i])+ str(addedHours[i]) + str(payOut) + "\n") TypeError: not enough arguments for format string
Here is the snip of code related to the problem (Note that the Name/Hours/Pay and --- parts are working fine, just not the ones under the variable product)
def printPayroll(self):
i = 0
product = ""
for y in names:
payOut = float(wage[i]) * float(addedHours[i])
product += ('%-10s%-10s%-0s%-0s') % (str(names[i])+ str(addedHours[i]) + str(payOut) + "\n")
i += 1
self.text.insert(END,("%-10s%-10s%-0s") % ('Name', 'Hours', 'Pay\n'))
self.text.insert(END,("%-10s%-10s%-0s") % ('---','-----','---\n'))
self.text.insert(END, product)
