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 42 43 44 45 46 47 48 49
| import tkinter as tk
fenetre = Tk()
fenetre.title("Calcul de réflectivité")
bou2 = Button(fenetre, text='OK',command = test)
bou2.grid(row=4, column=2,sticky=EW, padx=5, pady=5)
couche=Entry(textvariable=ncouche,width=5,bg ='bisque', fg='maroon')
couche.grid(row=4, column=1,sticky=W, padx=5, pady=5)
Label3 = Label(fenetre, text = "couche(s) ")
Label3.grid(row=4, column=0,sticky=E, padx=5, pady=5)
def test():
truc = float(couche.get())+1
machin = round(truc)
for i in range(1,machin):
bat=i+5
# Création du texte 'épaisseur'
epaisseur=Entry(textvariable="",width=5,bg ='bisque', fg='maroon')
epaisseur.grid(row=bat, column=1,sticky=W, padx=5, pady=5)
Label3 = Label(fenetre, text = "materiau n°" +str(i)+ "[nm]")
Label3.grid(row=bat, column=0,sticky=E, padx=5, pady=5)
# Création du texte 'indice'
indice=Entry(textvariable="",width=5,bg ='bisque', fg='maroon')
indice.grid(row=bat, column=3,sticky=W, padx=5, pady=5)
Label4 = Label(fenetre, text = "indice n°" +str(i))
Label4.grid(row=bat, column=2,sticky=E, padx=5, pady=5)
# Création du texte 'coeff extinction'
imagi=Entry(textvariable="",width=5,bg ='bisque', fg='maroon')
imagi.grid(row=bat, column=5,sticky=W, padx=5, pady=5)
Label5 = Label(fenetre, text = "extinction n°" +str(i))
Label5.grid(row=bat, column=4,sticky=E, padx=5, pady=5)
fenetre.mainloop() |
Partager