Hello,
I don't know how to read all the data from a dictionary into a string:
Anybody knows?
Thank you.
I don't know how to read all the data from a dictionary into a string:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
""" 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) |
Thank you.