def get_destination(prompt):
    '''Gets destination file.

    Prompts for filename.
    Handles errors.
    Returns file.'''
    while True:
        try:
            key = file(raw_input(prompt + ' '), 'wb')
            return key
        except:
            print 'Please enter a different filename.'
Gets destination file.

    Prompts for filename.
    Handles errors.
    Returns file.
recipes/Python/456374_Crypt/recipe-456374.py