-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata_load.py
48 lines (34 loc) · 1.01 KB
/
data_load.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import win32gui
import pyautogui
import time
win_2 = "Backlog list"
win_3 = "ABAP: Variant Directory of Program ZWRUECKSTAND_MX"
delay = 2
def press_key(t, key, count):
time.sleep(t)
pyautogui.press(key, presses=count)
def text_input(t, text):
time.sleep(t)
pyautogui.typewrite(text)
def press_hotkey(t, args):
time.sleep(t)
pyautogui.hotkey(*args)
def find_win_and_set_foreground(window):
while True:
whnd = win32gui.FindWindowEx(None, None, None, window)
if not (whnd == 0):
time.sleep(3)
win32gui.SetForegroundWindow(whnd)
break
def sap_update():
find_win_and_set_foreground(win_2)
press_hotkey(delay, ['shift', 'f5'])
find_win_and_set_foreground(win_3)
press_key(delay, 'right', 3)
find_win_and_set_foreground(win_3)
press_key(delay, 'f2', 1)
find_win_and_set_foreground(win_2)
press_key(delay, 'f8', 1)
def reloads():
find_win_and_set_foreground(win_2)
press_key(delay, 'f8', 1)