今天在把测试结果以json格式写回excel表格中的时候报错,ValueError: Cannot convert {'code': 0, 'msg': 'login success!', 'username': 'test',} to Excel,无法转换到excel
产生原因:excel只支持字符串格式存入,不支持json格式的数据。
解决:str强制转换成字符串存入:
今天在把测试结果以json格式写回excel表格中的时候报错,ValueError: Cannot convert {'code': 0, 'msg': 'login success!', 'username': 'test',} to Excel,无法转换到excel
产生原因:excel只支持字符串格式存入,不支持json格式的数据。
解决:str强制转换成字符串存入: