-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexit.py
More file actions
49 lines (36 loc) · 1.08 KB
/
exit.py
File metadata and controls
49 lines (36 loc) · 1.08 KB
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
49
import subprocess
import pyautogui
import time
import pandas as pd
from datetime import datetime
# Ending the session
def sign_out():
subprocess.Popen('C:\\Windows\\system32\\Taskmgr.exe')
time.sleep(10)
# Selecting the webex app 1
terminate_1 = pyautogui.locateCenterOnScreen('webex1.png')
pyautogui.moveTo(terminate_1)
pyautogui.click()
pyautogui.click(button='right')
# End task 1
end_task = pyautogui.locateCenterOnScreen('end_task.png')
pyautogui.moveTo(end_task)
pyautogui.click()
# Selecting the webex app 2
terminate_1 = pyautogui.locateCenterOnScreen('webex2.png')
pyautogui.moveTo(terminate_1)
pyautogui.click()
pyautogui.click(button='right')
# End task 2
end_task = pyautogui.locateCenterOnScreen('end_task.png')
pyautogui.moveTo(end_task)
pyautogui.click()
# Reading the file
df = pd.read_csv('timings.csv')
while True:
now = datetime.now().strftime("%H:%M")
if now in str(df['end']):
row = df.loc[df['end'] == now]
sign_out()
time.sleep(20)
print('signed out')