How to get the hostname?

Andrew Bennetts andrew-pythonlist at puzzling.org
Thu Jun 5 11:22:36 CEST 2003


On Thu, Jun 05, 2003 at 11:12:36AM +0200, Thomas G?ttler wrote:
> Hi!
> 
> Is there a way to get the hostname with python?

import socket
hostname = socket.gethostname()

-Andrew.






More information about the Python-list mailing list