# IP转整数 def ipToInt(addr): id = [int(x) for x in addr.split(".")] print(id) return sum(id[i] << [24, 16, 8, 0][i] for i in range(4)) print(ipToInt("191.10.96.218"))