Re: testing '192.168.1.4' is in '192.168.1.0/24' ?
[EMAIL PROTECTED] wrote: Is there standard library modules handling this ? currently I need to turn it into a long integer and do the shift and compare. A little Googling turned up this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440560 -Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: testing '192.168.1.4' is in '192.168.1.0/24' ?
thanks, that is basically what I am doing and since it is a recipe, I would assume there is no standard library module for it. Peter Hansen wrote: [EMAIL PROTECTED] wrote: Is there standard library modules handling this ? currently I need to turn it into a long integer and do the shift and compare. A little Googling turned up this: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/440560 -Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: testing '192.168.1.4' is in '192.168.1.0/24' ?
On Monday 24 October 2005 10:21, [EMAIL PROTECTED] wrote: thanks, that is basically what I am doing and since it is a recipe, I would assume there is no standard library module for it. Well, http://py.vaults.ca/~x/parnassus/apyllo.py/126307487 lists a few. I had used IPy in the past. But somehow nothing so far was a decent substitute for Perl's Net::IP. Christoph -- ~ ~ .signature [Modified] 1 line --100%--1,48 All -- http://mail.python.org/mailman/listinfo/python-list
Re: testing '192.168.1.4' is in '192.168.1.0/24' ?
[EMAIL PROTECTED] wrote: thanks, that is basically what I am doing and since it is a recipe, I would assume there is no standard library module for it. Well, since a Google search for site:docs.python.org subnet turns up nothing, one would assume not, but it would be hard to prove it without an exhaustive review of the source code. ;-) -Peter -- http://mail.python.org/mailman/listinfo/python-list
Re: testing '192.168.1.4' is in '192.168.1.0/24' ?
There was just recently announced -- iplib-0.9: http://groups.google.com/group/comp.lang.python.announce/browse_frm/thread/e289a42714213fb1/ec53921d1545bf69#ec53921d1545bf69 It appears to be pure python and has facilities for dealing with netmasks. (v4 only). -- George -- http://mail.python.org/mailman/listinfo/python-list