【问题标题】:Python - Unicode ConverterPython - Unicode 转换器
【发布时间】:2016-01-12 16:35:14
【问题描述】:

我正在寻找如何将十进制 unicode 转换为字符串的简单方法。

例如:

我需要将数字 76 转换为符号“L”。 我需要类似这个页面的东西:https://www.branah.com/unicode-converter

感谢您的帮助

【问题讨论】:

    标签: python-2.7 unicode converter unicode-string


    【解决方案1】:

    chr 函数是您在 Python3 上寻找的,unichr 在 Python2 上寻找的功能。

    >>> u''.join(unichr(x) for x in [77,65,82,75])
    u'MARK'
    

    【讨论】:

    • 上帝保佑你,伙计,非常感谢你:)
    猜你喜欢
    • 2011-10-10
    • 2018-08-16
    • 1970-01-01
    • 1970-01-01
    • 2011-06-12
    • 1970-01-01
    • 1970-01-01
    • 2011-05-29
    • 2013-05-17
    相关资源
    最近更新 更多