0

Python carriage return problem

print('abcdef\r123') When I execute this code on sololearn playground it returns "abcdef\r123" When I execute this on pydroid app it returns "123def" When I execute this on pycharm it returns "123" It seems like pycharm and sololearn playground have some problem. Anyone knows how to solve the problem on sololearn and pycharm

27th Sep 2020, 5:00 PM
Mir Abir Hossain
Mir Abir Hossain - avatar
2 Answers
+ 5
On SoloLearn you cannot fix it, it is related to how the output is generated in a special way on the playground, we cannot really do anything about it. https://www.sololearn.com/Discuss/1593777/?ref=app About pycharm I don't know.. Have you tried running the same script from plain console (windows terminal?) Maybe you can switch to a different terminal software in Pycharm (if you are on windows, you can try powershell instead of cmd.exe)
27th Sep 2020, 5:34 PM
Tibor Santa
Tibor Santa - avatar
0
I didn't try windows terminal or powershell. Thanks for the advice. I will try these now.
27th Sep 2020, 5:38 PM
Mir Abir Hossain
Mir Abir Hossain - avatar