Friday, 8 December 2023

print how many interface instance has

 import psutil


# Get the network interfaces on the instance

interfaces = psutil.net_if_addrs()


# Print the names of all network interfaces

print("Network interfaces:")

for interface in interfaces:

    print(interface)


No comments:

Post a Comment