Re: how to convert ip address to dot notation
Ruslan Spivak wrote:
> Hello, python users!
> I have ip addresses in my mysql db in int value - 3232261127, for example.
> How can i convert that to usual dot notation like 192.168.100.7?
> Thanks in advance.
> Your help is very appreciated.
If there's nothing in the standard library, something like
l = [str((ip >> 8*n) % 256) for n in range(4)]
Or you could just use PostgreSQL where you you have a datatype for IP
|All times are GMT. The time now is 08:53 AM.|
Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.