Solutions to Python Chinese annotation errors

Once there are Chinese comments in the code, an error will be reported

Cause

If there are non ASCII characters in the file, you need to specify the encoding Declaration on the first or second line

Solution

Add such a sentence in the first or second line
# — Coding: UTF-8–

Perfect solution

Similar Posts: