作者:ZhuJiongJiongnu_441 | 来源:互联网 | 2023-10-12 05:37
导入requests模块设置头部文件以及需要请求的信息请求获取并读取json文件在所读取的json文件中提取所需内容:英雄的编号、名称、皮肤列表及数量打印英雄名称及皮肤的数量用网址
导入requests模块
![image](https://img.php1.cn/3cd4a/1eebe/cd5/d05d9dfd09a56332.webp)
设置头部文件以及需要请求的信息
![image](https://img.php1.cn/3cd4a/1eebe/cd5/eec57030b649a106.webp)
请求获取并读取json文件
![image](https://img.php1.cn/3cd4a/1eebe/cd5/e3aa5425383ba10d.png)
在所读取的json文件中提取所需内容:英雄的编号、名称、皮肤列表及数量
![image](https://img.php1.cn/3cd4a/1eebe/cd5/60405fda58cd0acd.webp)
打印英雄名称及皮肤的数量
![image](https://img.php1.cn/3cd4a/1eebe/cd5/d34245582687a4e6.webp)
用网址拼接构成新网址
![image](https://img.php1.cn/3cd4a/1eebe/cd5/6c257b6ba227cc3e.webp)
遍历每一个图片的网址
![image](https://img.php1.cn/3cd4a/1eebe/cd5/3e641eb5f5c8cd90.webp)
最终的结果储存在pic的文件夹中
![image](https://img.php1.cn/3cd4a/1eebe/cd5/2d903861d5ad779c.png)
最后点击开始执行,执行结果如下。
![image](https://img.php1.cn/3cd4a/1eebe/cd5/bcafc120671304eb.webp)
![image](https://img.php1.cn/3cd4a/1eebe/cd5/7d7ef3f69d479716.webp)
当然,我们还可以对这些数据进行统计分析
导入绘图模块
![image](https://img.php1.cn/3cd4a/1eebe/cd5/eec57030b649a106.webp)
创建x/y列表保存信息
![image](https://img.php1.cn/3cd4a/1eebe/cd5/02c379d60086f382.webp)
![image](https://img.php1.cn/3cd4a/1eebe/cd5/d34245582687a4e6.webp)
设置显示文件格式为“黑体”.最后,如果你的时间不是很紧张,并且又想快速的python提高,最重要的是不怕吃苦,建议你可以价位@762459510 ,那个真的很不错,很多人进步都很快,需要你不怕吃苦哦!大家可以去添加上看一下~
![image](https://img.php1.cn/3cd4a/1eebe/cd5/ed19db63ee478b98.png)
设置xy坐标显示,并修改文字大小以及纵向显示,执行show()显示
![image](https://img.php1.cn/3cd4a/1eebe/cd5/8be1ccb5166feb93.webp)
执行结果如下
![image](https://img.php1.cn/3cd4a/1eebe/cd5/bff2716168d1ed7b.webp)