IFPass dev uploaded
This commit is contained in:
parent
cab6fb644d
commit
46e18814a4
30
IFPass.py
30
IFPass.py
@ -27,7 +27,7 @@ from termcolor import colored
|
|||||||
|
|
||||||
version = '1.0'
|
version = '1.0'
|
||||||
|
|
||||||
computer = '' # 'test', 'mediatheque' or 'accueil'
|
computer = 'test' # 'test', 'mediatheque' or 'accueil'
|
||||||
|
|
||||||
if computer == 'test':
|
if computer == 'test':
|
||||||
IFPassdir = '\\\\192.168.1.1\SSIC\\04-Projets\IFPass\\'
|
IFPassdir = '\\\\192.168.1.1\SSIC\\04-Projets\IFPass\\'
|
||||||
@ -239,6 +239,10 @@ def printcard(cartefilename):
|
|||||||
print('test')
|
print('test')
|
||||||
|
|
||||||
|
|
||||||
|
while True:
|
||||||
|
print('1 - Nouveau membre', '2 - Rechercher un membre', '3 - Quitter', sep='\n')
|
||||||
|
choix = input('Choix : ')
|
||||||
|
if choix == '1':
|
||||||
while "the informations are incorrect": # Loop Filling informations
|
while "the informations are incorrect": # Loop Filling informations
|
||||||
os.system('cls')
|
os.system('cls')
|
||||||
init()
|
init()
|
||||||
@ -281,3 +285,27 @@ while "the informations are incorrect": # Loop Filling informations
|
|||||||
bkpdb()
|
bkpdb()
|
||||||
if computer == 'mediatheque' or computer == 'accueil':
|
if computer == 'mediatheque' or computer == 'accueil':
|
||||||
printcard(cartefilename)
|
printcard(cartefilename)
|
||||||
|
|
||||||
|
elif choix == '2':
|
||||||
|
os.system('cls')
|
||||||
|
research = input('Entrez le nom, prénom, ou numéro de carte (ou flashez) : ').lower()
|
||||||
|
try:
|
||||||
|
with open(clientsfile, 'r', newline='', encoding='utf-8') as csvfile:
|
||||||
|
results = []
|
||||||
|
for line in csvfile.readlines():
|
||||||
|
resfirstname = line.split(';')[1].lower()
|
||||||
|
ressurname = line.split(';')[2].lower()
|
||||||
|
resnumber = line.split(';')[3]
|
||||||
|
if research in (ressurname or resfirstname):
|
||||||
|
results.append([resfirstname, ressurname, resnumber])
|
||||||
|
print(results)
|
||||||
|
|
||||||
|
except FileNotFoundError:
|
||||||
|
print('Le fichier client est inexistant.')
|
||||||
|
|
||||||
|
elif choix == '3':
|
||||||
|
sys.exit()
|
||||||
|
|
||||||
|
else:
|
||||||
|
os.system('cls')
|
||||||
|
print('Choix incorrect !')
|
||||||
|
Loading…
Reference in New Issue
Block a user