如何解决IPAddr对象没有属性spli

2024-10-06 16:19:12 发布

您现在位置:Python中文网/ 问答频道 /正文

这是我的密码

from pox.lib.addresses import IPAddr
def ip_atoi(st):
"""
function to convert ip address to integer value
"""
  st=st.split(".")
  return int("%02x%02x%02x%02x"%(int(st[0]),int(st[1]),int(st[2]),int(st[3])),16)
  1. 当我在pox控制器中运行这个脚本时,我得到一个错误消息

    AttributeError: 'IPAddr' object has no attribute 'split'
    

Tags: tofromimportip密码addresseslibdef