Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can move terminal cursor in Python? [closed]

Tags:

python

tetris

I'm making Tetris game with Python in Linux, but I can't move terminal cursor to what I want to position

How can move cursor position?? in Python

like image 507
PARK Avatar asked Jan 01 '23 07:01

PARK


1 Answers

This seems like a duplicate, however referring to this answer, it appears that you should be using the colorama module to make this task easier and after doing so you should be able to move your cursor around by simply using

def move (y, x):
    print("\033[%d;%dH" % (y, x))
like image 54
aaaakshat Avatar answered Jan 03 '23 21:01

aaaakshat