以 Python 为例获取 ip 的值:
Python 2
export PYTHONIOENCODING=utf8
curl -s 'ip.taobao.com/service/get…' |
python -c "import sys, json; print json.load(sys.stdin)['data']['ip']"
Python 3
curl -s 'ip.taobao.com/service/get…' |
python3 -c "import sys, json; print(json.load(sys.stdin)['data']['ip'])"