18 lines
401 B
Python
18 lines
401 B
Python
from ctypes import *
|
|
|
|
STD_OUTPUT_HANDLE = -11
|
|
|
|
class COORD(Structure):
|
|
pass
|
|
|
|
COORD._fields_ = [("X", c_short), ("Y", c_short)]
|
|
|
|
def print_at(r, c, s):
|
|
h = windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
|
|
windll.kernel32.SetConsoleCursorPosition(h, COORD(c, r))
|
|
|
|
c = s.encode("windows-1252")
|
|
windll.kernel32.WriteConsoleA(h, c_char_p(c), len(c), None, None)
|
|
|
|
print_at(6, 3, "Hello")
|