inet_ntoa
Scott Barron
kain at abalonesoft.com
Wed Mar 1 13:10:24 EST 2000
Hi,
Someone from this group posted this when I asked this question:
def getip(long):
return string.join(map(str,unpack('4B',pack('<L',string.atol(long)))),'.')
Give that a shot.
Scott
>On Fri, 18 Feb 2000, JB wrote:
>
>> Does anyone know if the inet_ntoa function in "arpa/inet.h" is
>> implemented in python anywhere. I can't find it in the docs. Or, is
>> there a similar func in python to convert integral network addresses
>> into a dotted quad string??
>
>Try the struct module.
>--
>Moshe Zadka <mzadka at geocities.com>.
>INTERNET: Learn what you know.
>Share what you don't.
>
>
More information about the Python-list
mailing list