Merci Julien , en fait tu as raison , ok , j'ai un petit code Tkinter , il y a 3 champs de Entry bon , voila mon code :#! /usr/bin/python
#-*- coding:Utf-8-*-
from Tkinter import *
import ttk
def center(window):
sw = window.winfo_screenwidth()
sh = window.winfo_screenheight()
rw = window.winfo_reqwidth()
rh = window.winfo_reqheight()
xc = (sw - rw) / 2
yc = (sh -rh) / 2
window.geometry("+%d+%d" % (xc, yc))
window.deiconify()
#def affiche() :
#def insere() :
#def modif() :
fenetre=Tk()
fenetre.geometry("500x400")
fenetre.title(' Test Data')
firstnamevar = StringVar()
lastnamevar = StringVar()
Phonevar = IntVar()
f1 = Frame(fenetre, bg="#290080", width=500, height=500)
f1.pack( fill=X, expand=0)
lab1 = Label(fenetre, text="Voila la table firstdata de la base ismail" , bg = "#290080", fg = "white" )
lab1.place ( x=100 , y=15 )
lab1 = Label(fenetre, text="Prénom" , bg = "#290080", fg = "white" )
lab1.place ( x=30 , y=100 )
lab1 = Label(fenetre, text="Nom" , bg = "#290080", fg = "white" )
lab1.place ( x=30 , y=125)
lab1 = Label(fenetre, text="Phone" , bg = "#290080", fg = "white" )
lab1.place ( x=30 , y=150)
firstname_entry = ttk.Entry(fenetre, width=15, textvariable=firstnamevar)
firstname_entry.place (x 100 , y 100 )
lastname_entry = ttk.Entry(fenetre, width=15, textvariable=lastnamevar)
lastname_entry.place (x 100 , y 125 )
Phone_entry = ttk.Entry(fenetre, width=15, textvariable=Phonevar)
Phone_entry.place (x 100 , y 150 )
Phonevar.set("")
tv = ttk.Treeview(fenetre, show='headings', height =3)
tv["columns"]=("col1","col2","col3")
tv.column("col1",width=100,anchor="center", stretch = True, minwidth = 50)
tv.column("col2",width=100,anchor="center")
tv.column("col3",width=110,anchor="center")
tv.heading("col1",text="Prénom")
tv.heading("col2",text="Nom")
tv.heading("col3",text="Phone number")
tv.place( x 100 , y 250 )
afficher Button(fenetre, text "Afficher" ) #, command = affiche)
afficher.place( x=315, y=80 )
inserer Button(fenetre, text "Inserer" ) #, command = insere)
inserer.place( x=315, y=110 )
modifier Button(fenetre, text "Modifier" ) #, command = modif)
modifier.place( x=315, y=140 )
fenetre.after(0,center,fenetre)
fenetre.mainloop()
Alors , j'aimerais bien savoir au debut koi mettre dans la fonction affiche() pour afficher les données qui sont un seul table où il y a 3 enregistrements dans la treeveiw , le nom de la base est testbase , la table est testtable , la base est bien sur phpMyAdmin . merci bien