linesplit = linesplitTypeError a bytes-like object is required not str
This error occurs when you try to split a string using the split() method, but the variable line is a bytes-like object instead of a string.
To fix this error, you need to convert the bytes-like object to a string before splitting it. You can use the decode() method to convert the bytes-like object to a string.
Here's an example of how you can fix this error:
linesplit = line.decode().split('|')
In this example, line.decode() converts the bytes-like object line to a string, and then the split('|') method splits the string using the delimiter '|'.
原文地址: https://www.cveoy.top/t/topic/i5Nk 著作权归作者所有。请勿转载和采集!