468,301 Members | 1,488 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,301 developers. It's quick & easy.

testing '192.168.1.4' is in '192.168.1.0/24' ?

Hi,

Is there standard library modules handling this ? currently I need to
turn it into a long integer and do the shift and compare.

Oct 24 '05 #1
5 2119
bo****@gmail.com 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/Coo.../Recipe/440560

-Peter
Oct 24 '05 #2
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:
bo****@gmail.com 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/Coo.../Recipe/440560

-Peter


Oct 24 '05 #3
On Monday 24 October 2005 10:21, bo****@gmail.com 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

Oct 24 '05 #4
bo****@gmail.com 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
Oct 24 '05 #5
gry
There was just recently announced -- iplib-0.9:
http://groups.google.com/group/comp....53921d1545bf69

It appears to be pure python and has facilities for dealing with
netmasks. (v4 only).

-- George

Oct 24 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Brian | last post: by
2 posts views Thread by Jeremy S. | last post: by
17 posts views Thread by clintonG | last post: by
2 posts views Thread by Raul Rodriguez | last post: by
4 posts views Thread by Robert Bravery | last post: by
reply views Thread by bparkis | last post: by
reply views Thread by NPC403 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.