Created
February 7, 2024 05:59
-
-
Save namakemono22/dd9342f1667cf9e39809046f43010463 to your computer and use it in GitHub Desktop.
python 作業自動化
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pyautogui | |
pyautogui.position() #マウスの現在位置を取得 | |
pyautogui.click(100, 100) #x=100,y=100をクリック | |
pyautogui.doubleClick() #ダブルクリック | |
pyautogui.mouseDown() #左クリックを押しっぱなし | |
pyautogui.mouseUp() #左クリックを離す | |
pyautogui.moveTo(100, 100, 1) #絶対座標(100,100)へ1秒かけていく | |
pyautogui.move(100, 100, 1) #今いる所から+(100,100)1秒かけていく | |
pyautogui.scroll(-1000) #下に1000スクロール | |
pyautogui.press('enter') #エンターを1回ポチッ | |
pyautogui.keyDown('shift') #シフトを押しっぱなし | |
pyautogui.keyUp('shift') #シフトを離す | |
対応するキー(合ってないかも) | |
['\t', '\n', '\r', ' ', '!', '"', '#', '$', '%', '&', "'", '(', | |
')', '*', '+', ',', '-', '.', '/', '0', '1', '2', '3', '4', '5', '6', '7', | |
'8', '9', ':', ';', '<', '=', '>', '?', '@', '[', '\\', ']', '^', '_', '`', | |
'a', 'b', 'c', 'd', 'e','f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', | |
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '{', '|', '}', '~', | |
'accept', 'add', 'alt', 'altleft', 'altright', 'apps', 'backspace', | |
'browserback', 'browserfavorites', 'browserforward', 'browserhome', | |
'browserrefresh', 'browsersearch', 'browserstop', 'capslock', 'clear', | |
'convert', 'ctrl', 'ctrlleft', 'ctrlright', 'decimal', 'del', 'delete', | |
'divide', 'down', 'end', 'enter', 'esc', 'escape', 'execute', 'f1', 'f10', | |
'f11', 'f12', 'f13', 'f14', 'f15', 'f16', 'f17', 'f18', 'f19', 'f2', 'f20', | |
'f21', 'f22', 'f23', 'f24', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', | |
'final', 'fn', 'hanguel', 'hangul', 'hanja', 'help', 'home', 'insert', 'junja', | |
'kana', 'kanji', 'launchapp1', 'launchapp2', 'launchmail', | |
'launchmediaselect', 'left', 'modechange', 'multiply', 'nexttrack', | |
'nonconvert', 'num0', 'num1', 'num2', 'num3', 'num4', 'num5', 'num6', | |
'num7', 'num8', 'num9', 'numlock', 'pagedown', 'pageup', 'pause', 'pgdn', | |
'pgup', 'playpause', 'prevtrack', 'print', 'printscreen', 'prntscrn', | |
'prtsc', 'prtscr', 'return', 'right', 'scrolllock', 'select', 'separator', | |
'shift', 'shiftleft', 'shiftright', 'sleep', 'space', 'stop', 'subtract', 'tab', | |
'up', 'volumedown', 'volumemute', 'volumeup', 'win', 'winleft', 'winright', 'yen', | |
'command', 'option', 'optionleft', 'optionright'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment