生成csv:TypeError: a bytes-like object is required, not ‘str‘
TypeError: a bytes-like object is required, not ‘str’encode()方法语法:str.encode(encoding='UTF-8',errors='strict')print("gbk编码:",str.encode(encoding="gbk",errors="strict"))‘tuple’ object has no attribute ‘encode’Python有两个非常相似的集合式的数据类型,分别是list列表和tupl