Tuesday, August 28, 2012

Howto write to stdout XY

how to use python to write to a certain location (x,y) on the stdout (terminal):
copied form here
import sys
def print_there(x, y, text):
     sys.stdout.write("\x1b7\x1b[%d;%df%s\x1b8" % (x, y, text))
     sys.stdout.flush()

No comments:

Post a Comment

Please Comment this Post or send me an Email