import socket hostname = socket.gethostname() print(hostname)