-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b340390
commit b155684
Showing
3 changed files
with
91 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
'''A utility module that helps with terminal manipulation''' | ||
|
||
import sys | ||
|
||
|
||
def clear_line(): | ||
'''Clears all the text on the current line''' | ||
sys.stdout.write('\x1b[2K\r') | ||
|
||
|
||
def move_line_up(): | ||
'''Moves the terminal cursor up one line''' | ||
sys.stdout.write('\033[F') | ||
|
||
|
||
def move_line_down(): | ||
'''Moves the terminal cursor down one line''' | ||
sys.stdout.write('\n') |