Let's say I have this little Python program:
def drawLine():
userInput = input("Coordinates:")
userInput = userInput.split() # x y
# Draw
# ... some drawing algo which will print an "X" on the screen with x,y
drawLine()
drawLine()
Now notice that drawLine()
is called twice, so that two inputs can be taken and two X-es
be drawn. Unfortunately, console will scroll up. I want my python program "to listen" to user key presses and "not scroll away". Think of a mini-console Photoshop, which also does not scroll your canvas out of sight.
Update: Problem is small enough to not employ a library.