How to hide file paths when running Python scripts in VS Code?

The simplest/quickest way I do this is by putting

print("\033c")

at the top of my file (or anywhere else where I want everything above that print("\033c") erased (so I can get rid of the textual noise my other print statements might be making).

In ASCII encoding the octal number 33 is the ESC (escape) character, which is a common prefix for terminal control sequences. In combination with c we have an old VT100 reference essentially asking the terminal to reset to default, thus erasing all that textual noise so we only see the output of our code.

Leave a Comment