According to https://jcastellssala.com/2012/07/20/python-command-line-waiting-feedback-and-some-background-on-why/, '\r\x1b[K' is an escaping sequence that erases the current line in the console and rewrites something in Python. But when I tried to use the sequence on Windows cmd, it prints out weird characters instead. In Python, is there an equivalent sequence/action on Windows cmd where I can erase the last line I print out to the console?
Asked
Active
Viewed 1,532 times
1 Answers
2
Amazingly, support for ANSI escape sequences in the Windows console was only added in Windows 10 Version 1511:
http://www.nivot.org/blog/post/2016/02/04/Windows-10-TH2-(v1511)-Console-Host-Enhancements
They will not work in older versions of Windows, unless you use a terminal emulator which supports them, like ConEmu:

jbch
- 591
- 2
- 6
-
See also https://stackoverflow.com/q/2048509. It suggests OP needs to update Windows. – Jongware Jan 12 '18 at 22:37