MCPcopy Create free account
hub / github.com/ActiveState/code / get_destination

Function get_destination

recipes/Python/456374_Crypt/recipe-456374.py:93–104  ·  view source on GitHub ↗

Gets destination file. Prompts for filename. Handles errors. Returns file.

(prompt)

Source from the content-addressed store, hash-verified

91 print
92
93def get_destination(prompt):
94 '''Gets destination file.
95
96 Prompts for filename.
97 Handles errors.
98 Returns file.'''
99 while True:
100 try:
101 key = file(raw_input(prompt + ' '), 'wb')
102 return key
103 except:
104 print 'Please enter a different filename.'
105
106def create_key_data():
107 '''Creates a key.

Callers 3

create_keyFunction · 0.85
encode_fileFunction · 0.85
decode_fileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected