-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHUTASKMANAGER.py
More file actions
59 lines (52 loc) · 1.45 KB
/
HUTASKMANAGER.py
File metadata and controls
59 lines (52 loc) · 1.45 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
import os
accepted = False
def accept():
global accepted
accepted = True
def login(name,password):
success = False
file = open("user_credentials.txt","r")
for i in file:
a,b = i.split(",")
b = b.strip()
if(a==name and b==password):
success = True
break
file.close()
if(success):
print("Login Successful")
accept()
else:
print("wrong user name or password")
def register(name,password):
file = open("user_credentials.txt","a")
file.write("\n"+name+","+password)
accept()
def access(option):
global name
if(option=="login"):
name = input("Enter name: ")
password = input("Enter password: ")
login(name,password)
else:
print("Enter your name and password to register")
name = input("Enter name: ")
password = input("Enter password: ")
register(name,password)
def begin():
global option
print("Welcome to HU Task Manager")
option = input("Login or Register (Login,Reg): ")
if(option!="login" and option!="register"):
begin()
begin()
access(option)
if(accepted):
print("Welcome to HU Task Manager")
print("### USER CREDENTIALS ###")
print("Username: ",name)
print("Would you like to open HU Task Manager?")
option = input("(Enter yes or no): ")
if(option=="yes"):
os.system("python mwphase5.py")
print("Skiid")