python小笔记(一)

JOSN模块

作用是用来编码和解码JSON对象

json.dumps  #py对象转变为json字符串
json.load   #将已经编码的json字符串解码为py对象

replace()函数

str.replace(old, new[, max])

old -- 将被替换的子字符串。
new -- 新字符串,用于替换old子字符串。
max -- 可选字符串, 替换不超过 max 次

 

posted @ 2020-12-27 23:39  刀斯林  阅读(58)  评论(0编辑  收藏  举报