8

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

PARK
  • 95
  • 1
  • 1
  • 5
  • You need to post your code and specify which part of your code is not working. – Henry Yik Feb 11 '19 at 12:41
  • Does this answer your question? [How to change the location of the pointer in python?](https://stackoverflow.com/questions/27612545/how-to-change-the-location-of-the-pointer-in-python) – Tomerikoo Mar 27 '21 at 08:47
  • 1
    this post does not lack details or clarity. it is clear what OP wants. It should instead be closed as a duplicate of https://stackoverflow.com/questions/27612545/how-to-change-the-location-of-the-pointer-in-python/27612978#27612978 – Neuron Jan 17 '22 at 18:32
  • @Neuron: Generally on Stack Overflow we tend to not reopen a question just for close it with another reason. You could leave a comment about what close reason seems to be better in your opinion, but reopening a question mostly wastes a time and a gives a risk to leave a question opened. You may find discussions on this topic on meta: https://meta.stackoverflow.com/questions/262761/should-we-allow-voting-to-change-the-close-vote-reason-of-a-question – Tsyvarev Jan 17 '22 at 20:23
  • @Tsyvarev thanks for the info. I retracted my vote – Neuron Jan 17 '22 at 20:36

1 Answers1

12

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))
aaaakshat
  • 809
  • 10
  • 19