python共16篇 第3页
python - 数据容器-小纸条

python – 数据容器

五种数据容器1.list(列表)2.tuple(元组)3.str(字符串)4.set(集合)5.dict(字典)一.list(列表)定义空列表可以使用[]列表中的元素的是有上限的,只是比较大基本上都可以满足日常使用,并...
Blank的头像-小纸条Blank3年前
python - 文件-小纸条

python – 文件

文件的打开open(name,mode,encoding)name表示打开的文件名mode表示打开的模式,比如只读,写入,追加等,r表示只读,W表示写入,s文件追加,a+表示读写encoding表示文件的编码注意:多次调用未关闭则会...
Blank的头像-小纸条Blank3年前
python - 异常捕获-小纸条

python – 异常捕获

直接上示例:大概的意思就是当try下方的代码出现异常的时候就自动执行except下方的代码 # 1.捕获所有异常 try: d = open("D:data.txt","r",encoding="UTF-8") e...
Blank的头像-小纸条Blank3年前
python - python - json-小纸条

python – python – json

直接看示例 import json # 1.列表嵌套字典转json data = [{"a": "1"}, {"b": "2"}, {"c": "3"}] json_str = json.dumps(data, en...
Blank的头像-小纸条Blank3年前
python - pyecharts基础使用-小纸条

python – pyecharts基础使用

官方文档: pyecharts一.折线图生成 from pyecharts.charts import Line # 对象创建 Line = Line() # x 坐标 Line.add_xaxis(["1","2","3"]) # y 坐标 Line.add_...
Blank的头像-小纸条Blank3年前
066 6