This commit is contained in:
phowell 2024-08-27 11:17:34 -07:00
parent 14a25827a0
commit c9cc3cffcd
1 changed files with 31 additions and 9 deletions

View File

@ -74,15 +74,18 @@ locations, teachers, days = parse_courses('cache/sample_semester.json')
#print(json.dumps(teachers,indent=2)) #print(json.dumps(teachers,indent=2))
#print(json.dumps(days,indent=2)) #print(json.dumps(days,indent=2))
for L,C in locations.items(): dump = 0
print(f"\n{L}")
for crs in C: if dump:
print(" " + course_to_string(crs)) for L,C in locations.items():
print(f"\n{L}")
for crs in C:
print(" " + course_to_string(crs))
for T,C in teachers.items(): for T,C in teachers.items():
print(f"\n{T}") print(f"\n{T}")
for crs in C: for crs in C:
print(" " + course_to_string(crs)) print(" " + course_to_string(crs))
# EXAMPLES # EXAMPLES
# #
@ -100,4 +103,23 @@ for course in locations[room]:
teacher = 'Kimberly J Smith' teacher = 'Kimberly J Smith'
print(f"\nWeekly schedule for {teacher}:") print(f"\nWeekly schedule for {teacher}:")
for course in teachers[teacher]: for course in teachers[teacher]:
print(" " + course_to_string(course)) print(" " + course_to_string(course))
import sys
import os
columns, rows = os.get_terminal_size()
print(f"Terminal size: {columns} columns x {rows} rows")
def write_at(row, col, text):
sys.stdout.write(f"\033[{row};{col}H{text}")
sys.stdout.flush()
#
lines = [1,2,3,4,5]
for L in lines:
myline = rows - L
write_at(myline, 1, f"This is line {myline}")
write_at(rows,0,'')