-
Notifications
You must be signed in to change notification settings - Fork 0
/
txt.py
31 lines (28 loc) · 788 Bytes
/
txt.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
def saveCadast(name, email,password):
data = [name, email, password]
with open('db.txt', 'a') as f:
for info in data:
f.write(info)
f.write(',')
def saveResult(result):
with open('db.txt', 'a') as f:
f.write(result)
f.write(',')
f.write('\n')
def validateCredentials(email,senha):
f = open("db.txt", "r")
lines = f.readlines()
for line in lines:
elem= line.split(',')
if elem[1] == email:
if elem[2] == senha: return True
else: return False
return False
def searchResult(email):
f = open("db.txt", "r")
lines = f.readlines()
for line in lines:
elem= line.split(',')
if elem[1] == email:
return elem[3]
return None