dexpopla.blogg.se

School Timetable Excel
school timetable excel











school timetable excelschool timetable excelschool timetable excel

School Timetable Excel Free To Use

MAX_HOUR_PER_SUBJECT = 6 # use capital letter because it's a constant variableWe know that in programming, we've never one solution (method) to do something.So, in order to fill in subjects list, i want to present you two methods and you'll be free to use one of them or your own method.1rst method def fill_in_subjects_list (): """Ask user subjects and fill in subjects list"""Enter_another_subject = True while enter_another_subject:Subject = input( 'Type another subject: ')Subject_hour_count = MAX_HOUR_PER_SUBJECTPrint(f 'You\'ve already type ')Timetable_path = pathlib.Path.cwd() / 'timetable.csv' # Now, let's write process to save timetable into a csv file with open(timetable_path, 'w') as timetable_file:Timetable_writing = csv.writer(timetable_file)# Write content into csv file for time_slot, concerned_subjects in subject_per_slot.items():If concerned_subjects = :Concerned_subjects_list.append( 'Break time')Concerned_subjects_list = concerned_subjectsFinal_line = time_line + concerned_subjects_listThat's all! Now, we can open csv file with any spreadsheet software (LibreOffice, Excel, etc.)Here's what I get as results when running the script (I voluntarily modified some variable values). This value will decrease each time the subject concerned is used in the timetable. Import pathlibTime_slot_list = # get list of time slotIn your opinion, is that all? Have we defined all the necessary variables? Remember that we must ensure that each subject can not exceed 6 hours! To realize it, we will use a dictionary in which the key will be the material and value the maximum value (in hour) for each of the subjects. Timetable.pyOur script will be write in a file called timetable.py, so create a folder called school_timetable and inside it, create our file.Firstly, begin by import modules and define variables we need.

school timetable excel