I'll start by saying that after years of programming, my favorite language is C/C++, even though I am proficient with all desktop and web programming languages. I also have to acknowledge that Python is today one of the simplest, most efficient, and intuitive interpreted languages available. Some of you or many of you might disagree and might prefer Java among interpreted languages. However, for the speed of writing code and ease of learning, I believe Python has no rivals.
I wanted to make this preamble because Python is powerful, it is cross-platform, but it also hides some small pitfalls. Using Python with the serial port is typically done with the PySerial library, which is not included in the base installation of Python and needs to be imported. It is still a programming language, and for the graphical user interface part, you always have to improvise a bit.
This is where SerialTool and Python comes in and makes life easier. If you want to write your own program for the serial port without complicating things with graphical libraries, packet visualization, data sending, and all that entails, SerialTool combined with Python is the answer.
Let's start by saying that it is the only program (at the time of writing this document) that supports Python scripting. Other software I have tried uses a wrapper with JavaScript (not Java) or VBA. Regarding JavaScript, I don't think it's ideal since it is mostly used for the client-side part of web-based applications. I understand that since there are libraries that interpret JavaScript in C, it was the quickest choice to claim that their serial port software uses scripting through a JSCPP library. As for VBA (Visual Basic for Applications), I think it is overly outdated and anachronistic to still discuss it.
That said, Python is truly the ideal language for integrating scripting within an application. Let's make a preface on how SerialTool integrates Python for detail lovers. Python allows itself to be embedded within software written in C++ to execute arbitrary code, essentially running a program within another program. To read more about this, you can refer to Python Embedded at this link.
I believe the developers of SerialTool have embraced this philosophy, which allows any Python script to be launched from their application. There remains a problem of creating a bridge between SerialTool and Python. Analyzing the official documentation of SerialTool and Python, it is clear that they have developed a specific library in Python for managing the serial port (different, of course, from PySerial), which offers some function calls present in SerialTool. Essentially, it is a real library that needs to be imported (but is already integrated into the main software) and provides some functions that allow the visualization of serial port traffic directly in SerialTool, thus eliminating the need to create your own graphical interface.
Having said all this, what is the purpose of doing this and who might need Python within a serial port program? The sharpest among you might have already guessed where I am going, but let's get there together step by step. SerialTool already offers a wide range of functions, but for example, if we want to write our own program that performs specific computations upon receiving a specific buffer from the serial port, we cannot do it. Let's imagine a practical example of sending a file via the serial port. Sure, SerialTool already makes this possible, but we want to create our own custom program. In this case, we can open the serial port with the SerialTool library, load our file directly in Python, and send it through the serial port opened with SerialTool to our remote device.
In this way, we will have created our very own Python program that uses SerialTool as the graphical interface and manages the serial port. All this quickly, using the extensive documentation available for Python file management, and in a heartbeat, we have our script ready, which we can share with colleagues or publish directly. Clearly, Python is available for Windows, MacOS, and Linux, so we don't have to worry about the operating system since SerialTool is a cross-platform software just like Python.
Personally, among the various functions that SerialTool offers, I believe this is one of the most interesting, if not the most interesting. It is certainly unique and not found in other serial port software. For schools, universities, and hobbyists, the combination of Python with SerialTool is definitely a game-changer because it allows you to quickly write software from scratch for the serial port using the graphical interface of SerialTool.
I was about to omit that your Python script allows you to simultaneously use other functionalities of SerialTool, such as alarms or sending serial port traffic over TCP. From what I have understood and tried, the key point is that every packet sent or received using the SerialTool library in Python is converted into a packet and managed as such by the main interface. For this reason, all the special functions of SerialTool remain available simultaneously, so we effectively have full control of SerialTool's graphical interface as a real working tool.
Isn't it an amazing or an everglow?