How to get the hostname?

Alan Kennedy alanmk at hotmail.com
Thu Jun 5 05:22:54 EDT 2003


Thomas Güttler wrote:

> Is there a way to get the hostname with python?

import socket

hostname = socket.gethostname()

HTH,

-- 
alan kennedy
-----------------------------------------------------
check http headers here: http://xhaus.com/headers
email alan:              http://xhaus.com/mailto/alan




More information about the Python-list mailing list