Well, I pretty much just copied this code that gets the x
and y
position of the cursor, and 'I'd like to ask what each line of command does so I can get a grip of it.
Thanks in advance !
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!')