forked from PythonCHB/PythonCertSpring
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschedule_speakers.py
32 lines (28 loc) · 903 Bytes
/
schedule_speakers.py
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
#! /usr/bin/env python
#
# This prorgram reads in a list of students from a file, and sorts them in
# random order
#
import sys
import random
import string
import csv
date_students = {0:"Oct 16th", 3:"Oct 23rd", 6:"Oct 30th", 9:"Nov 6th", \
12:"Nov 13th", 16:"Nov 20th", 20:"Nov 27th", 24:"Dec 4th",
28:"Dec 11th" }
filename = "Student_list.csv"
f = open(filename,"r")
raw_student_list = csv.reader(f, delimiter='\t', quotechar='"')
student_list = []
for a_line in raw_student_list:
# Column 0 is the student last name, Column 1 is the student first name
# student's name (last name first)
student_list.append( string.strip( a_line[0]+" "+a_line[1] ) )
random.shuffle( student_list, )
counter = 0
for n in student_list :
if counter in date_students.keys() :
print "----", date_students[counter]
counter += 1
print counter, n
print "----"