本文整理汇总了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()
示例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)