forked from UWPCE-PythonCert/IntroToPython-2014
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschedule.py
More file actions
40 lines (26 loc) · 737 Bytes
/
schedule.py
File metadata and controls
40 lines (26 loc) · 737 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Schedule students for lightning talks, fall 2014
"""
import random
students = open('students.txt').readlines()
# remove the header line
del students[0]
# clean it up a bit:
# remove the languages, colon, etc.
students = [line.split(":")[0] for line in students]
# reverse the first, last names
# separate them:
students = [line.split(",") for line in students]
# put them back together
students = [first + last for last, first in students]
random.shuffle(students)
weeks = range(2,11)
weeks4 = weeks*4
schedule = zip(weeks4, students)
schedule.sort()
outfile = open('schedule.txt', 'w')
for week, student in schedule:
line = 'week %s: %s\n' % (week, student)
print line,
outfile.write(line)
outfile.close()