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

Function main

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

Executes program. Shows welcome and menu. Gets selection. Executes correct part of the program.

()

Source from the content-addressed store, hash-verified

3from time import time # for randomizing keys
4
5def main():
6 '''Executes program.
7
8 Shows welcome and menu.
9 Gets selection.
10 Executes correct part of the program.'''
11 show_heading('Welcome to CRYPT')
12 print
13 exit = False
14 while not exit:
15 answer = menu()
16 if answer is 1:
17 create_key()
18 elif answer is 2:
19 encode_file()
20 elif answer is 3:
21 decode_file()
22 elif answer is 4:
23 exit = True
24 else:
25 raise bug
26
27def show_heading(heading):
28 '''Displays headings.

Callers 1

recipe-456374.pyFile · 0.70

Calls 5

show_headingFunction · 0.85
create_keyFunction · 0.85
menuFunction · 0.70
encode_fileFunction · 0.70
decode_fileFunction · 0.70

Tested by

no test coverage detected