1

the code:

# Carriage return
print("123456\rabcd")

and it's appearing in console just that

abcd

instead of

abcd56
40Error04
  • 13
  • 3
  • Note that there is a PyCharm tag; no need to put it in the title. I also took some freedom in changing your title to a more normal English sentence, hopefully without altering the meaning. – 9769953 Feb 09 '22 at 07:47
  • 2
    This is a side effect of your IDE. It works in a normal console. – Tim Roberts Feb 09 '22 at 07:52

1 Answers1

2

This is an issue with PyCharm. You can actually work around this via checking Edit Configurations -> Execution -> Emulate terminal in output console. This will run your code on python console instead of Pycharm's.

There is an issue about this in jetbrains too which mentions the solution I have suggested too.