How could I go about printing the latest output at the top of the terminal so instead of new output being constantly added to the bottom of the window, it is stacked on the top?
Example program:
for x in range(4):
print(x)
Output:
0
1
2
3
Desired output:
3
2
1
0
Edit: The example is just a simple visual to understand the question better. My actual programs will be returning data in real time, which I am interested in having the latest printed to the top if that makes sense.