how to get hostname in python

import socket
host = socket.gethostname()
print host

Tags:

Leave a Reply