TypeError: expected str, bytes or os.PathLike object,
TypeError: expected str, bytes or os.PathLike object,
with open((item[1], 'wb'), encoding='utf-8') as imge1:
rttd = imge1.write()
print(rttd)
我正在尝试访问此文件,但我不知道如何访问,我尝试在 'with open' 行之外使用解码和编码来尝试摆脱元组,但随后出现 unicode 错误。下面是我在上面写这段代码时的错误
TypeError: expected str, bytes or os.PathLike object, not tuple in Python
在 open((item[1], 'wb'), encoding='utf-8')
中,参数 0 和 1 在一个元组中(例如 G. (1, 2, 3))。改为使用 open(item[1], 'wb', encoding='utf-8')
with open((item[1], 'wb'), encoding='utf-8') as imge1:
rttd = imge1.write()
print(rttd)
我正在尝试访问此文件,但我不知道如何访问,我尝试在 'with open' 行之外使用解码和编码来尝试摆脱元组,但随后出现 unicode 错误。下面是我在上面写这段代码时的错误
TypeError: expected str, bytes or os.PathLike object, not tuple in Python
在 open((item[1], 'wb'), encoding='utf-8')
中,参数 0 和 1 在一个元组中(例如 G. (1, 2, 3))。改为使用 open(item[1], 'wb', encoding='utf-8')