python
平常练手的python整理
打野的典韦
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
Python字符串转字典值报错ValueError: dictionary update sequence element #0 has length 1; 2 is required
刚开始学习Python,认为字符串和字典之间转换直接用dict()就能搞定,结果程序运行起来之后报错:ValueError: dictionary update sequence element #0 has length 1; 2 is required后来查找资料,这个数据之间不能直接转换。需要用到函数eval()转换。转换之后代码运行...原创 2021-03-24 09:54:30 · 3532 阅读 · 0 评论 -
Python的文件读写
文件读写属性表格:贴一段代码,随便写的,没有用异常捕获,有空改进import osdef writelog(*key): path = "../log" if os.chdir(path) == '': print("chdir error") else: f = open("logger.txt", 'a+') if f == '': return -1 else:原创 2021-03-11 09:48:17 · 110 阅读 · 0 评论
分享