Machine identification
Tim Williams
listserver at tdw.net
Wed Sep 8 14:17:26 EDT 2004
More information about the Python-list mailing list
Wed Sep 8 14:17:26 EDT 2004
- Previous message (by thread): Machine identification
- Next message (by thread): Machine identification
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, 8 Sep 2004 12:59:57 -0500, Greg Lindstrom <greg.lindstrom at novasyshealth.com> wrote: > How can I get the name (or ip) of the machine where my python script is > running? I'd like to add it to my log entry. import socket print socket.gethostname() print socket.getfqdn() this_host = socket_gethostname() print socket.gethostbyname(this_host) # the following will give several IP addresses if you are #multi-homed print socket.gethostbyname_ex(this_host)
- Previous message (by thread): Machine identification
- Next message (by thread): Machine identification
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list