import datetime;
print("Today Date & Time:\n");
print(datetime.datetime.today());
Solve Problems by Coding Solutions - A Complete solution for python programming
Python program to print Hostname, IP, MAC address
import uuid
import socket
hostname = socket.gethostname()
IPAddr = socket.gethostbyname(hostname)
print("The Name of this device is: " + hostname)
print("The IP Address of this device is: " + IPAddr)
print ("The MAC address of this device is:",hex(uuid.getnode()))
import socket
hostname = socket.gethostname()
IPAddr = socket.gethostbyname(hostname)
print("The Name of this device is: " + hostname)
print("The IP Address of this device is: " + IPAddr)
print ("The MAC address of this device is:",hex(uuid.getnode()))
Subscribe to:
Posts (Atom)