Ejemplo n.º 1
0
heslo = input("Vlož svoje heslo: ")
edu = Edupage(dom, meno, heslo)

try:
    call("clear")
    edu.login()
    print("Úspešne prihlásený ako ", meno, "na doméne", dom)
    print("1. Zobraziť list učiteľov (nefunkcne)")
    print("2. Zobraziť list spolužiakov")
    print("3. Úlohy")
    print("4. Rozvrh")
    vyber = int(input("Vitaj! Čo chceš robiť? "))

    if vyber == 1:
        call("clear")
        uc = edu.get_teachers()

        for teacher in uc:
            print("________________________________")
            print(str(teacher))
            print("________________________________")

    elif vyber == 2:
        call("clear")
        ziaci = edu.get_students()
        ziaci.sort(key=EduStudent.__sort__)

        for ziaci in ziaci:
            print("________________________________")
            print(f"{ziaci.number_in_class}: {ziaci.fullname}")
Ejemplo n.º 2
0
from edupage_api import Edupage
from edupage_api.people import EduTeacher

edupage = Edupage()
edupage.login_auto("Username (or e-mail)", "Password")

teachers = edupage.get_teachers()

def print_teacher_info(teacher: EduTeacher):
    print(f"{teacher.name} is in your school since {teacher.in_school_since}")

oldest_teacher = teachers[0]
for teacher in teachers:
    if not teacher.in_school_since:
        continue


    if teacher.in_school_since < oldest_teacher.in_school_since:
        oldest_teacher = teacher

print("The oldest teacher (the longest time in your school):")
print_teacher_info(oldest_teacher)

yonguest_teacher = teachers[0]
for teacher in teachers:
    if not teacher.in_school_since:
        continue

    if teacher.in_school_since > yonguest_teacher.in_school_since:
        yonguest_teacher = teacher