| 1 |
from __future__ import print_function |
| 2 |
import fixpath |
| 3 |
import colorama |
| 4 |
|
| 5 |
# Demonstrate cursor relative movement: UP, DOWN, FORWARD, and BACK in colorama.CURSOR |
| 6 |
|
| 7 |
up = colorama.Cursor.UP |
| 8 |
down = colorama.Cursor.DOWN |
| 9 |
forward = colorama.Cursor.FORWARD |
| 10 |
back = colorama.Cursor.BACK |
| 11 |
|
| 12 |
def main(): |
| 13 |
""" |
| 14 |
expected output: |
| 15 |
1a2 |
| 16 |
aba |
| 17 |
3a4 |
| 18 |
""" |
| 19 |
colorama.just_fix_windows_console() |
| 20 |
print("aaa") |
| 21 |
print("aaa") |
| 22 |
print("aaa") |
| 23 |
print(forward() + up(2) + "b" + up() + back(2) + "1" + forward() + "2" + back(3) + down(2) + "3" + forward() + "4") |
| 24 |
|
| 25 |
|
| 26 |
if __name__ == '__main__': |
| 27 |
main() |