-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions.py
More file actions
71 lines (61 loc) · 2.03 KB
/
functions.py
File metadata and controls
71 lines (61 loc) · 2.03 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import readline,os,os.path,pyfiglet,stdiomask,datetime,platform,sys,readchar
osName = platform.system()
companyHeader = open('header','r+')
header = companyHeader.read()
passwordFile = open('db','r+')
secretPassword = passwordFile.read()
def clear():
if osName == 'Windows':
os.system('cls')
elif osName == 'Linux':
os.system('clear')
elif osName == 'Darwin':
os.system('clear')
def terminate():
sys.exit()
def createAdmin():
mystring = input('Please set a password: ')
hash_object = hashlib.sha512(mystring.encode())
hex_dig = hash_object.hexdigest()
passwordFile.write(hex_dig)
os.system('clear')
print('Your password has been set!')
time.sleep(1)
os.system('clear')
print(header + startPhrase)
def headerGenerator():
if header == '':
os.system('clear')
print('Type the name of your company below. \n')
companyName = input('Company Name> ')
print('Is "' + companyName + '" the correct spelling of your company? \ny/n >')
isCorrect = readchar.readchar()
if isCorrect == 'y':
companyBanner = pyfiglet.figlet_format(companyName)
companyHeader.write(companyBanner)
print(header)
elif isCorrect == 'n':
headerGenerator()
else:
print('"' + isCorrect + '" is not a valid response. Please type Y or N.')
# else:
def addEmployee():
os.system('clear')
fName = input('Employee first name > ')
mName = input('Employee middle name > ')
lName = input('Employee last name > ')
birthday = input('Employee birthday (YYYY-MM-DD) > ')
year, month, day = map(int, birthday.split('-'))
formattedBirthday = datetime.date(year, month, day)
def social():
social = stdiomask.getpass(prompt = 'Employee social security number (XXX-XX-XXXX) > ')
confirmedSocial = stdiomask.getpass(prompt = "Confirm SSN > ")
if confirmedSocial == social:
pin = stdiomask.getpass(prompt = 'Employee PIN number > ')
lName = input('Employee last name > ')
lName = input('Employee last name > ')
lName = input('Employee last name > ')
lName = input('Employee last name > ')
else:
print("SSN's did not match. Please try again.")
social()