forked from rick-lzr/yiban_Automation_tool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
41 lines (34 loc) · 1.27 KB
/
main.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
import threading
import EGPA_script_random_num
import pandas as pd
def login(username, password, puid, group_id, is_trans,article_id):
EGPA_script_random_num.login(username=username, password=password, puid=puid, group_id=group_id,is_trans=is_trans,article_id=article_id)
def func():
data = pd.read_excel("users.xlsx")
name = data.get("name")
password = data.get("password")
puid = data.get("puid")
group_id = data.get("group_id")
username = data.get("username")
is_trans = data.get("trans")
article_id = data.get("article_id")
for i in range(data.__len__()):
try:
print(username[i] + " Start")
t = threading.Thread(target=EGPA_script_random_num.login,
args=(name[i], password[i], puid[i], group_id[i], is_trans[i],article_id[i]))
# t.setDaemon(True)
t.start()
t.join(150)
except Exception as e:
print("出错了:", username[i], e)
func()
'''
# 放到服务器上可持久化运行。内存占用极小。
while True:
time_now = time.strftime("%H:%M", time.localtime()) # 刷新
print("检测了一次时间",time_now )
if time_now == "05:30": #此处设置每天定时的时间
func()
time.sleep(60)
'''