æ¥ã
ã®ããœã³ã³äœæ¥ãç¹ã«ç¹°ãè¿ãè¡ãGUIïŒã°ã©ãã£ã«ã«ãŠãŒã¶ãŒã€ã³ã¿ãŒãã§ãŒã¹ïŒæäœãèªååããããšæã£ãããšã¯ãããŸãããïŒ ð€ Pythonã«ã¯PyAutoGUI
ãšãã匷åãªã©ã€ãã©ãªããããããŠã¹ãããŒããŒãã®æäœãã¹ã¯ãªããã§å¶åŸ¡ã§ããŸããããããPyAutoGUI
ã®ã³ãŒããäžããæžãã®ã¯ã座æšã調ã¹ãããé©åãªé¢æ°ãéžãã ãããã®ãå°ãé¢åãªå ŽåããããŸãã
ããã§ç»å Žããã®ãPyAutoGUI-Recorder
ã§ãïŒ âš ãã®ããŒã«ã䜿ãã°ãå®éã®ããŠã¹æäœãããŒããŒãå
¥åãèšé²ãããããåçŸããããã®PyAutoGUI
Pythonã³ãŒããèªåã§çæããŠãããŸãã
ãã®èšäºã§ã¯ãPyAutoGUI-Recorder
ãšã¯äœãããã®ã€ã³ã¹ããŒã«æ¹æ³ãåºæ¬çãªäœ¿ãæ¹ãç¹åŸŽããããŠå©çšããäžã§ã®æ³šæç¹ãªã©ã詳ãã解説ããŠãããŸããRPAïŒRobotic Process AutomationïŒãæ軜ã«å§ãããæ¹ããPyAutoGUI
ã®åŠç¿ããŒã«ãšããŠæŽ»çšãããæ¹ã«ããããã§ãã
PyAutoGUI-Recorderãšã¯ïŒ ð€
PyAutoGUI-Recorder
ã¯ããã¹ã¯ãããäžã§ã®ããŠã¹ã®ã¯ãªãã¯æäœãããŒããŒãå
¥åãèšé²ãããããã®æäœãåçŸããPythonã³ãŒãïŒPyAutoGUI
ã¢ãžã¥ãŒã«ã䜿çšïŒãçæããããã®GUIããŒã«ã§ãã
äž»ãªæ©èœã¯ä»¥äžã®éãã§ãïŒ
- ããŠã¹ã®ã¯ãªãã¯äœçœ®ïŒåº§æšïŒã®èšé²
- ããŒããŒãå ¥åã®èšé²ïŒâ»ããŒãžã§ã³ãç°å¢ã«ãããµããŒãç¶æ³ã®ç¢ºèªãå¿ èŠïŒ
- æäœéã®åŸ
æ©æéïŒ
time.sleep()
ïŒã®èšé²ãšã³ãŒããžã®åæ - èšé²ããæäœã®åçïŒãªãã¬ã€ïŒæ©èœ
- èšé²å
容ã«åºã¥ãã
PyAutoGUI
Pythonã³ãŒãã®çæãšãã¡ã€ã«ãžã®ä¿å
ãã®ããŒã«ã¯ãPyAutoGUI
ã䜿ã£ãèªååã¹ã¯ãªããäœæã®åæ段éã§éåžžã«åœ¹ç«ã¡ãŸããç¹ã«ãGUIäžã®ã©ã®èŠçŽ ãã©ã®é çªã§ã¯ãªãã¯ããã°è¯ããããšãã£ãåºæ¬çãªæäœãããŒãçŽ æ©ãã³ãŒãåãããå Žåã«äŸ¿å©ã§ãããŸããPyAutoGUI
ã®é¢æ°ïŒäŸïŒpyautogui.click()
, pyautogui.write()
, time.sleep()
ãªã©ïŒãã©ã®ããã«äœ¿ãããããå
·äœçã«åŠã¶ããã®ææãšããŠã掻çšã§ããŸãã
å ã 㯠Axel Magardæ°ã«ãã£ãŠéçºãããGitHubäžã§å ¬éãããŠããŸãã axel-magard/PyAutoGUI-Recorder (GitHub)
PyAutoGUI-Recorder
ã¯PyAutoGUI
ã©ã€ãã©ãªãå©çšããããŒã«ã§ãããPyAutoGUI
èªäœã眮ãæãããã®ã§ã¯ãããŸãããPyAutoGUI
æ¬äœã¯ãããŠã¹ã»ããŒããŒãæäœãã¹ã¯ãªãŒã³ã·ã§ããååŸãç»åèªèãªã©ãããåºç¯ãªæ©èœãæäŸããã©ã€ãã©ãªã§ãã
ã€ã³ã¹ããŒã«æ¹æ³ ð»
PyAutoGUI-Recorder
ã¯ãç¹å®ã®pipããã±ãŒãžãšããŠæäŸãããŠããããã§ã¯ãªããGitHubãªããžããªããçŽæ¥ã¹ã¯ãªãããã¡ã€ã«ïŒPyAutoGuiRecorder.py
ïŒãããŠã³ããŒãããŠäœ¿çšããã®ãäžè¬çã§ãã
ãã ãããã®ã¹ã¯ãªãããå®è¡ããã«ã¯ãããã€ãã®äŸåã©ã€ãã©ãªãå¿ èŠã§ããäž»ã«ä»¥äžã®ã©ã€ãã©ãªãäºåã«ã€ã³ã¹ããŒã«ããŠããå¿ èŠããããŸãã
-
PyAutoGUI: ããŠã¹ã»ããŒããŒãæäœã®èªååæ¬äœã
pip install pyautogui
-
pynput: ããŠã¹ãããŒããŒãã®ã€ãã³ãïŒã¯ãªãã¯ãããŒãã¬ã¹ãªã©ïŒããªãã¹ã³ïŒç£èŠïŒããããã«äœ¿çšãããŸãã
(泚:pip install pynput
PyAutoGUI-Recorder
ã®å®è£ ã«ãã£ãŠã¯ãä»ã®å ¥åç£èŠã©ã€ãã©ãªã䜿ãããŠããå¯èœæ§ããããŸãããå€ãã®é¡äŒŒããŒã«ã§pynput
ãæ¡çšãããŠããŸãã)
ãããã®ã©ã€ãã©ãªã¯ãPythonã®ããã±ãŒãžã€ã³ã¹ããŒã©pip
ïŒãŸãã¯pip3
ïŒã䜿ã£ãŠç°¡åã«ã€ã³ã¹ããŒã«ã§ããŸããã¿ãŒããã«ïŒã³ãã³ãããã³ããïŒãéããäžèšã®ã³ãã³ããå®è¡ããŠãã ããã
äŸåã©ã€ãã©ãªãã€ã³ã¹ããŒã«ããåŸãGitHubãªããžããªããPyAutoGuiRecorder.py
ãã¡ã€ã«ãããŠã³ããŒãããä»»æã®å Žæã«ä¿åããŸãã
PyAutoGUI
ã¯ãOSã«ãã£ãŠã¯è¿œå ã®äŸåé¢ä¿ïŒç»ååŠçã©ã€ãã©ãªãªã©ïŒãå¿ èŠã«ãªãå ŽåããããŸããå ¬åŒããã¥ã¡ã³ããã€ã³ã¹ããŒã«æã®ã¡ãã»ãŒãžã確èªããŠãã ããã- macOSã§ã¯ãã»ãã¥ãªãã£ãšãã©ã€ãã·ãŒèšå®ã§ãã¿ãŒããã«ãPythonãå®è¡ããã¢ããªã±ãŒã·ã§ã³ã«å¯ŸããŠãã¢ã¯ã»ã·ããªãã£ãããç»é¢åé²ãã®æš©éãäžããå¿ èŠãããå ŽåããããŸãã
åºæ¬çãªäœ¿ãæ¹ â¶ïžâ¹ïžðŸ
PyAutoGUI-Recorder
ã®äœ¿ãæ¹ã¯éåžžã«çŽæçã§ããããŠã³ããŒãããPyAutoGuiRecorder.py
ãã¡ã€ã«ãPythonã§å®è¡ãããšãGUIãŠã£ã³ããŠã衚瀺ãããŸãã
python PyAutoGuiRecorder.py
ïŒPythonã®å®è¡ã³ãã³ãã¯ç°å¢ã«ãã£ãŠpython3
ã®å ŽåããããŸããïŒ
GUIã«ã¯éåžžã以äžã®ãããªãã¿ã³ãå«ãŸããŠããŸãïŒããŒã«ã«ãã£ãŠè¥å¹²ã®å·®ç°ã¯ãããŸãïŒïŒ
ãã¿ã³å (äŸ) | æ©èœ | 説æ |
---|---|---|
Recording / Record | èšé²éå§ | ãã®ãã¿ã³ãæŒããšãããŠã¹ã®ã¯ãªãã¯ãããŒããŒãå ¥åã®èšé²ãéå§ãããŸããèšé²ãããæäœãå®éã«è¡ã£ãŠãã ãããð±ïžâšïž |
Stop | èšé²åæ¢ | èšé²ãçµäºããŸããâ¹ïž |
Play | åç | èšé²ããäžé£ã®æäœãåçïŒãªãã¬ã€ïŒããŸããèšé²ãæ£ããè¡ããããã確èªã§ããŸããâ¶ïž |
Download / Export Code / Save | ã³ãŒãä¿å | èšé²ãããæäœã«å¯Ÿå¿ããPyAutoGUI ã®Pythonã³ãŒããçæãã.py ãã¡ã€ã«ãšããŠä¿åããŸããðŸ |
Reset (ããã°) | ãªã»ãã | èšé²å 容ãã¯ãªã¢ããŸããðïž |
æäœæé ã®äŸ
PyAutoGuiRecorder.py
ãå®è¡ããŠGUIãŠã£ã³ããŠãéããŸãã- ãRecordingããã¿ã³ãã¯ãªãã¯ããŠèšé²ãéå§ããŸãã
- èªååãããããŠã¹ã®ã¯ãªãã¯æäœãããŒããŒãå ¥åãè¡ããŸããïŒäŸïŒç¹å®ã®ã¢ããªã±ãŒã·ã§ã³ãéãããã¿ã³ãã¯ãªãã¯ããããã¹ããå ¥åããïŒ
- æäœãå®äºãããããStopããã¿ã³ãã¯ãªãã¯ããŠèšé²ãåæ¢ããŸãã
- ïŒä»»æïŒãPlayããã¿ã³ãã¯ãªãã¯ããŠãèšé²ãããæäœãæå³éãã«åçãããã確èªããŸãã
- ãDownloadãïŒãŸãã¯é¡äŒŒã®ïŒãã¿ã³ãã¯ãªãã¯ããçæãããPythonã³ãŒãããã¡ã€ã«ïŒäŸïŒ
my_automation_script.py
ïŒãšããŠä¿åããŸãã
ã³ãã³ãã©ã€ã³ãªãã·ã§ã³
äžéšã®ããŒãžã§ã³ã§ã¯ãèµ·åæã«ã³ãã³ãã©ã€ã³ãªãã·ã§ã³ãæå®ã§ããå ŽåããããŸãã
--delay=SECONDS
: åçæã®åæäœéã®åŸ æ©æéãåºå®å€ïŒç§ïŒã§æå®ããŸãã--recordMoves
: ã¯ãªãã¯ã ãã§ãªããããŠã¹ã®ç§»åïŒåº§æšã®å€åïŒãèšé²å¯Ÿè±¡ã«å«ããŸããããã«ããããã詳现ãªåããèšé²ã§ããŸãããçæãããã³ãŒããé·ããªãå¯èœæ§ããããŸãã
ãããã®ãªãã·ã§ã³ãå©çšå¯èœãã©ããã¯ãpython PyAutoGuiRecorder.py --help
ãå®è¡ãããããœãŒã¹ã³ãŒãã確èªããŠãã ããã
çæãããã³ãŒãã®äŸ ð
PyAutoGUI-Recorder
ãçæããã³ãŒãã¯ãèšé²ãããæäœãPyAutoGUI
ã®é¢æ°åŒã³åºãã«å€æãããã®ã§ãã以äžã¯ç°¡åãªäŸã§ãã
import pyautogui
import time
# äŸ: ã¡ã¢åž³ãéããããã¹ããå
¥åããä¿åããæäœãèšé²ããå Žå
# æäœéã®åŸ
æ©æé (èšé²ãããæé)
time.sleep(1.5)
# ã¹ã¿ãŒãã¡ãã¥ãŒãã¯ãªã㯠(座æšã¯äŸ)
pyautogui.click(x=50, y=1050)
time.sleep(0.8)
# 'notepad'ãšå
¥å
pyautogui.write('notepad')
time.sleep(0.5)
# EnterããŒãæŒã
pyautogui.press('enter')
time.sleep(2.0) # ã¡ã¢åž³ã®èµ·ååŸ
ã¡
# ã¡ã¢åž³ãŠã£ã³ããŠå
ã§ã¯ãªã㯠(座æšã¯äŸ)
pyautogui.click(x=500, y=300)
time.sleep(0.3)
# ããã¹ããå
¥å
pyautogui.write('Hello from PyAutoGUI-Recorder!', interval=0.1) # intervalã§å
¥åé床調æŽ
time.sleep(1.0)
# Ctrl + S (ä¿å) ã®ãããããŒ
pyautogui.hotkey('ctrl', 's')
time.sleep(1.5) # ä¿åãã€ã¢ãã°è¡šç€ºåŸ
ã¡
# ãã¡ã€ã«åãå
¥å
pyautogui.write('my_recorded_note.txt')
time.sleep(0.5)
# EnterããŒãæŒããŠä¿å
pyautogui.press('enter')
time.sleep(1.0)
# Alt + F4 (éãã) ã®ãããããŒ
pyautogui.hotkey('alt', 'f4')
ãã®ã³ãŒããèŠããšã以äžã®ç¹ãããããŸãã
import pyautogui
ãšimport time
ãåé ã«å«ãŸããã- ããŠã¹ã®ã¯ãªãã¯ã¯
pyautogui.click(x=..., y=...)
ã§è¡šãããã - ããŒããŒãå
¥åã¯
pyautogui.write('...')
ãpyautogui.press('...')
ã§è¡šãããã - ã·ã§ãŒãã«ããããŒã¯
pyautogui.hotkey('...', '...')
ã§è¡šãããã - æäœéã®æéã¯
time.sleep(...)
ã§è¡šãããã
çæãããã³ãŒãã¯ãããŸã§åºæ¬çãªéªšçµã¿ã§ããå€ãã®å Žåããã®ãŸãŸå®è¡ããã ãã§ãªãã以äžã®ãããªèª¿æŽãæ¹è¯ãå¿ èŠã«ãªããŸãã
- åŸ
æ©æéã®èª¿æŽ: ã¢ããªã±ãŒã·ã§ã³ã®å¿çé床ãªã©ã«å¿ããŠ
time.sleep()
ã®å€ã調æŽããã - 座æšã®èª¿æŽ: ç»é¢è§£å床ããŠã£ã³ããŠäœçœ®ãå€ãããšåº§æšãããããããåºå®åº§æšã§ã¯ãªãç»åèªè (
pyautogui.locateOnScreen()
ãªã©) ã䜿ãããã«å€æŽããã - ãšã©ãŒãã³ããªã³ã°ã®è¿œå : äºæãã¬ãšã©ãŒïŒèŠçŽ ãèŠã€ãããªããªã©ïŒã«å¯ŸåŠããããã®
try-except
ãããã¯ãè¿œå ããã - ããžãã¯ã®è¿œå : æ¡ä»¶åå² (
if
æ) ãã«ãŒã (for
æ,while
æ) ãè¿œå ããŠãããè€éãªèªååãå®çŸããã - å¯èªæ§ã®åäž: ã³ã¡ã³ããè¿œå ããããé¢æ°åãããããŠãã³ãŒããåãããããããã
PyAutoGUI-Recorder
ã¯ãèªååã¹ã¯ãªããäœæã®ãäžæžãããäœãããŒã«ãšèãããšè¯ãã§ããããçæãããã³ãŒããå
ã«ãããå
ç¢ã§æè»ãªã¹ã¯ãªãããžãšæçŽãããŠããããšãéèŠã§ãã
ç¹åŸŽãšã¡ãªãã ð
PyAutoGUI-Recorder
ãå©çšããããšã«ã¯ãããã€ãã®ã¡ãªããããããŸãã
-
ç°¡åãªã¹ã¯ãªããçæ: å®éã®æäœãèšé²ããã ãã§ã
PyAutoGUI
ã®åºæ¬çãªã³ãŒããèªåçæããããããã³ãŒãã£ã³ã°ã®æéãå€§å¹ ã«çããŸããç¹ã«ã座æšã®ååŸãåºæ¬çãªé¢æ°åã®ç¢ºèªãäžèŠã«ãªããŸããð -
PyAutoGUIã®åŠç¿ããŒã«ãšããŠ: èªåãèšé²ããæäœãã©ã®ããã«
PyAutoGUI
ã®ã³ãŒãã«å€æãããããèŠãããšã§ãã©ã€ãã©ãªã®åºæ¬çãªäœ¿ãæ¹ãçŽæçã«ç解ã§ããŸããð - è¿ éãªãããã¿ã€ãã³ã°: ç°¡åãªç¹°ãè¿ãäœæ¥ã®èªååã§ããã°ãã¬ã³ãŒããŒã§èšé²ããå°ãæçŽãããã ãã§ãããã«èªååã¹ã¯ãªããã®ãããã¿ã€ããäœæã§ããŸããâ±ïž
- GUIã«ããçŽæçãªæäœ: ã³ãŒãã£ã³ã°ã«æ £ããŠããªã人ã§ããGUIãéããŠèŠèŠçã«æäœãèšé²ã»åçã§ãããããèªååã®ããŒãã«ãäžãããŸããð±ïž
- æäœéã®æéãèšé²: ã¯ãªãã¯ãå ¥åã ãã§ãªãããã®éã®åŸ æ©æéãèšé²ããŠããããããå®éã®æäœã«è¿ãã¿ã€ãã³ã°ã§ã¹ã¯ãªãããåçŸã§ããŸããïŒãã ããåŸè¿°ã®éã調æŽãå¿ èŠãªå Žåãå€ãã§ãïŒâ³
å¶éäºé ãšæ³šæç¹ â ïž
䟿å©ãªPyAutoGUI-Recorder
ã§ãããããã€ãã®å¶éäºé
ã泚æç¹ãååšããŸãã
-
座æšäŸåæ§ã®é«ã: çæãããã³ãŒãã¯ãåºæ¬çã«èšé²æã®ããŠã¹åº§æšã«äŸåããŸããç»é¢è§£å床ããŠã£ã³ããŠã®ãµã€ãºãäœçœ®ãå€ãããšãã¹ã¯ãªãããæ£ããåäœããªããªãå¯èœæ§ãé«ãã§ããããå
ç¢ãªã¹ã¯ãªããã«ããã«ã¯ãç»åèªè (
pyautogui.locateOnScreen()
) ãªã©ã䜿ãããã«æåã§ä¿®æ£ããå¿ èŠããããŸããð - ããŒããŒãå ¥åã®å¶é: è€éãªããŒããŒãæäœïŒç¹æ®ããŒã®çµã¿åããããèšèªå ¥ååãæ¿ããªã©ïŒãæ£ç¢ºã«èšé²ã»åçŸãããªãå ŽåããããŸããç¹ã«ãGitHubãªããžããªã®èª¬æã§ã¯Windowsã§ã®ãããããŒæ€åºã«åé¡ããããšèšèŒãããŠããããšããããŸããâšïžâ
- åçãªUIãžã®å¯Ÿå¿äžå¯: ç»é¢èŠçŽ ãåçã«å€åãããããªã¢ããªã±ãŒã·ã§ã³ïŒäŸïŒãŠã§ãããŒãžã®èªã¿èŸŒã¿ã«ãã£ãŠãã¿ã³ã®äœçœ®ãå€ããïŒã«ã¯ãèšé²ãã座æšã ãã§ã¯å¯Ÿå¿ã§ããŸãããç»åèªèãä»ã®GUIèŠçŽ ç¹å®æ¹æ³ãžã®å€æŽãå¿ èŠã§ããð
-
ãšã©ãŒãã³ããªã³ã°ã®æ¬ åŠ: çæãããã³ãŒãã«ã¯ãéåžžãšã©ãŒãã³ããªã³ã°ïŒ
try-except
ãªã©ïŒãå«ãŸããŠããŸãããäºæãã¬ç¶æ³ïŒã¯ãªãã¯å¯Ÿè±¡ãèŠã€ãããªããã¢ããªã±ãŒã·ã§ã³ãå¿çããªããªã©ïŒãçºçããå Žåãã¹ã¯ãªããããšã©ãŒã§åæ¢ããŠããŸããŸããð¡ïž -
èšé²ãããªãæäœ: ããŠã¹ã®ãã©ãã°ïŒãããããã¹ã¯ããŒã«æäœãªã©ãäžéšã®
PyAutoGUI
æ©èœã«å¯Ÿå¿ããæäœãèšé²ãããªãããŸãã¯æ£ç¢ºã«åçŸãããªãå ŽåããããŸãã - ãããã°ã®å¿ èŠæ§: çæãããã³ãŒãã¯ãããŸã§ãäžæžããã§ãããå€ãã®å Žåããã®ãŸãŸã§ã¯å®çšã«èããŸãããå¿ ãã³ãŒãã確èªãããããã°ãæ¹è¯ãè¡ãå¿ èŠããããŸããð
- éçºã»ã¡ã³ããã³ã¹ç¶æ³: ãªãŒãã³ãœãŒã¹ã®ããŒã«ã§ãããããéçºã掻çºã§ãªãå Žåããææ°ã®OSã»ã©ã€ãã©ãªããŒãžã§ã³ã«å¯Ÿå¿ããŠããªãå¯èœæ§ããããŸããå©çšåã«ãªããžããªã®æçµæŽæ°æ¥ãªã©ã確èªãããšè¯ãã§ããããð
-
PyAutoGUIèªäœã®å¶é:
PyAutoGUI
æ¬äœãæã€å¶éïŒäŸïŒäžéšã®ã²ãŒã ãDirectXã䜿çšããã¢ããªã±ãŒã·ã§ã³ã§ã¯åäœããªãå Žåãããããã©ã€ããªã¢ãã¿ãŒã®ã¿å¯Ÿå¿ãªã©ïŒã¯ãã¬ã³ãŒããŒã§çæããã³ãŒãã«ãåŒãç¶ãããŸãã
PyAutoGUI
ã®ããã«ããŠã¹ãããŒããŒããçŽæ¥æäœãããã®ã¯ãæå³ããªãåäœãããå¯èœæ§ããããŸããPyAutoGUI
ã«ã¯ãã§ã€ã«ã»ãŒãæ©èœïŒããŠã¹ã«ãŒãœã«ãç»é¢ã®é
ã«ç§»åããããšç·æ¥åæ¢ããïŒãããã©ã«ãã§æå¹ã«ãªã£ãŠããŸãããPyAutoGUI-Recorder
ã§çæã»å®è¡ããéã«ã¯ãäºæãã¬åäœã«åãããã€ã§ãæåã§åæ¢ã§ãããã泚æããŠãã ãããð
PyAutoGUIãšã®é¢ä¿æ§ ð€
ããã§æ¹ããŠãPyAutoGUI
ãšPyAutoGUI-Recorder
ã®é¢ä¿ãæŽçããŠãããŸãããã
- PyAutoGUI: Pythonã§ããŠã¹ã»ããŒããŒãæäœãèªååããããã®ã©ã€ãã©ãªæ¬äœã§ããæ§ã ãªé¢æ°ïŒã¯ãªãã¯ã移åãå ¥åãã¹ã¯ãªãŒã³ã·ã§ãããç»åèªèãªã©ïŒãæäŸããŸããããã䜿ã£ãŠããã°ã©ããŒãã³ãŒããæžãããšã§ãGUIæäœãèªååããŸãã
-
PyAutoGUI-Recorder:
PyAutoGUI
ã©ã€ãã©ãªãå©çšããŠããŠãŒã¶ãŒãè¡ã£ãããŠã¹ã»ããŒããŒãæäœãèšé²ãããããåçŸããããã®PyAutoGUI
ã³ãŒããçæããããŒã«ã§ãã
ã€ãŸããPyAutoGUI-Recorder
ã¯PyAutoGUI
ã¹ã¯ãªããäœæãè£å©ããããã®ãŠãŒãã£ãªãã£ã§ãããPyAutoGUI
ã®æ©èœã®äžéšïŒäž»ã«åº§æšããŒã¹ã®ã¯ãªãã¯ãå
¥åïŒãç°¡åã«ã³ãŒãåããæ段ãæäŸããŸããPyAutoGUI-Recorder
åäœã§é«åºŠãªèªååããç»åèªèã®ãããªæ©èœã䜿ãããšã¯ã§ããŸãããããããå®çŸããã«ã¯ãçæãããã³ãŒããå
ã«PyAutoGUI
ã®ä»ã®é¢æ°ã䜿ã£ãŠæåã§ã³ãŒããæ¡åŒµããå¿
èŠããããŸãã
掻çšã·ããªãª âš
PyAutoGUI-Recorder
ã¯ã以äžã®ãããªå Žé¢ã§ç¹ã«åœ¹ç«ã¡ãŸãã
- åçŽãªç¹°ãè¿ãäœæ¥ã®èªåå: ç¹å®ã®ãã¿ã³ãé çªã«ã¯ãªãã¯ããããã©ãŒã ã«æ±ºãŸã£ãå€ãå ¥åãããªã©ã座æšãåºå®ãããç°å¢ã§ã®åçŽãªç¹°ãè¿ãäœæ¥ã®ã¹ã¯ãªãããçŽ æ©ãäœæãããå Žåã
-
PyAutoGUIåŠç¿ã®ç¬¬äžæ©ãšããŠ:
PyAutoGUI
ãåŠã³å§ããã°ããã§ãåºæ¬çãªé¢æ°ã®äœ¿ãæ¹ã座æšã®æå®æ¹æ³ãå ·äœäŸã§ç¢ºèªãããå Žåã - èªååã¹ã¯ãªããã®é圢äœæ: ããè€éãªèªååã¹ã¯ãªãããäœæããéã«ãæåã®éªšçµã¿ãšãªãæäœãããŒãã¬ã³ãŒããŒã§èšé²ãããããå ã«ç»åèªèãæ¡ä»¶åå²ãªã©ãè¿œå ããŠããå Žåã
-
座æšã®ããããã€ãã: ç¹å®ã®ãã¿ã³ãå
¥åãã£ãŒã«ãã®ããããã®åº§æšã調ã¹ãããã«äžæçã«äœ¿ãå ŽåãïŒãã ãã
pyautogui.displayMousePosition()
ãªã©ã®å°çšæ©èœã®æ¹ãæ£ç¢ºã§ãïŒ
äŸãã°ãç¹å®ã®ãã©ã«ããéããŠããã¡ã€ã«ããªããŒã ããå¥ã®ãã©ã«ãã«ç§»åããããšãã£ãäžé£ã®æ±ºãŸã£ãæäœãæ¯æ¥è¡ãå¿
èŠãããå ŽåãPyAutoGUI-Recorder
ã§äžåºŠæäœãèšé²ããçæãããã³ãŒããå°ã調æŽããã°ããã¿ã³äžã€ã§ãã®äœæ¥ãå®è¡ã§ããããã«ãªããããããŸãããð
ãŸãšã ð
PyAutoGUI-Recorder
ã¯ãããŠã¹ãããŒããŒãã®æäœãèšé²ãããããåçŸããããã®PyAutoGUI
Pythonã³ãŒããèªåçæãã䟿å©ãªGUIããŒã«ã§ããç¹ã«ãPyAutoGUI
ã䜿ã£ãGUIãªãŒãã¡ãŒã·ã§ã³ã®å
¥éããåçŽãªç¹°ãè¿ãäœæ¥ã®ã¹ã¯ãªããäœæã®è£å©ãšããŠåœ¹ç«ã¡ãŸãã
ãã ããçæãããã³ãŒãã¯åº§æšã«åŒ·ãäŸåããŠããããã®ãŸãŸã§ã¯ç°å¢ã®å€åã«å¯Ÿå¿ã§ããªãããšãå€ãç¹ããšã©ãŒãã³ããªã³ã°ãå«ãŸããŠããªãç¹ãªã©ãããã€ãã®å¶éäºé
ããããŸãããããã£ãŠãPyAutoGUI-Recorder
ã¯èªååã¹ã¯ãªããã®ãäžæžããããåŠç¿ããŒã«ããšäœçœ®ã¥ããçæãããã³ãŒããå
ã«ãããå
ç¢ã§å®çšçãªã¹ã¯ãªãããžãšæåã§æ¹è¯ããŠããããšãéèŠã§ãã
PyAutoGUI
ãšçµã¿åãããããšã§ãé¢åãªGUIæäœã®èªååãæ軜ã«å§ããããšãã§ããŸãããã²äžåºŠè©ŠããŠã¿ãŠãæ¥ã
ã®äœæ¥å¹çåã«åœ¹ç«ãŠãŠã¿ãŠã¯ãããã§ãããããð
ã³ã¡ã³ã