Browse Source

ajout de mon prjojet perso

master
trystan.deneuve 7 months ago
parent
commit
5eeb4fb091
  1. 22
      IP_claculateur.py

22
IP_claculateur.py

@ -1,4 +1,12 @@
from tkinter import* from tkinter import *
def adresse_reseau():
ip_address = IP_entree.get()
mask_mask = Mask_entree.get()
# Calculate the network address by performing an AND operation between the IP address and subnet mask
Adresse_reseau = '.'.join(str(int(ip_part) & int(mask_part)) for ip_part, mask_part in zip(ip_address.split('.'), mask_mask.split('.')))
# Display the network address
network_label.config(text='Network Address: ' + Adresse_reseau)
fenetre= Tk() #créé la fenetre principale fenetre= Tk() #créé la fenetre principale
@ -16,14 +24,4 @@ bouton=Button(fenetre, text="calculer", command = adresse_reseau)
bouton.grid(row=4, column=1) bouton.grid(row=4, column=1)
network_label = Label(fenetre, text="") network_label = Label(fenetre, text="")
network_label.grid(row=5, column=1) network_label.grid(row=5, column=0)
def adresse_reseau():
IP_Label = IP_Label.get()
Mask_Label = Mask_Label.get()
# Calculate the network address by performing an AND operation between the IP address and subnet mask
Adresse_reseau = '.'.join(str(int(ip_part) & int(mask_part)) for ip_part, mask_part in zip(ip_address.split('.'), mask_mask.split('.')))
# Display the network address
network_label.config(text='Network Address: ' + Adresse_reseau)
Loading…
Cancel
Save