[Pythonmac-SIG] Subtle difference between PythonMac and command line on OS X

Pieter Claerhout pieter.claerhout@pandora.be
Fri, 5 Apr 2002 19:56:57 +0200


Hi all,

I just found out a subtle difference between the command line version of OS
X (running under terminal) and the Python Mac distribution from Jack Jansen.
Here's what happening:

Using Python Mac:
>>> import socket
>>> socket.gethostname()
'192.168.0.4'

Using command line python:
>>> import socket
>>> socket.gethostname()
'localhost'

Both versions are running on the same machine with the same os
configuration. I'm using Python 2.1, and I'm just wondering if that has an
influence.

I want to have the command line version return '192.168.0.4' as well if
possible, since I'm trying to open a socket on that. Is there a way to do
this?

Cheers,


--Pieter