Skip to content

Instantly share code, notes, and snippets.

@marcelobbfonseca
Last active April 1, 2021 02:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcelobbfonseca/f96651cf4ab9993cf83cf3ac0c693163 to your computer and use it in GitHub Desktop.
Save marcelobbfonseca/f96651cf4ab9993cf83cf3ac0c693163 to your computer and use it in GitHub Desktop.
Python april fool prank
# pip install pyautogui
# pip install pyobjc-core
# pip install pyobjc
# python3 software_update.py
# Opens baby shark And mouse will freak out.
import time
import random
import pyautogui
import webbrowser
def move_mouse(how_long_in_seconds):
start_time = time.time()
time_elapsed = time.time() - start_time
xsize, ysize = pyautogui.size()
while time_elapsed < how_long_in_seconds:
x, y = random.randrange(xsize), random.randrange(ysize)
pyautogui.moveTo(x, y, duration=0.2)
time_elapsed = time.time() - start_time
if __name__ == "__main__":
pyautogui.alert("Your Java update is now complete")
webbrowser.open("https://youtu.be/_5pQgwB4O6A")
move_mouse(120)
@marcelobbfonseca
Copy link
Author

add this change to be an ass:

    try:
        move_mouse(120)
    except pyautogui.FailSafeException:
    	move_mouse(120)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment