I have created this employee database for my project and need to convert it to a class (I get more marks for including classes) but I need to iterate through each column (ID, name, jobRole, etc.) and create an object of the Employee class I have created.
This is my code so far:
tableID = c.execute('select employeeID from employeeData')
for r in tableID:
tableName = c.execute('select employeeName from employeeData')
for s in tableName:
tableJobRole = c.execute('select employeeJobRole from employeeData')
for t in tableJobRole:
tableYearlySalary = c.execute('select employeeYearlySalary from employeeData')
for u in tableYearlySalary:
v = s
exec(str(v))
v = Employee(r, s, t, u)
When I run the code in my GUI and click a button, it doesn't do what I want it to do. How would I go about creating a bit of code to iterate through the first row, setting the data in the columns to r, s, t and u, and then going onto the next row for all of them at the same time?
Each of r,s,t,u would equal the first row, then I want all of them to be equal to the next row instead of the first three staying on the first row and u going onto the next row until t is incremented then s.
So I'd want to somehow increment each 'for each in ...' by one at the same time somehow.