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
--
Rich
Thanks! :)
Though,... I think once I saw something like: getComputerByName but
can't find it anymore,...
:)
--
http://mail.python.org/mailman/listinfo/python-list
"pitarda" <[EMAIL PROTECTED]> writes:
> How do I get the computer name in python?
You can use the os module to get it from your environment.
>>> import os
>>> os.getenv('HOSTNAME')
'calvin.watterson'
Depending on your operating system, the environment variable you need
might have a differ
How do I get the computer name in python?
I've been looking over the internet, and couldn't find anything.
Thanks!
Bud
--
http://mail.python.org/mailman/listinfo/python-list