1. 程式人生 > >python 獲取IP

python 獲取IP

config stat ifconf imp and net pla 獲取 ddr

import commands
cmd = "ifconfig br0 | grep ‘inet addr‘ | sed ‘s/^.*addr://g‘ |sed ‘s/ Bcast:.*$//g‘"
(status, ip) = commands.getstatusoutput(cmd)

python 獲取IP