26 lines
814 B
Python
26 lines
814 B
Python
import random
|
|
|
|
|
|
def duty_roster_write():
|
|
with open('dienstplan.txt', 'w', encoding='utf8') as d:
|
|
employees = ['M. Gustave', 'Zero Mustafa', 'M. Jean', 'Agatha', 'M. Chuck']
|
|
job = ['Concierge', 'Lobby-Boy', 'Rezeptionist', 'Portier']
|
|
i = 1
|
|
while i < 53:
|
|
random.shuffle(employees)
|
|
random.shuffle(job)
|
|
a = "KW" + str(i)
|
|
d.write(a + "#" + employees[0] + ": " + job[0] + "#" + employees[1]\
|
|
+ ": " + job[1] + "#" + employees[2] + ": " + job[2] + "#" + employees[3] + ": " \
|
|
+ job[3] + "#" + "frei: " + employees[4] + "\n")
|
|
i += 1
|
|
|
|
def duty_roster_read():
|
|
with open('dienstplan.txt', 'r', encoding='utf8') as d:
|
|
for line in d:
|
|
print(line)
|
|
|
|
|
|
duty_roster_write()
|
|
duty_roster_read()
|