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

Discussion in 'Python' started by bonono@gmail.com, Oct 24, 2005.

  1. Guest

    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, 2005
    #1
    1. Advertising

  2. Peter Hansen Guest

    Peter Hansen, Oct 24, 2005
    #2
    1. Advertising

  3. Guest

    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:
    > 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
    , Oct 24, 2005
    #3
  4. On Monday 24 October 2005 10:21, 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
    Christoph Haas, Oct 24, 2005
    #4
  5. Peter Hansen Guest

    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
    Peter Hansen, Oct 24, 2005
    #5
  6. Guest

    , Oct 24, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. BIX
    Replies:
    0
    Views:
    335
  2. Joan Maceachern
    Replies:
    0
    Views:
    371
    Joan Maceachern
    Apr 14, 2004
  3. Obuseme

    JSR 168 set the portlet state

    Obuseme, Feb 16, 2005, in forum: Java
    Replies:
    1
    Views:
    595
    JavaJava
    Feb 16, 2005
  4. Old and In the Way
    Replies:
    6
    Views:
    4,676
    Andrew Thompson
    Jul 22, 2006
  5. Matthew Moss

    [QUIZ] Statistician II (#168)

    Matthew Moss, Jul 4, 2008, in forum: Ruby
    Replies:
    4
    Views:
    142
    Matthew Moss
    Jul 6, 2008
Loading...

Share This Page