0

I am using Jupyter Notebook on Windows. I'm trying to override previous prints, but I always get the remaining parts of previous prints:

print("Loooooooooooooooooooong String",end="\r",flush=True)
print("Short String",end="\r",flush=True)

Output: Short Stringooooooooong String

I have tried os.system('clear') and os.system('cls'), but it does not seem to make a difference.

schajan
  • 59
  • 5
  • 1
    See accepted answer for https://stackoverflow.com/questions/45263205/python-how-to-print-on-same-line-clearing-previous-text – ChrisOram Jul 16 '21 at 14:53
  • Does this answer your question? [Python: How to print on same line, clearing previous text?](https://stackoverflow.com/questions/45263205/python-how-to-print-on-same-line-clearing-previous-text) – Pranav Hosangadi Jul 16 '21 at 14:53
  • Thanks, unfortunately I still get the same problem for both answers. – schajan Jul 22 '21 at 12:50

0 Answers0