【发布时间】:2020-05-09 19:47:37
【问题描述】:
好吧,我几乎只是复制了这段代码,它获取了光标的x 和y 位置,并且“我想问一下每行命令的作用,以便掌握它。
提前致谢!
print('Type Ctrl-C to stop the program')
try:
while True:
x, y = pg.position()
coordinates = 'X: ' + str(x).ljust(4) + ' Y: ' + str(y).ljust(4)
print(coordinates, end='')
print('\b' * len(coordinates), end='', flush = True)
except KeyboardInterrupt():
print('\n See you next time!')
【问题讨论】: