Develop message push reminder based on enterprise WeChat API Python and Java

1. About the script

As a programmer, no matter what kind of development you are engaged in, learning to use a scripting language can improve your development efficiency. I currently use Python because it supports many libraries and can be used out of the box. In this fast-paced development, it is very efficient, so I highly recommend it. Even if you are not engaged in the software industry and are a novice, it is not a bad idea as an enlightenment language. I think it can be regarded as the simplest scripting language among development languages. It can do batch processing, big data, artificial intelligence, websites, servers, and even desktop applications. The Python training ads I saw on Douyin before generally promoted document processing and automated office work, so it is really a language that is very suitable for processing batch processing tasks, but it is not very complicated! Next, let you see how I quickly develop a desktop application!

 

2.Environment setup

2.1 Python environment, download the Python version online and install it

Windows教程:https://blog.csdn.net/weixin_40844416/article/details/80889165

Mac tutorial: https://www.cnblogs.com/linxue/p/10097785.html

edit tool:pycharm

 

3. Enterprise WeChat API

3.1 Why is this development needed? Prospects and benefits?

First of all, it is produced by Tencent, which is safe, stable and guaranteed. The most important thing is that it is free to use. Personnel engaged in server backend development or operation and maintenance usually receive alerts via email or alarm reminders from cloud service providers. Either it’s not very timely, it requires payment, or it’s inconvenient. It would be very convenient if the reminder could be done through an application like WeChat. But it is a pity that Tencent does not provide WeChat API interface. Although there is WeChat protocol on the Internet, it basically requires a fee. It is better to use enterprise WeChat, which is free and has similar functions and is also very powerful. As shown in the picture below, it can currently be integrated into the system. When testers upload report information, the API interface of Enterprise WeChat will be called to automatically send it to the Enterprise WeChat group chat, including pictures, files, and text descriptions in Markdown format.

 

3.2 How to develop

As a developer, I strongly recommend that you read the official documentation for development. Server-side development

If you need code, you can leave a message and I will publish it when I have time, including the Python version and Java version of the code.

 

3.3 Misunderstandings in Enterprise WeChat Development

First of all,its api interface operates the group chat interface, and it must be a group chat created by code before it can be operated. Group chats created on the Enterprise WeChat App cannot be operated.

 

4. Desktop application development based on Python

4.1 Is desktop application development difficult?

For those who have not developed desktop applications, it may be difficult. But for the friends in the previous paragraph, you can use other techniques, such as web nested web pages. If you are interested and want to develop desktop applications, you can refer to: Python3+Pycharm+PyQt5 environment setup steps

Once the framework is set up, it is really not difficult to develop applications!

Let me give you an example. I am actually a Java developer, and one day my superiors arranged to develop a debugging desktop software to upload and record debugging information in conjunction with the hardware. Then everyone should be able to see the information in real time. Then I went to find information. The architecture of the desktop application has been mentioned abovePython3+Pycharm+PyQt5. Real-time message sending and receiving uses the enterprise WeChat API. In the end, this proposal was passed, and today’s blog is created.

Nothing is difficult in the world, I'm afraid you have given up before you even start. When you encounter a field or development that you are not good at, first check the information, find a solution, and finally develop it.

 

4.2 Interface writing

The current interface is created through drag and drop through the Qt Creator tool. Time is money (lazy)! The interface effect is at the end.

Interface writing, for novices, you have to read the documentation and do it while reading. It is a bit time-consuming, but if there is a way to quickly develop an interface, simple and beautiful, visual interface operation, drag and drop to generate layout, then it comes to Qt Creator.

You can open the  .ui file with Qt Creator, and you can design it.

        #具体的其他控件的其他操作请百度 QT5控件
        #解释:控件id为s2__clear_button_3 绑定了点击事件为sendMsg()
        self.s2__clear_button_3.clicked.connect(self.sendMsg)
        #解释:控件id为checkBox 设置为点击
        self.checkBox.setCheckState(2)

        self.pushButton.clicked.connect(self.createMsgGroup)
        self.pushButton_3.clicked.connect(self.openUrl)
        # 解释:控件id为comboBox 绑定选择事件
        self.comboBox.currentIndexChanged.connect(self.changeEvents)

After is designed, it needs to be converted into a .py file, because Python only recognizes .py files. Reference:https://blog.csdn.net/weixin_41598714/article/details/105623419

By command:python -m PyQt5.uic.pyuic file name.ui -o convert file name.py

5. Effect

There is no function to get the ID list yet. Don’t ask why. The official answer is that this interface is not provided and you need to save it yourself every time you create a group chat.

6. Code resources

Python版本:https://download.csdn.net/download/u014632228/13650978

Java version: I’ve been a little busy lately, I’ll update depending on the situation!

 

Guess you like

Origin blog.csdn.net/u014632228/article/details/111040686