schedule
This commit is contained in:
parent
14a25827a0
commit
c9cc3cffcd
38
schedule.py
38
schedule.py
|
|
@ -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:
|
|
||||||
print(" " + course_to_string(crs))
|
|
||||||
|
|
||||||
for T,C in teachers.items():
|
if dump:
|
||||||
print(f"\n{T}")
|
for L,C in locations.items():
|
||||||
for crs in C:
|
print(f"\n{L}")
|
||||||
print(" " + course_to_string(crs))
|
for crs in C:
|
||||||
|
print(" " + course_to_string(crs))
|
||||||
|
|
||||||
|
for T,C in teachers.items():
|
||||||
|
print(f"\n{T}")
|
||||||
|
for crs in C:
|
||||||
|
print(" " + course_to_string(crs))
|
||||||
|
|
||||||
# EXAMPLES
|
# EXAMPLES
|
||||||
#
|
#
|
||||||
|
|
@ -101,3 +104,22 @@ 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,'')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue