I want to move the cursor’s position in Python, but it’s not moving correctly.
<code> def movecur(self, x, y):
sys.stdout.write(f"33[{y};{x}H")
sys.stdout.flush()
</code>
<code> def movecur(self, x, y):
sys.stdout.write(f"33[{y};{x}H")
sys.stdout.flush()
</code>
def movecur(self, x, y):
sys.stdout.write(f"33[{y};{x}H")
sys.stdout.flush()
If I run:
<code>for i in range(100): print()
movecur(0, 0)
</code>
<code>for i in range(100): print()
movecur(0, 0)
</code>
for i in range(100): print()
movecur(0, 0)
it will just send me to the top of the currently visible screen, not the very top. Any fix? I don’t really want to use the Curses module.
New contributor
Jansel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.