I've started to play around with blessings - so far I'm liking it a lot since it does make things a lot easier.
However I tried to clear the screen without success... enter_fullscreen seems to work tho since that "clears" it - but exit_fullscreen doesn't bring me back to the original view.
term = blessings.Terminal()
term.enter_fullscreen
with term.location():
print(term.move(0,(term.width/2)-7) + term.bold_green("Test Test Test"))
print(term.move(5,(term.width/2)-7) + term.bold_red("Test Test Test"))
time.sleep(5)
term.clear
term.exit_fullscreen
This works except for clear and exit_fullscreen it seems. There is no error message or anything, it just doesn't seem to do anything.
Does anyone know how it works?
Edit: Neither
term.clear
nor
term.clear()
seem to work...
edit2:
I can pretty much do this and the result is the same as above. It does the coloring and placement but not clearing or anything else.
term = blessings.Terminal()
with term.location():
print(term.move(0,(term.width/2)-7) + term.bold_green("Test Test Test"))
print(term.move(5,(term.width/2)-7) + term.bold_red("Test Test Test"))
As I read through your issue (facing the same one myself) I realized that I had forgotten that all the
term.some_formatting()calls returned a value that you then had to print. The clear function merely returns the appropriate escape sequences.If you add:
print(term.clear())when you want it cleared it should work.Additionally, I had issues with ex_fullscreen, so I used the wrapper style call of fullscreen:
That should return you to your previous state upon exiting the code block.