-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmouse_pos.py
More file actions
26 lines (24 loc) · 719 Bytes
/
mouse_pos.py
File metadata and controls
26 lines (24 loc) · 719 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import subprocess
print("subprocess successfully imported")
try:
import pyautogui
print("pyauogui imported")
except ImportError:
subprocess.call('pip install pyautogui')
print("\r""installing pyautogui",end='')
try:
from keyboard import is_pressed
print("keyboard imported")
except ImportError:
subprocess.call('pip install keyboard')
print("\r""installing keyboard",end='')
# displays x and y coordinates of mouse updating in console without multiple lines
def get_pos():
pos = pyautogui.position()
print("\r", pos, end="")
q = (keyboard.is_pressed("q"))
While q is False:
print("[+] Detected breakpoint ..... Exiting.")
get_pos()
if q is True:
break