摘要:
Python运行后,报错:SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape 原因:window 读取文件可以用\,但是在 阅读全文
posted @ 2018-10-04 23:48
翻滚的小强
阅读(145554)
评论(3)
推荐(9)
摘要:
Python_报错:SyntaxError: unexpected character after line continuation character 原因:写入的文件内容不正确,应处理为字符串 写成这样就ok了:os.chdir(time_year+"\\"+time_month+"\\"+t 阅读全文
posted @ 2018-10-04 18:16
翻滚的小强
阅读(18131)
评论(0)
推荐(0)
摘要:
报错:TypeError: Tuple or struct_time argument required 原因:时间戳——格式化时间 不能直接转换会报错 上代码: import time time3 = time.asctime(time.time())# print ("本地时间为 :",time 阅读全文
posted @ 2018-10-04 15:57
翻滚的小强
阅读(37600)
评论(0)
推荐(0)
摘要:
文件写入操作时,报错:TypeError: write() argument must be str, not list 原因:python写入的内容要是字符串类型的 上代码: fp = open("a.txt","w")fp.write([1,2,3])fp.close() 写入内容为字符串类型则 阅读全文
posted @ 2018-10-04 14:29
翻滚的小强
阅读(6526)
评论(0)
推荐(0)

浙公网安备 33010602011771号