Executes program. Shows welcome and menu. Gets selection. Executes correct part of the program.
()
| 3 | from time import time # for randomizing keys |
| 4 | |
| 5 | def 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 | |
| 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 | |
| 27 | def show_heading(heading): |
| 28 | '''Displays headings. |
no test coverage detected