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
| from tkinter import *
fen = Tk()
def pydblite():
from pydblite.pydblite import Base
# lecture du contenu de la base
db = Base('numtel.pdl')
# champs nom, taille
if db.exists():
db.open()
# affiche que ce que l on demande
# ce code fonctionne mais je cale pour la suite, c est a dire entre le nom et prenom dans les deux entry puis avec un bouton SHOW on obtien le resultat dans le label TEL.
for rec in db(nom='martin', prenom='jacques'):
print(rec['tel'])
pydblite()
# nom de la personne que l on recherche
frame1 = Frame(fen,borderwidth=2,relief=GROOVE)
frame1.pack(side=LEFT,padx=10,pady=10)
F1 = LabelFrame(frame1, text = "NOM", labelanchor= N)
F1.pack(side=LEFT, padx =10, pady = 10)
# prenom de la personne que l on recherche
frame2 = Frame(fen,borderwidth=2,relief=GROOVE)
frame2.pack(side=LEFT,padx=10,pady=10)
F2 = LabelFrame(frame2, text = "PRENOM", labelanchor= N)
F2.pack(side=LEFT, padx =10, pady = 10)
# reponse - numero de tel correspondant au nom prenom
frame3 = Frame(fen,borderwidth=2,relief=GROOVE)
frame3.pack(side=LEFT,padx=10,pady=10)
F3 = LabelFrame(frame2, text = "TEL", labelanchor= N)
F3.pack(side=LEFT,padx =10, pady = 10)
nom_entry=Entry(frame1, bd=5).pack(side=LEFT)
prenom_entry=Entry(F2, bd=5).pack(side=LEFT)
tel_label=Label(F3, bd=5).pack(side=LEFT)
fen.mainloop() |
Partager