I've the python CGI for user entered input for IP address calculation but python ipcalc is not taking input as a variable, for example I'm trying to run this code
>>> import ipcalc
>>> ip='10.84.35.11'
>>> mask=24
>>> print ip
10.84.35.11
>>> print mask
24
>>> subnet = ipcalc.Network(ip/mask)
It gives me an error- Traceback (most recent call last): File "", line 1, in TypeError: unsupported operand type(s) for /: 'str' and 'int'
where as if I pass the value as it is like subnet = ipcalc.Network('10.84.35.11/24') it works perfect!
I'm new to programming, can someone help to solve this!