如何在python中的字符串中获取°字符? [英] How to get ° character in a string in python?
本文介绍了如何在python中的字符串中获取°字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将°
(度)字符转换为字符串?
How can I get a °
(degree) character into a string?
推荐答案
将此行放在源代码的顶部
Put this line at the top of your source
# -*- coding: utf-8 -*-
如果您的编辑器使用不同的编码,请替换为 utf-8
If your editor uses a different encoding, substitute for utf-8
然后就可以直接在源码中包含utf-8字符了
Then you can include utf-8 characters directly in the source
这篇关于如何在python中的字符串中获取°字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文