Skip to content

Instantly share code, notes, and snippets.

@orivej
Created March 20, 2017 03:15
Show Gist options
  • Select an option

  • Save orivej/2ba1dde6ff5237debf802d471558d199 to your computer and use it in GitHub Desktop.

Select an option

Save orivej/2ba1dde6ff5237debf802d471558d199 to your computer and use it in GitHub Desktop.
import sys
import time
import pyautogui as ui
def grow():
ui.hotkey('ctrl', 'shift', 'j')
ui.hotkey('ctrl', 'shift', 'j')
ui.hotkey('ctrl', 'pagedown')
return 0
def normalize():
w, h = ui.size()
ui.click(w/2, h/2)
ui.press('down')
ui.hotkey('shift', 'tab')
ui.press('enter')
time.sleep(1.5)
ui.hotkey('ctrl', 'pagedown')
return 0
def export(start, end):
start = int(start)
end = int(end)
time.sleep(3)
for i in range(start, end+1):
ui.hotkey('ctrl', 'shift', 'e')
time.sleep(0.1)
ui.typewrite('{:02}'.format(i))
ui.press('enter')
time.sleep(2)
ui.press('enter')
time.sleep(4)
ui.hotkey('ctrl', 'pagedown')
return 0.5
def save(start, end):
start = int(start)
end = int(end)
time.sleep(3)
for i in range(start, end+1):
ui.hotkey('ctrl', 'shift', 's')
time.sleep(0.1)
ui.typewrite('{:02}'.format(i))
ui.press('enter')
time.sleep(0.5)
ui.hotkey('ctrl', 'pagedown')
return 0.5
def apply_many(n, action, args):
time.sleep(0.5)
for i in range(n):
time.sleep(action(*args))
apply_many(
int(sys.argv[1]),
locals()[sys.argv[2]],
sys.argv[3:],
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment