'''
Created on Oct 5, 2011

@author: rodger
'''
import os
import tkFileDialog
import random

    
def choose_file_to_open():
    """
    prompt for existing file, return the file (open for reading)
    """
    file = tkFileDialog.askopenfile(title="choose a file", initialdir=os.getcwd())
    return file

def processFile(file):
    '''
    process the lines in a file
    in this case we just print them
    '''
    return 
    
def randomize(students):
    '''
    Given a list of names, shuffle the names 
    '''








    

def printGroups(students):
    count = 1
    print "Group 1:"
    for stud in students:
        print stud
        if count % 3 == 0:
            print 
            print "Group " + str(count/3 + 1)  + ":"
        count += 1
    
students = processFile(choose_file_to_open()) 
print students
randomize(students)       
print students
printGroups(students)
