我正在尝试从机顶盒获取mac地址。当我在命令行上运行“ifconfig eth0 | grep HWaddr | cut-c39-55”时,我得到了正确的mac地址。在
for ip in ip_address:
tel_con = telnetlib.Telnet(ip, port_number, time_delay)
tel_con.read_until("login: ")
tel_con.write(user_name + "\r\n")
tel_con.read_until("-sh-3.2#")
tel_con.write("ifconfig eth0 | grep HWaddr | cut -c39-55\r\n")
mac_addresses.append(tel_con)
print tel_con
但是,当我从python脚本运行命令时,输出的格式不同。在
^{pr2}$任何帮助都将不胜感激。在
目前没有回答
相关问题 更多 >
编程相关推荐