这是我的密码
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)
当我在pox控制器中运行这个脚本时,我得到一个错误消息
AttributeError: 'IPAddr' object has no attribute 'split'
原因是
st
不是一个字符串,而是一个IPAddr
对象。您可能需要做的是:相关问题 更多 >
编程相关推荐