def calcDottedNetmask(mask):
bits = 0xffffffff ^ (1 << 32 - mask) - 1
return inet_ntoa(pack('>I', bits))
Which also led me to the Python netaddr project. Very cool!
def calcDottedNetmask(mask):
bits = 0xffffffff ^ (1 << 32 - mask) - 1
return inet_ntoa(pack('>I', bits))
Karrigell is a flexible Python web framework, with a clear and intuitive syntax. It is independant from any database, ORM or templating engine, and lets the programmer choose between a variety of coding styles
The package includes a powerful built-in web server, so there's no need to download, install and configure a separate one, and a pure-Python database engine, PyDbLite, which is used for the demos