The traditional right way (tm) to do this is to call getsockname() on the (a?) socket that's connected to the guy you want to tell your address to. This picks the right address in case you have several. If you don't have a socket handy, you can make a connectionless UDP socket and connect() it to a suitable place - this won't result in any packets on the wire. NAT breaks it of course, but then you couldn't easily be contacted from outside the NAT anyway.
-- erno -- http://mail.python.org/mailman/listinfo/python-list