在python 2.7中编写法语字符 [英] Write french characters in python 2.7

查看:73
本文介绍了在python 2.7中编写法语字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试像这样在 python 2.7 中编写法语字符:

I am trying to write french characters in python 2.7 like this:

plt.xlabel("Débit")

但是,我遇到了这个错误:

But, I had this error:

ValueError: matplotlib display text must have all code points < 128 or use Unicode strings

请问有解决办法吗?

推荐答案

错误 ValueError:matplotlib显示文本必须具有所有代码点<128或使用Unicode字符串告诉您使用 unicode 字符串,因此:

The error ValueError: matplotlib display text must have all code points < 128 or use Unicode strings tells you to use a unicode string, so:

plt.xlabel(u"Débit")

这篇关于在python 2.7中编写法语字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆