'''
Created on Sep 26, 2011

@author: rodger
'''
# must include these imports to use the file chooser
import os
import tkFileDialog

    
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 joinTogether(mylist, separator):
    # TODO: convert the list mylist into a string of items from 
    #        mylist separated by separator
    
    
    
    
    
    
    return "replace me"

def processLine(line):
    words = line.split()   # put the words into a list
    # TODO: Given a string of words, create a new string from those
    # words keeping only the words whose length is greater than 4
    





    


    return "replace me"

def processFile(file):
    '''
    process the lines in a file
    in this case we just print them
    '''
    for line in file:
        print processLine(line)
        
processFile(choose_file_to_open())        
