当前位置: 首页>>代码示例>>Python>>正文


Python six.unichr方法代码示例

本文整理汇总了Python中django.utils.six.unichr方法的典型用法代码示例。如果您正苦于以下问题:Python six.unichr方法的具体用法?Python six.unichr怎么用?Python six.unichr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在django.utils.six的用法示例。


在下文中一共展示了six.unichr方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _replace_entity

# 需要导入模块: from django.utils import six [as 别名]
# 或者: from django.utils.six import unichr [as 别名]
def _replace_entity(match):
    text = match.group(1)
    if text[0] == '#':
        text = text[1:]
        try:
            if text[0] in 'xX':
                c = int(text[1:], 16)
            else:
                c = int(text)
            return six.unichr(c)
        except ValueError:
            return match.group(0)
    else:
        try:
            return six.unichr(html_entities.name2codepoint[text])
        except (ValueError, KeyError):
            return match.group(0) 
开发者ID:lanbing510,项目名称:GTDWeb,代码行数:19,代码来源:text.py

示例2: set_row_color

# 需要导入模块: from django.utils import six [as 别名]
# 或者: from django.utils.six import unichr [as 别名]
def set_row_color(self, sheet, row, header, color='FF000000', bgcolor='FFFFFFFF'):
        for idx, item in enumerate(header):
            sheet[str(six.unichr(idx + ord('A'))) + str(row)].style = self.get_cell_style(color=color, bgcolor=bgcolor)
        return row 
开发者ID:erigones,项目名称:esdc-ce,代码行数:6,代码来源:excel.py


注:本文中的django.utils.six.unichr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。