Ejemplo n.º 1
0
#!/usr/bin/env python3.7

import sys
from blessed import Terminal

term = Terminal()

loc = term.get_location()
print(f"loc={loc}")
print(term.home + term.clear + term.move_y(term.height // 2))

print(term.black_on_darkkhaki(term.center('Press any key to continue.')))

# with term.cbreak(), term.hidden_cursor():
#     inp = term.inkey()

# print(term.move_down(2) + 'You pressed ' + term.bold(repr(inp)))

#txt = [ l.strip() for l in open(sys.argv[1],'r').readlines() ]
txt = '''1 file-1
2 file-2
3 file-3
4 file-4'''

curColor=term.red

print("hello")
term.up(2)
print("world")

# Note: we can't know the cursor's current position, but we can move it relatively with term.up, term.down, term.move_x