From: Prashant G. <pra...@gm...> - 2009-02-18 04:23:09
|
Hi Jython Gurus, I have a string of IP address which I need to convert into the Long Integer. The thing is in Python we have inet_aton() function, using which I can get the proper result,but the Lib of Jython I am using doesn't have that support. Is there something like this in Jython as well?. Thanks in advance Sincerely, Prashant golash |
From: Alan K. <jyt...@xh...> - 2009-02-18 10:40:06
|
[Prashant] > I have a string of IP address which I need to convert into the Long Integer. > The thing is in Python we have inet_aton() function, using which I can get > the proper result,but the Lib of Jython I am using doesn't have that > support. > Is there something like this in Jython as well?. It's in jython 2.5, but I have not yet backported it to jython 2.2, which is the version I presume you are using? Jython 2.5b1 (trunk:5903:5905, Jan 9 2009, 16:01:29) [Java HotSpot(TM) Client VM (Sun Microsystems Inc.)] on java1.5.0_17 Type "help", "copyright", "credits" or "license" for more information. >>> import socket >>> socket.inet_aton <function inet_aton at 0x1> >>> socket.inet_aton("192.169.0.1") '\xc0\xa9\x00\x01' >>> Alan. |
From: Alan K. <jyt...@xh...> - 2009-02-18 10:45:08
|
[Alan] > It's in jython 2.5, but I have not yet backported it to jython 2.2, > which is the version I presume you are using? Sorry, my mistake. I did check in support for inet_aton, etc, into the 2.2 branch http://fisheye3.atlassian.com/changelog/jython/?cs=5520 But there hasn't been a release of 2.2 since that time. So if you want the updated functionality, you'll have to get the updated version from SVN. https://jython.svn.sourceforge.net/svnroot/jython/branches/Release_2_2maint/jython/Lib/socket.py Alan. |