def save_users(users, filename='output.csv'):
    "Save users out to a .csv file\n\n    Each row will represent a user UID, following by all the user's students\n    (if the user has any)\n\n    INPUT:\n        > users: set of User objects\n        > filename: filename to save .csv to."
    with open(filename, 'w') as file:
        for (count, user) in enumerate(users):
            file.write(str(user.get_uid()))
            for student in user.get_students():
                file.write((',' + str(student.get_uid())))
            file.write('\n')
            if ((count % 100) == 0):
                file.flush()
    return
Save users out to a .csv file

Each row will represent a user UID, following by all the user's students
(if the user has any)

INPUT:
    > users: set of User objects
    > filename: filename to save .csv to.
def save_users(users, filename='output.csv'):
    "Save users out to a .csv file\n\n    Each row will represent a user UID, following by all the user's students\n    (if the user has any)\n\n    INPUT:\n        > users: set of User objects\n        > filename: filename to save .csv to."
    with open(filename, 'w') as file:
        for (count, user) in enumerate(users):
            file.write(str(user.get_uid()))
            for student in user.get_students():
                file.write((',' + str(student.get_uid())))
            file.write('\n')
            if ((count % 100) == 0):
                file.flush()
    return