Issue 40709: Malfunctioning of '\r' - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
process
Status: closed Resolution: duplicate
Dependencies: Superseder: IDLE: Document how Shell displays user code output
View: 23220
Assigned To: ezio.melotti Nosy List: Dora, ezio.melotti, terry.reedy
Priority: normal Keywords:

Created on 2020-05-21 09:17 by Dora, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
error Dora, 2020-05-21 09:17 The description is given in the comment.
error Dora, 2020-05-21 09:18 The description is given in the comment.
Messages (4)
msg369508 - (view) Author: Dora (Dora) Date: 2020-05-21 09:17
The escape sequence '\r' (carriage return) doesn't function in 3.x and 2.x versions.
Eg:
print("computer\rscience")
Expected output : sciencer
But, it displays computerscience without the functioning of'\r'
msg369509 - (view) Author: Dora (Dora) Date: 2020-05-21 09:18
The escape sequence '\r' (carriage return) doesn't function in 3.x and 2.x versions.
Eg:
print("computer\rscience")
Expected output : sciencer
But, it displays computerscience without the functioning of'\r'
msg369516 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2020-05-21 09:52
The behavior of \r depends on the operating system and terminal you are using, and not on Python itself.
msg369568 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-05-22 08:40
Discussed on #23220.  Note that 'sciencecomputer' is a different possible result if \r does not switch the simulated terminal from the normal insert mode to overwrite mode.  I am considering terminal simulation as an option, but there is not exactly a standard to emulate.