84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
You can try the f.read(size) function. If size is set to 1, it will read character by character, and then filter the data.
This is easy to usepython, but the result is the same, it’s because your posture is not right
python
For example, the content you filtered> twiiiiiii@2, 我模拟一下, 假如待处理的文件(raw.dat) is as follows
> twiiiiiii@2
raw.dat
> t我w爱i北i京i天i安i门ii@2
Up code
with open("raw.dat", "rb") as fh: line = fh.readline() print(line) print(line.decode('ascii', 'ignore'))
Output
b'> t\xce\xd2w\xb0\xaei\xb1\xb1i\xbe\xa9i\xcc\xeci\xb0\xb2i\xc3\xc5ii@2' > twiiiiiii@2
So there’s no problem, it’s no different from what you useC
C
You can try the f.read(size) function. If size is set to 1, it will read character by character, and then filter the data.
This is easy to use
python
, but the result is the same, it’s because your posture is not rightFor example, the content you filtered
> twiiiiiii@2
, 我模拟一下, 假如待处理的文件(raw.dat
) is as followsUp code
Output
So there’s no problem, it’s no different from what you use
C