Python3: print(somestring,end='\r', flush=True) shows nothing
The problem is that the '\r' at the end clears the line that you just printed, what about?
import time
def show_Remaining_Time(time_delta):
print("\r", end='')
print('Time Remaining: %d' % time_delta, end='', flush=True)
if __name__ == '__main__':
count = 0
while True:
show_Remaining_Time(count)
count += 1
time.sleep(1)
In this way, you clear the line first, and then print the desired display, keeping it in screen for the duration of the sleep.
NOTE: The code above was modified to add the end=''
as suggested in the comments for the code to work properly in some platforms. Thanks to other readers for helping to craft a more complete answer.