Sunday, June 9, 2019

Python Tutorial 5 - Outputting mouse location to GUI

Welcome back to another Python tutorial, in this tutorial you will learn how to output the mouse position to an alert.

First, let’s start with the previous code we made.

import time
import pyautogui

time.sleep(5)
print(pyautogui.position())

From here lets replace ‘print(pyautogui.position()’ with ‘pyautogui.alert(pyautogui.position())’.

your code should look something like this:

import time

import pyautogui

time.sleep(5)

pyautogui.alert(pyautogui.position())

Now when you run the program it should output something similar to this:

Hacking A Rise Screenshot-194

In the next tutorial, I will be showing how to use pyautogui in order to auto click.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.