I copied a complete input and output code program that could be run, and then I modified the data of the tsv file. The original data was as follows and I modified it to the picture below. Then it cannot run and the following error occurs
How to correct this situation? ? ?
Reminds me of the previous post on Zhihu "What are the "black spots" in each programming language", which contains an answer about Python
https://zhihu.com/question/53..., how can I save you? , the method is also very simple, you need to read "Why is Python coding so painful?" 》The most upvoted answer.
This is a problem with Chinese encoding. You can solve this type of problem if you understand the connection between the decode, encode, and unicode methods. This kind of problem is often encountered, so you need to learn how to fish.
Let’s try it with python3 first!