import commands ret = float(commands.getoutput('wget -o /dev/null -O - "http://192.168.2.237/fresh.xml" | grep -Po \'<sns id=\"1\".*val=\"\K[ 0-9\.]*\'|xargs')) print ret*4