Python automation Using PyautoGui || PyAutoGUI Tutorial (2022)

Опубликовано: 22 Декабрь 2022
на канале: TechWithTrivedi
154
9

In this video tutorial, about Python's Automation Using PyAutoGUI module. 🔔NEW videos, tutorials and projects EVERY week so subscribe and hit the bell button so you don't miss an update!

To Install PyAutoGUI run the command on terminal-- pip install pyautogui

Links used in this video :
➤➤ Latest Version of Python: https://www.python.org/downloads
➤➤ Visual Studio Code: https://code.visualstudio.com/download
➤➤ PyAutoGUI Documentation: https://pyautogui.readthedocs.io/en/l...

Code----
import pyautogui as pyg
import time

print(pyg.size()) #get the size of the primary window.
while True:
print(pyg.position()) #get the xy coordinate of cursor.

pyg.moveTo(114,1057,duration=1) #xy coordinate of search tab
time.sleep(2)
pyg.click() # click the mouse
time.sleep(2)
pyg.write('cmd',interval=0.5) #type the cmd with interval of 0.5
time.sleep(2)
pyg.press('enter') #press the enter key to open cmd

pyg.screenshot('my_img.png') #take screenshot and save image with any name you want.

pyg.doubleClick(35,95,interval=0.5,duration=1) #doubleclick the mouse on explorer .

pyg.alert("This is message to display.") #make an alert appear and pause the program until ok is pressed.

pyg.drag(200,0,duration=0.5) #drag the mouse right
pyg.drag(0,200,duration=0.5) #drag the mouse down
pyg.drag(-200,0,duration=0.5) #drag the mouse left
pyg.drag(0,-200,duration=0.5) #drag the mouse up

info=pyg.getActiveWindow() #get information of current window
print(info) #print informations

pyg.getWindowsWithTitle(info.title)[0].minimize() #minimize the window

pyg.hotkey('alt','f4') # hotkey is using when two key combination is requires,it Will close the window.


🔗 Social Media Links 🔗
▶️YouTube:    / @techwithtrivedi  
📝LinkedIn:   / divyansh-trivedi-1551581bb  
🌎Website - https://divyanshtrivediportfolio.netl...
📂GitHub: https://github.com/Divyansh6799


⭐️ Hashtags ⭐️
#pyautogui #pythonautomation #Coding#Programming #Tutorials #techwithtrivedi#letscode #pythonprogramming


Смотрите видео Python automation Using PyautoGui || PyAutoGUI Tutorial (2022) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь TechWithTrivedi 22 Декабрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 154 раз и оно понравилось 9 людям.