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
| # -*- coding: utf-8 -*-
from tkinter import *
def actualiser():
pre=str(prenom.get())
prenom.set(prenom)
ma=str(mail.get())
mail.set(mail)
"""création de la fenetre"""
root=Tk()
nom=StringVar()
prenom=StringVar()
mail=StringVar()
text=Entry(root,text="",textvariable=nom).pack(side='left',padx=2,pady=2)
but1=Button(root,text='chercher',command=actualiser).pack(side='top')
Lab=Label(root,text="",textvariable=prenom,fg='red',bg='white').pack(side='right',padx=5,pady=5)
Lab2=Label(root,text="",textvariable=mail,fg='blue',bg='yellow').pack(side='right',padx=5,pady=5)
root.mainloop()
import csv
"""la recherche des données """
with open('attendees2.csv','r') as f:
csv_f = csv.reader(f)
# name=input("tapper nom:\n")
for row in csv_f:
for field in row:
if field==nom:
nom=row[0]
prenom=row[1]
mail=row[2]
# print(nom) |
Partager