(string: str)
| 18 | |
| 19 | |
| 20 | def print_during_input(string: str) -> None: |
| 21 | sys.stdout.write( |
| 22 | # Save cursor position |
| 23 | "\N{ESC}7" |
| 24 | # Add a new line |
| 25 | "\N{LINE FEED}" |
| 26 | # Move cursor up |
| 27 | "\N{ESC}[A" |
| 28 | # Insert blank line, scroll last line down |
| 29 | "\N{ESC}[L" |
| 30 | # Print string in the inserted blank line |
| 31 | f"{string}\N{LINE FEED}" |
| 32 | # Restore cursor position |
| 33 | "\N{ESC}8" |
| 34 | # Move cursor down |
| 35 | "\N{ESC}[B" |
| 36 | ) |
| 37 | sys.stdout.flush() |
| 38 | |
| 39 | |
| 40 | def print_over_input(string: str) -> None: |
no test coverage detected
searching dependent graphs…