标签:argument put ali from err error: expected unicode syntax
概意思是,默认文件是ASCII格式,需要更改文件编码,操作是在文件首行加上
#!/usr/bin/python
# -*- coding:utf8 -*-
if your environment is Python2.7, you can change code :import io
andoutput_stream·=io.StringIO()
tofrom io import BytesIO as StringIO
output_stream·= StringIO()
import matplotlib.pyplot as plt 后面加一行:
plt.switch_backend(‘agg‘)
中文注释报错 SyntaxError: Non-ASCII character
标签:argument put ali from err error: expected unicode syntax
原文地址:https://www.cnblogs.com/Allen-rg/p/10040051.html