[steven@txzxp2 test]$ python
Python 2.7.5 (default, Jul 8 2013, 09:48:59)
[GCC 4.8.1 20130603 (Red Hat 4.8.1-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> import struct
>>> socket.ntohl(struct.unpack("I",socket.inet_aton('192.168.2.123'))[0])
3232236155L
>>> socket.inet_ntoa(struct.pack('I',socket.htonl(3232236155)))
'192.168.2.123'
>>>