Mar-29-2022, 07:39 PM
Hello,
I don't know how to read all the data from a dictionary into a string:
Thank you.
I don't know how to read all the data from a dictionary into a string:
""" ipconfig: [{'addr': '192.168.188.213', 'netmask': '255.255.255.0', 'broadcast': '192.168.188.255'}] [{'addr': '192.168.0.12', 'netmask': '255.255.255.0', 'broadcast': '192.168.0.255'}] [{'addr': '127.0.0.1', 'netmask': '255.0.0.0', 'broadcast': '127.255.255.255'}] """ from tkinter import Tk from tkinter import messagebox import netifaces Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing output = "" for interface in netifaces.interfaces(): addrs = netifaces.ifaddresses(interface) if netifaces.AF_INET in addrs.keys(): #print(addrs[netifaces.AF_INET]) output += addrs(???) messagebox.showinfo("Done", output)Anybody knows?
Thank you.