File: dec_modes_synchronized.py

package info (click to toggle)
python-blessed 1.25-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,812 kB
  • sloc: python: 14,645; makefile: 13; sh: 7
file content (23 lines) | stat: -rw-r--r-- 613 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env python3
from blessed import Terminal

term = Terminal()

fill = "█" * term.height * term.width
empty = " " * term.height * term.width

print(term.bold_red("Warning! Screen may blink rapidly!"))
print()
print("Press return to continue, 'q' to stop test")
term.inkey()

with term.fullscreen():
    for step in range(300):
        with term.synchronized_output():
            print(term.home + empty, flush=True)
            print(term.home + fill, flush=True)
            print(term.home + f'step={step}')
        if term.inkey(0.01) == 'q':
            break

print(term.clear + "Test complete!")