-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (50 loc) · 1.4 KB
/
main.py
File metadata and controls
56 lines (50 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# main.py
# William Ponton
# 1.24.19
# Main file for the py_pass_gen project
# Constants
DIV_LINE = ("=" * 45)
# Import modules
import py_pass_gen.console_output as co
import py_pass_gen.file_operations as fo
import py_pass_gen.password_list as pl
# Main Function
def main():
# Locals
engage = 1
title = ""
passmax = 0
password = ""
passwordList = []
passFile = "myPasswords.txt"
passFile = open(passFile, "w")
# Console Output
co.welcome_message()
fo.file_welcome_message(passFile)
while engage == 1:
co.clear_locals(engage, title, passmax, password, passwordList)
# User input
print("\n" + DIV_LINE)
title = input("\nPassword Title: ")
passmax = int(input("Password MAX Characters: "))
# Password List Creation
pl.passList(passwordList)
# Password Creation
password = pl.create_password(passmax, password, passwordList)
# Password Console Output
co.password_output(title, password)
# Password File Output
fo.file_write_password(passFile, title, password)
# Repeat or Exit
engage = co.try_again(engage)
# Exit path
else:
if(engage != 1):
# Exit Greeting
co.exit_message()
# Close mypasswords.txt
passFile.close()
return 0
# Control Initiating Event
if __name__ == "__main__":
main()