-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAuth.py
121 lines (70 loc) · 1.91 KB
/
Auth.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/usr/bin/env python
# coding: utf-8
# In[10]:
import time
def generate_id():
"generate random id "
id= time.time()
# print(round(id))
return round(id)
# In[11]:
def f_name(message):
while True:
fname=input(message)
if fname.isalpha():
return fname
print("----- please enter valid name -----")
# In[12]:
def l_name(message):
while True:
lname=input(message)
if lname.isalpha():
return lname
print("----- please enter valid name -----")
# In[13]:
import re
# In[14]:
import re
def u_email(message):
while True:
email=input(message)
email_pattern = r"^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\.[a-zA-Z0-9-.]+$"
if re.match(email_pattern,email):
return email
print("----- please enter valid email -----")
# In[15]:
def u_password(message):
while True:
password=input(message)
if password.isdigit():
password=int(password)
return password
print("----- please enter password again -----")
# In[16]:
def u_cpassword(message):
while True:
con_pass=input(message)
if con_pass.isdigit():
con_pass=int(con_pass)
return con_pass
print("----- please enter password again -----")
# In[17]:
def u_phone(message):
while True:
phone=input(message)
if phone.isdigit() and len(phone)==11:
phone=int(phone)
return phone
print("----- please enter vaild phone -----")
# In[18]:
def askforid(message):
while True:
try:
id = int(input(message))
except Exception as e:
print("---- please enter an integer: ")
else:
return id
# In[ ]:
# In[ ]:
# In[ ]: