I need to entered a undefined number of IP into a list, but below script does only allow me to put 5 configured number IP (see: ip_list = read_ip(5)). What do you sugggest me ?
-----------------------------------------------------------
-------------------------------------------------------
Tks/Charlie30
-----------------------------------------------------------
Code:
def read_ip(N):
valid_ip = []
i = 1
while (i<=N):
ipAddress = raw_input("Give IP n°%d: " % i)
if validIP(ipAddress):
valid_ip.append(ipAddress)
i += 1
else:
print "IP invalid. start again"
return valid_ip
# 5 is the max ip to be read
ip_list = read_ip(5)
print ip_list
Tks/Charlie30