hostid?
Will Stuyvesant
hwlgw at hotmail.com
Sat Oct 19 14:49:47 EDT 2002
More information about the Python-list mailing list
Sat Oct 19 14:49:47 EDT 2002
- Previous message (by thread): hostid?
- Next message (by thread): hostid?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
[Lance] > I'd like to retrieve a computer's hostid. Does anyone know how to do this? socket.gethostname() ''Return a string containing the hostname of the machine where the Python interpreter is currently executing. If you want to know the current machine's IP address, you may want to use gethostbyname(gethostname()). This operation assumes that there is a valid address-to-host mapping for the host, and the assumption does not always hold. Note: gethostname() doesn't always return the fully qualified domain name; use gethostbyaddr(gethostname()) '' >From the Reference Manual in your Python distro. Works like a charm on Windows; I have NT and XP. Linux sometimes has problems with that address-to-host mapping since linux is so hard to configure. ''' The program said "Requires Windows 9x or better", so I installed Linux. '''
- Previous message (by thread): hostid?
- Next message (by thread): hostid?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list