Using Python and a Windows console, when a code which contains lots of print statements is running it is not possible to scroll up through the output in the console as it always jumps back to the bottom when a new line is printed.
Given the code:
import time
for i in range(100):
print('This is line {}'.format(i))
time.sleep(0.5)
This is what actually happens:
I would like to auto-scroll the console only if we are already at the bottom of the feed. Also auto-scrolling is activated again if the user goes back at the end of the feed during execution. Something like this:
I have been trying several ways in order to achieve it with no luck so far (not even close). Does anyone know how to code an auto-scroll like this?

