京东抢券活动
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

57 lines
1.4 KiB

from wx import get_user_message, listen_msg
from jd_client import JdClient
import multiprocessing, threading
device_list = ['127.0.0.1:16416',
'127.0.0.1:16448']
# device_list = ['127.0.0.1:16416',
# '127.0.0.1:16448',
# '127.0.0.1:16480',
# '127.0.0.1:16512',
# '127.0.0.1:16544',
# '127.0.0.1:16576',
# '127.0.0.1:16608',
# '127.0.0.1:16640']
listen_list = ['Honey', '分身199']
# listen_list = ['Honey']
# for device in device_list:
# print(f'设备:{device}')
# jd_client = JdClient(device)
# jd_client_list.append(jd_client)
port = 4723
device_obj_list = []
for device in device_list:
print(device)
jd_client = JdClient(device)
device_obj_list.append(jd_client)
for i, jd_client in enumerate(device_obj_list):
sub_port = port + i*2
print(i, sub_port)
jd_client.initial_device(sub_port)
# t = threading.Thread(target=jd_client.initial_device, args=(sub_port,))
# t.start()
msg = listen_msg(listen_list, '玩具乐器五折券')
print('准备完成,等待消息')
process_list = []
for jd_client in device_obj_list:
# p = multiprocessing.Process(target=jd_client.do, args=({'msg':msg},))
t = threading.Thread(target=jd_client.do, args=({'msg':msg},))
t.start()
# process_list.append(p)
# for p in process_list:
# p.join()
print('-----------------------------------')