微信发朋友圈 -- 群营销素材同步

import win32con
import win32api
import time


def click_single(tuple_xy, sleep_l=[0, 0], type_left='left'):
    x, y = tuple_xy
    win32api.SetCursorPos([x, y])
    if type_left == 'left':
        m_down, m_up = win32con.MOUSEEVENTF_LEFTDOWN, win32con.MOUSEEVENTF_LEFTUP
    win32api.mouse_event(m_down, x, y)
    time.sleep(sleep_l[0])
    win32api.mouse_event(m_up, x, y)
    time.sleep(sleep_l[1])


def click_double(tuple_xy, type_left='left'):
    x, y = tuple_xy
    win32api.SetCursorPos([x, y])
    if type_left == 'left':
        m_down, m_up = win32con.MOUSEEVENTF_LEFTDOWN, win32con.MOUSEEVENTF_LEFTUP
    win32api.mouse_event(m_down, x, y)
    win32api.mouse_event(m_up, x, y)
    win32api.mouse_event(m_down, x, y)
    win32api.mouse_event(m_up, x, y)


st = time.time()
x_file, y_file = 353, 763
click_single((x_file, y_file), [0.5, 0.5])
x, y, step_x = 230, 205, 100
x_send, y_send = 773, 865
# 注意调整微信打开的文件夹窗口的大小
for i in range(9):
    click_double((x, y))
    x += step_x
    time.sleep(0.5)
    click_single((x_file, y_file), [0.5, 0.5])
    time.sleep(0.5)
click_double((x, y))
click_single((x_send, y_send), [0.5, 0.5])

  

原文地址:https://www.cnblogs.com/rsapaper/p/8693720.html