Question: im trying to make an automatic work scheduler in python, by reading an excel file and then making a schedule from it. my code: my

im trying to make an automatic work scheduler in python, by reading an excel file and then making a schedule from it.
my code:  im trying to make an automatic work scheduler in python, by
my input: (and what i want it to look like in "expected output")
reading an excel file and then making a schedule from it. my
what output i am getting.
code: my input: (and what i want it to look like in
i want the names of people working on that specific day like a schedule.
can you fix my code, or make a code that reads an excel file and outputs a work schedule for the week.

import openpyxl \# Open the workdays spreadsheet workdays_wb = openpyx l. load_workbook( 'workdays. x 'sx') workdays_sheet = workdays_wb.active \# Create a new schedule spreadsheet schedule wb = openpyxi. Workbook() schedule_sheet = schedule_wb. active schedule_sheet.title = "Schedule" \# Write the header row for the schedule schedule_sheet [ A1]]= "Monday" schedule_sheet [ 'B1 ' ]= "Tuesday" schedule_sheet [ 'C1' ]= "Wednesday" schedule_sheet [ DD ' ] = "Thursday" schedule_sheet ['E1'] = "Friday" \# Iterate through the workdays spreadsheet and write the schedule for row in range (2, workdays sheet,max row +1) : name = workdays sheet, cell (row=row, column=1), value monday = workdays sheet, cell(row=row, column=2), value tuesday = workdays sheet, cell(rowerow, column=3), value wednesday = workdays sheet. cell thursday = workow, column=4), value friday = workdays sheet. cell (row=row, column=5), value friday = workdays,sheet. cell( rowerow, column=6), value schedule_sheet, cell(rowerow, column=1) :value = name if monday else m schedule_sheet, cell(row=row, column=2), value = name if tuday else schedule_sheet. cell(rownow, column=3), value = name if wednesday else "n schedule_sheet, cell(row=row, column=4), value = name if thursday else wu schedule_sheet, cell(rowerow, column=5), value a name if friday else wn \# Save the schedule spreadsheet schedule,wb. save("schedule. x (sx") \begin{tabular}{|l|l|c|c|c|c|c|c|} \hline \multicolumn{1}{|c|}{ A } & B & C & D & E & F & G \\ \hline 1 & Monday & Tuesday & Wednesday Thursday & Friday & & \\ \hline 2 & Name1 & Name1 & Name1 & Name1 & Name1 & & \\ \hline 3 & Name2 & Name2 & Name2 & Name2 & Name2 & & \\ \hline 4 & & & & & & & \\ \hline 5 & & & & & & & \\ \hline \end{tabular}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!