![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python基础
python基础代码
翟小花@@
这个作者很懒,什么都没留下…
展开
-
python处理json
import json import jsonpath #导入json文件 with open('./data/2.json','r',encoding='utf8') as fp: json_data=json.load(fp) #依次获取文件中的列表 entityList=jsonpath.jsonpath(json_data,'$..span') tagList=jsonpath.jsonpath(json_data,'$..tag') print(entityList) print(tagL原创 2022-05-14 21:41:57 · 167 阅读 · 0 评论 -
python--tips
调试 F8 Step Over单步执行,将函数调用看作一行代码直接执行 F7 Step Into可以单步执行代码,如果是函数,会进入函数内部 注释 “”" 多行注释 “”" 查看函数说明:CTRL+Q原创 2022-04-07 09:53:07 · 532 阅读 · 0 评论 -
python--if、while
if语句以及random包 猜拳代码 import random player = int(input("请出拳 石头(1) 剪刀(2) 布(3)")) computer = random.randint(1,3) if (player == 1 and computer == 2) or (player == 2 and computer == 3) or (player == 3 and computer == 1): print("你赢了") elif player == computer:原创 2022-04-06 21:30:44 · 496 阅读 · 0 评论