import commandscmd = "ifconfig br0 | grep ‘inet addr‘ | sed ‘s/^.*addr://g‘ |sed ‘s/ Bcast:.*$//g‘"(status, ip) = commands.getstatusoutput(cmd)
python 获取IP
原文:https://www.cnblogs.com/sea-stream/p/9939569.html