How to Make a Macro in Python with Keystrokes and Clicks | Python Tutorial

preview_player
Показать описание
How to Make a Macro in Python with Keystrokes and Clicks! Beginner Python Tutorial. First time building macros in Python? Awesome. We take a guided, step-by-step approach to create a Macro.

*** You must install the package we're using, pyautogui ***
1. open a command window or terminal
- WIN10: cmd
- PyCharm: terminal at bottom of IDE
2. type: pip3 install pyautogui
3. try running your code again

CHAPTERS
0:00 Intro
2:05 Python overview
2:56 Import Packages (pyautogui)
4:34 User Inputs
10:15 Use Pyautogui
12:20 Get Cursor Location
14:10 Automate Clicks
19:57 Automate Keyboard Typing
22:40 Automate Pressing Buttons on Keyboard
29:58 Full Demo

Before Watching:

Further Help

Enter comments below and I will do my best to help!
Please like and subscribe to support this channel :)

Рекомендации по теме
Комментарии
Автор

this was by far one of the most helpful vids I've found, thanks for sharing :D

luisdiegoaguilar
Автор

after a long serch on the internet i came across your video. it's really good

azim
Автор

nice Video Phil, keep up the great work

felix
Автор

How does this guy have merely 2 subscribers?

vlizxr
Автор

That was much more helpful than the three min vid. Now how do you map that to a Macro button?

Thataliah
Автор

hello i have a question when i run the script it suddenly stops when i change to another window in the taskbar and doesn't complete the rest of the code what could be the issue? (i'm using VS Code) thank you for the tutorial btw.

wass
Автор

Quick question would this video work for vs code

Blast_monarchde
Автор

Hey Phil! Quick question is there a way to hold down a letter like "a" for some time?

mirx
Автор

Hello, is there a way to hold down a button on the mouse or keyboard?

marcmendl
Автор

when ever i try to import pyautogui, it says that theres no module named pyautogui

scyye-gaming
Автор

I'd like to record specific mouse and keyboard movements then save it. everytime I run the code, I want to get that specific movements. I do not want to record it everytime.
How can i do it? This is my code.

import threading
import mouse
import keyboard



mouse_events = []



keyboard.start_recording()

keyboard.wait("shift")


keyboard_events = keyboard.stop_recording()

#Keyboard threadings:

k_thread = threading.Thread(target = lambda
k_thread.start()

#Mouse threadings:

m_thread = threading.Thread(target = lambda :mouse.play(mouse_events))
m_thread.start()

#waiting for both threadings to be completed

k_thread.join()
m_thread.join()

JeaMoN
Автор

How to make it work on others pc with different sized monitor

karma
Автор

I don't know why but I can't find the cursor position.
I have pyautogui

mrmanmann
Автор

can someone make it so that I press a key for a certain time

bruh_
join shbcf.ru