-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
51 lines (43 loc) · 1.23 KB
/
Copy pathmain.py
File metadata and controls
51 lines (43 loc) · 1.23 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
import os
from user import User
from expense_tracker import ExpenseTracker
def clear_screen():
# For Windows
if os.name == 'nt':
_ = os.system('cls')
# For Unix/Linux/MacOS
else:
_ = os.system('clear')
# Activates a user session for the given username.
def active_user(username):
expense_tracker = ExpenseTracker(username)
while True:
if expense_tracker.run(True):
break
clear_screen()
while True:
user = User()
command = user.user_checker()
if command == 1:
if user.find_user():
active_user(user.username)
clear_screen()
print(f"You have log out from user account {user.username}!\n")
input("Press to continue...")
clear_screen()
elif command == 'exit':
break
elif command == 3:
result = user.delete_account()
clear_screen()
if result:
print("User account has been deleted\n")
input("Press to continue...")
clear_screen()
else:
result = user.create_new_user()
clear_screen()
if result:
print("New user has been created\n")
input("Press to continue...")
clear_screen()