Search code examples
pythontetris

How can move terminal cursor in Python?


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


Solution

  • 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))