How to get computer name

Richard Townsend richard at nospam.com
Sat Apr 29 13:47:48 EDT 2006


On 29 Apr 2006 10:04:39 -0700, pitarda wrote:

> Thanks! :)
> 
> Though,... I think once I saw something like: getComputerByName but
> can't find it anymore,...
> 
> :)

>>> import socket
>>> print socket.gethostname()
blade
>>> print socket.gethostbyname('blade') # will print IP address


-- 
Richard



More information about the Python-list mailing list