import ctypes
import os
STD_INPUT_HANDLE = -10
STD_OUTPUT_HANDLE = -11
STD_ERROR_HANDLE = -12
os.system('cls')
class COORD(ctypes.Structure):
_fields_ = [("X", ctypes.c_short), ("Y", ctypes.c_short)]
def __init__(self, x, y):
self.X = x
self.Y = y
def gotoxy(x,y):
hOut = ctypes.windll.kernel32.GetStdHandle(STD_OUTPUT_HANDLE)
ctypes.windll.kernel32.SetConsoleCursorPosition(hOut,COORD(x,y))
gotoxy(5, 5)
print("test")
相关文章
- 10-31Command "python setup.py egg_info" failed with error code 1 in c:\users\w5659\appdata\local\temp\pip-build-fs2yzl\ipython\
- 10-31《计算机网络-自顶向下(中文第六版)P112》——基于python3单台主机的TCP(客户机/服务机)实验
- 10-31python-如何按照特定模式对字符串列表进行排序
- 10-31python-如何在不使用循环的情况下使用numpy.lexsort
- 10-31python之pop
- 10-31Python_格式化字符
- 10-31python对文章词频的统计
- 10-31python-如何根据数组中值的相对大小将numpy数组按特定顺序排序(由单独的列表指定)
- 10-31python实现输入一段英文单词后,倒叙输出
- 10-31python中return和print的区别(详细)