My problem is as follows: I'm trying to set up a set of python programs over a network of computers, which will communicate through UDP sockets (I chose UDP because QoS is not a priority, and I wish to limit the overhead). Now, I want the programs to determine their own IP address (the address of the machine they're running on), instead of filling it in myself.
However, when I do this:
ip = socket.gethostbyname( socket.gethostname() )
the variable ip is filled with 127.0.0.1 (localhost). Is there another way to get the IP address of the machine, the way it is used in the network? Thanks in advance.