tuple' object has no attribute 'append'
时间: 2023-08-04 19:03:47 浏览: 88
解决’tuple’ object is not callable的报错-python变量命名错误
这个错误是因为你尝试在一个元组(tuple)上使用append方法,而元组是不可变的,没有append方法。你可以将元组转换为列表(list),然后再使用append方法。例如,将TEXT定义为一个空列表,然后在循环中使用append方法将header添加到列表中。这样就可以避免这个错误了。
#### 引用[.reference_title]
- *1* [【无标题】Python爬虫:AttributeError: ‘tuple’ object has no attribute ‘append’](https://blog.csdn.net/qq_52671517/article/details/124523523)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [python 常规报错总结](https://blog.csdn.net/LXiaYu123456789/article/details/112397424)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
- *3* [python常见错误-Python 常见报错类型](https://blog.csdn.net/weixin_37988176/article/details/109421630)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文