|
|
|
@ -5,15 +5,18 @@ import tkinter as tk |
|
|
|
def recup(): |
|
|
|
message = value.get() |
|
|
|
label.configure(text=message) |
|
|
|
|
|
|
|
def reseau(adr,msq): |
|
|
|
lstIP = strIP.split(".") |
|
|
|
lstMasque = strmsq.split(".") |
|
|
|
lstIP = adr.split(".") |
|
|
|
lstMasque = msq.split(".") |
|
|
|
lstreseau = [' ']*4 |
|
|
|
for i in range(4): |
|
|
|
lstReseau[i] =str(lstIP[i])&int(lstMasque[i]) |
|
|
|
|
|
|
|
def affiche_res(): |
|
|
|
value = ".".join(lstReseau) |
|
|
|
return ".".join(lstReseau) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Creation de la fenetre |
|
|
|
fenetre =tk.Tk() |
|
|
|
fenetre.title("Calcul d'IP") |
|
|
|
@ -22,9 +25,7 @@ canvas.grid() |
|
|
|
label =tk.Label(fenetre, text="Calcul de l'adresse réseau") |
|
|
|
label.grid() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#Entrées et bouton valider |
|
|
|
value = tk.StringVar() |
|
|
|
value.set("Entrez votre adresse") |
|
|
|
adr=tk.Entry(fenetre, textvariable=value, width=20) |
|
|
|
@ -40,14 +41,4 @@ bouton.grid() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fenetre.mainloop() |