中华

Python3--监控疫情

寵の児 提交于 2020-02-12 04:40:35
import requests import json from pyecharts.charts import Map, Geo from pyecharts import options as opts from pyecharts.globals import GeoType, RenderType url = 'https://view.inews.qq.com/g2/getOnsInfo?name=disease_h5' datas = json.loads(requests.get(url=url).json()['data']) china = datas['areaTree'][0]['children'] data = [] for i in range(len(china)): data.append([china[i]['name'], china[i]['total']['confirm']]) confirm = datas['chinaTotal']['confirm'] suspect = datas['chinaTotal']['suspect'] dead = datas['chinaTotal']['dead'] heal = datas['chinaTotal']['heal'] lastUpdateTime = datas[

Integration Manager: IM transformation script 变量赋值

戏子无情 提交于 2020-01-27 05:41:14
IM Transformation Script 给变量赋值,不管给哪种类型的变量赋值,值都必须用"引起来 //TRUE/FALSE 类型,必须全部大写 SET VARIABLE varTrueFalse="TRUE" IF varTrueFalse .... END IF //integer 类型 SET VARIABLE varInt="12" SET VARIABLE varInt=Add(varInt,"1") //string 类型 SET VARIABLE varString="abcccccccccccc " 变量赋值可以用的函数 //1. 将变量置为空 Set VARIABLE var1=Empty() //2. 判断变量是否为空 IF ISEMPTY(var1) END IF //3. 判断变量是否为非空 IF ISNOTEMPTY(var1) END //4. 数值相加返回Integer Set VARIABLE var2=Add(var1,11) //5. 减法运算返回Integer: var1-2 Set VARIABLE var2=Sub(var1,2) //6. 乘法运算(只能处理Integer): Mult(x,y) Set VARIABLE var3=Mult(var1,var2) //7. 除法运算(只能处理Integer):Div(x,y)

C# 解析Xml接口

匿名 (未验证) 提交于 2019-12-03 00:15:02
1 public string GetWeather() 2 { 3 string weatherXML = GetRequestData("http://flash.weather.com.cn/wmaps/xml/china.xml?spm=a2c4e.10696291.0.0.5c5019a4nz9oyZ&file=china.xml"); 4 XmlDocument xml = new XmlDocument(); 5 xml.LoadXml(weatherXML); 6 XmlNode root = xml.SelectSingleNode("china"); 7 var list = Newtonsoft.Json.JsonConvert.SerializeXmlNode(root); 8 XmlNodeList childlist = root.ChildNodes; 9 return list; 10 } 11 12 public static string GetRequestData(string sUrl) 13 { 14 //使用HttpWebRequest类的Create方法创建一个请求到uri的对象。 15 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sUrl); 16 /

C# 解析Xml接口

折月煮酒 提交于 2019-12-02 22:18:51
1 public string GetWeather() 2 { 3 string weatherXML = GetRequestData("http://flash.weather.com.cn/wmaps/xml/china.xml?spm=a2c4e.10696291.0.0.5c5019a4nz9oyZ&file=china.xml"); 4 XmlDocument xml = new XmlDocument(); 5 xml.LoadXml(weatherXML); 6 XmlNode root = xml.SelectSingleNode("china"); 7 var list = Newtonsoft.Json.JsonConvert.SerializeXmlNode(root); 8 XmlNodeList childlist = root.ChildNodes; 9 return list; 10 } 11 12 public static string GetRequestData(string sUrl) 13 { 14 //使用HttpWebRequest类的Create方法创建一个请求到uri的对象。 15 HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(sUrl); 16 /