Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Nauczyciel:
- nauczyciele = []
- def __init__(self, imie):
- self.imie = imie
- self.klasy = []
- with open('.txt/szkola.txt', 'r') as plik:
- wiersz = plik.readline().strip()
- while True:
- if wiersz == "nauczyciel":
- instancja = Nauczyciel(plik.readline().strip())
- Nauczyciel.nauczyciele.append(instancja)
- wiersz = plik.readline().strip()
- while len(wiersz) == 2:
- instancja.klasy.append(wiersz)
- wiersz = plik.readline().strip()
- else:
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement