04 2021 档案

摘要:1)利用eval可以将字典格式的字符串与字典户转 >>>mstr = '{"name":"yct","age":10}' 转换为可以用的字典: >>>eval(mstr), type( eval(mstr) ) {"name":"yct","age":10}, dict 2).JSON到字典转化: 阅读全文
posted @ 2021-04-06 17:00 小小程序员ol 阅读(786) 评论(0) 推荐(0) 编辑
摘要:获取文件的后缀名有好几种方法: 第一种:splittext()方法 os.path.splittext(path)[-1] 第二种:endswith()方法 path = "test_user_info.py" bool = path.endswith(".py") print(bool) 第三种: 阅读全文
posted @ 2021-04-02 16:15 小小程序员ol 阅读(1720) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示