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


Python Screen.open方法代码示例

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


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

示例1: test_open_close

# 需要导入模块: from asciimatics.screen import Screen [as 别名]
# 或者: from asciimatics.screen.Screen import open [as 别名]
    def test_open_close(self):
        """
        Check Screen.open works.
        """
        def check_screen(local_screen):
            # If we get here there's not much new to test.  Check that we can
            # draw something without hitting an Exception.
            local_screen.print_at("Hello world!",
                                  0, 0,
                                  colour=Screen.COLOUR_CYAN,
                                  attr=Screen.A_BOLD,
                                  bg=Screen.COLOUR_BLUE)
            local_screen.refresh()

        screen = Screen.open()
        check_screen(screen)
        screen.close()
开发者ID:antmd,项目名称:asciimatics,代码行数:19,代码来源:test_screen.py

示例2: test_cjk_glyphs_overwrite

# 需要导入模块: from asciimatics.screen import Screen [as 别名]
# 或者: from asciimatics.screen.Screen import open [as 别名]
    def test_cjk_glyphs_overwrite(self):
        """
        Check that CJK languages delete half-glyphs correctly.
        """
        screen = Screen.open(unicode_aware=True)
        screen.print_at("aaaa", 0, 0)
        screen.print_at("你確", 0, 1)
        screen.print_at("bbbb", 0, 2)
        screen.refresh()
        screen.print_at("cccc", 0, 0)
        screen.print_at("你確", 1, 1)
        screen.print_at("dddd", 0, 2)
        screen.refresh()

        # Half-glyph appears as an "x" to show error and then double-width glyphs are returned
        # twice, reflecting their extra width.
        self.assert_line_equals(screen, u"x你你確確 ", y=1, length=6)
开发者ID:peterbrittain,项目名称:asciimatics,代码行数:19,代码来源:test_screen.py


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