python - 类型错误 : must be str, 不是元组

标签 python

这个问题在这里已经有了答案:





adding a row to CSV file - TypeError: must be str, not tuple

(1 个回答)


5年前关闭。




“类型错误:必须是 str,而不是元组”
请有人解释这个错误是什么?

最佳答案

更改 receipt.write(output_to_receipt)receipt.write(str(output_to_receipt)) .

这将改变 output_to_receipt这是一个字符串的元组,您将能够编写。

关于python - 类型错误 : must be str, 不是元组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36887861/

相关文章:

python - 在 Pandas 中查找包含日期的列

python - 如何将所有资源编译成一个可执行文件?

python - 如何将要素类复制到 ArcGIS/Python 中的新地理数据库中?

python - 属性是变量吗?

python - wxpython无法捕获EVT_KEY_DOWN enent

python cpu 使用率 98% 与 apscheduler

python - R/Python 网站抓取

python - 在 __add__ 运算符中返回相同子类的对象

python - 如何提取不在标签内的 2 个不同的封闭 html 标签之间的文本?

Python bs4 删除 br 标签