Output to the same line overwriting previous output?
Here’s code for Python 3.x: print(os.path.getsize(file_name)/1024+’KB / ‘+size+’ KB downloaded!’, end=’\r’) The end= keyword is what does the work here — by default, print() ends in a newline (\n) character, but this can be replaced with a different string. In this case, ending the line with a carriage return instead returns the cursor to the … Read more