Re: How to get computer name
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.python archive

Re: How to get computer name

From: Richard Townsend <richard@nospam.com>
Date: Sat Apr 29 2006 - 19:47:48 CEST

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
Received on Mon May 1 00:44:29 2006