Initial Commit
This commit is contained in:
13
mouseLocation.py
Normal file
13
mouseLocation.py
Normal file
@@ -0,0 +1,13 @@
|
||||
#! python3
|
||||
|
||||
#This displays the location of the mouse in a loop
|
||||
import pyautogui, sys
|
||||
print('Press Ctrl-C to quit.')
|
||||
try:
|
||||
while True:
|
||||
x, y = pyautogui.position()
|
||||
positionStr = 'X: ' + str(x).rjust(4) + ' Y: ' + str(y).rjust(4)
|
||||
print(positionStr, end='')
|
||||
print('\b' * len(positionStr), end='', flush=True)
|
||||
except KeyboardInterrupt:
|
||||
print('\n')
|
||||
Reference in New Issue
Block a user