I'm using Pydev in Eclipse on Ubuntu Linux.
Say I have a python script as follows:
for i in range(101):
print(str(i) + "% \r", end="")
Running this script from terminal gives the anticipated and wanted result, a print that updates the line with the end result as follows:
If I run the script in Eclipse/Pydev, the output is instead:
It seems the console handles \r as a complete newline. Does anyone know a way to fix this behaviour? Thanks in advance!
Unfortunately (as you saw), this is not currently possible inside of Eclipse.
PyDev doesn't really do anything there, it just passes control of the console to Eclipse, so, Eclipse itself should take care of handling a '\r' and do what you want, but I can see some issues as it's not a real shell (and output is asynchronized).
So, please create a bug-report at Eclipse.org asking for that to be added (and please post the link to the bug in this forum so that I can help you there).