By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,957 Members | 2,038 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,957 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
5 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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.