本文整理汇总了Python中blessed.Terminal.bold_green方法的典型用法代码示例。如果您正苦于以下问题:Python Terminal.bold_green方法的具体用法?Python Terminal.bold_green怎么用?Python Terminal.bold_green使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类blessed.Terminal
的用法示例。
在下文中一共展示了Terminal.bold_green方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from blessed import Terminal [as 别名]
# 或者: from blessed.Terminal import bold_green [as 别名]
def main():
"""Program entry point."""
term = Terminal()
# move to bottom of screen, temporarily, where we're likely to do
# the least damage, as we are performing something of a "destructive
# write and erase" onto this screen location.
with term.cbreak(), term.location(y=term.height - 1, x=0):
# store first position
pos0 = get_pos(term)
# display multibyte character
print(u'⦰', end='')
# store second position
pos1 = get_pos(term)
# determine distance
horizontal_distance = pos1.column - pos0.column
multibyte_capable = bool(horizontal_distance == 1)
# rubout character(s)
print('\b \b' * horizontal_distance, end='')
# returned to our original starting position,
if not multibyte_capable:
print('multibyte encoding failed, horizontal distance is {0}, '
'expected 1 for unicode point https://codepoints.net/U+29B0'
.format(horizontal_distance), file=sys.stderr)
exit(1)
print('{checkbox} multibyte encoding supported!'
.format(checkbox=term.bold_green(u'✓')))