第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

python微信自動回復小工具

標簽:
Python

小工具长相:


webp

直接上代码:

# -*- coding:UTF-8 -*-

import sys

from PyQt5.QtWidgets import *

from PyQt5.QtGui import *

from PyQt5.QtCore import *

import time

import itchat,time,re

from itchat.content import *

import threading

text1 = 'hello'

text2 = 'hello'

@itchat.msg_register([TEXT])

def text_reply(msg):

    itchat.send((text1), msg['FromUserName'])

@itchat.msg_register([PICTURE,RECORDING,VIDEO,SHARING])

def other_reply(msg):

    itchat.send((text2), msg['FromUserName'])

def startReply(name):

    a = itchat.auto_login(hotReload=True)

    print(a)

    itchat.run()

def stopReply():

    itchat.logout()

class FirstWindow(QWidget):

    def __init__(self):

        super(FirstWindow,self).__init__()

        self.windowUI()

    def closeEvent(self, event):

            reply = QMessageBox.question(self, '提示',

                                         "确定退出?", QMessageBox.Yes |

                                         QMessageBox.No, QMessageBox.No)

            if reply == QMessageBox.Yes:

                stopReply()

                QCoreApplication.instance().quit()

            else:

                event.ignore()

    def windowUI(self):

        self.setWindowTitle("wb")

        self.textfield()

        self.center()

    def center(self):

        qr = self.frameGeometry()

        cp = QDesktopWidget().availableGeometry().center()

        qr.moveCenter(cp)

        self.move(qr.topLeft())

    def textfield(self):

        QToolTip.setFont(QFont('SansSerif', 12))

        label1 = QLabel("文字自动回复内容:")

        self.text1 = QLineEdit()

        self.text1.setToolTip("请输入内容")

        label2 = QLabel("图片自动回复内容:")

        self.text2 = QLineEdit()

        self.text2.setToolTip("请输入内容")

        grid = QGridLayout()

        grid.setSpacing(0)

        grid.addWidget(label1, 0, 0)

        grid.addWidget(self.text1, 1, 0)

        grid.addWidget(label2, 2, 0)

        grid.addWidget(self.text2, 3, 0)

        btn_login = QPushButton("登录")

        grid.addWidget(btn_login, 4, 0, 1, 2)

        btn_exit = QPushButton("退出")

        grid.addWidget(btn_exit, 5, 0, 1, 2)

        btn_login.clicked.connect(self.autoreply)

        btn_exit.clicked.connect(self.closeEvent)

        self.setLayout(grid)

    def autoreply(self):

        global text1

        global text2

        text1 = self.text1.text()

        text2 = self.text2.text()

        self.t=threading.Thread(target=startReply,args=('1',))

        self.t.start()

if __name__ == "__main__":

    App = QApplication(sys.argv)

    ex = FirstWindow()

    ex.show()

    sys.exit(App.exec_())



作者:放纵式守候
链接:https://www.jianshu.com/p/875e5bcb1fcc


點擊查看更多內(nèi)容
TA 點贊

若覺得本文不錯,就分享一下吧!

評論

作者其他優(yōu)質文章

正在加載中
  • 推薦
  • 評論
  • 收藏
  • 共同學習,寫下你的評論
感謝您的支持,我會繼續(xù)努力的~
掃碼打賞,你說多少就多少
贊賞金額會直接到老師賬戶
支付方式
打開微信掃一掃,即可進行掃碼打賞哦
今天注冊有機會得

100積分直接送

付費專欄免費學

大額優(yōu)惠券免費領

立即參與 放棄機會
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號

舉報

0/150
提交
取消