ActiveState Code

Recipe 66420: An IPv4 class


Complete IPv4 class that can represent a host or network, and iterate over networks. Supports slash notation, stringifying, and range generation (among other things).

Python
1
2
3
4
Too big to paste here. Get it from here:


http://www.kdart.com/~keith/python/ipv4.py

Discussion

This class should handle just about any IP address related operation. If it doesn't handle yours please let me know.

Comments

  1. 1. At 1:11 p.m. on 15 jul 2004, Rune Strand said:
  2. 2. At 7:08 p.m. on 9 jul 2005, Bill Anderson said:

    URL Works for me. URL worked just fine today.

  3. 3. At 8:29 a.m. on 27 jan 2006, Eli Criffield said:

    cheeseshop? This looks like something that should be added to the Python Package Index http://cheeseshop.python.org/

  4. 4. At 8:27 p.m. on 12 sep 2007, Stuart Woodward said:

    Is this still available? Is this still available?

Sign in to comment