标签:roo res pytho url \n 取数 urllib select read
#!/usr/bin/pythonimport urllib2import urllibimport jsonweatherHtml = urllib.urlopen('http://172.17.37.93:1949/machine/select') weatherHtml1 = weatherHtml.read() weatherJSON = json.loads(weatherHtml1) print weatherJSONout=open('/root/cmdb_ip','w') for i in weatherJSON["data"]: abc = i['privateIpAddress'] + "\n" for key in abc: out.write(key)标签:roo res pytho url \n 取数 urllib select read
原文地址:http://blog.51cto.com/breaklinux/2140481