-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuser_class.py
46 lines (30 loc) · 815 Bytes
/
user_class.py
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
class User:
'''
Class that generates instances of user accounts.
It will hold the username and password of an account
'''
user_list = []
def save_user(self):
'''
This method saves users into the user_list
'''
User.user_list.append(self)
def delete_user(self):
'''
This will delete saved user from user_list
'''
User.user_list.remove(self)
@classmethod
def find_user(cls, string):
'''
this method accesses credentials in credentials_list
'''
for user in cls.user_list:
if user.username == string:
return user
def __init__(self,username,password):
'''
Will define properties for this class
'''
self.username = username
self.password = password