Home  >  Article  >  Database  >  python character encoding problem

python character encoding problem

巴扎黑
巴扎黑Original
2016-12-09 10:33:571181browse

Recently, because the project needs to use PYTHON script, I quickly learned it. I encountered a problem today and took notes. An error like "Non-UTF-8 code starting with 'xb6' in file xxxxx.py" appears. The cause of the error is explained online: it is a file encoding problem of PYTHON, so according to the official prompt, you need to add #coding = you The encoding to specify.

Secondly, during the debugging process, I found that the statement to convert the file encoding:

#coding = utf-8


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn