Python Automation and Machine Learning for EM and ICs

An Online Book, Second Edition by Dr. Yougui Liao (2019)

Python Automation and Machine Learning for EM and ICs - An Online Book

Chapter/Index: Introduction | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z | Appendix

Subprocess-Based Graphical Launcher for Independent Python Script Execution

The scripts (code1) implements a standalone launcher user interface that triggers external Python scripts using the subprocess module, with each script executed in its own operating system process. This design decouples the launcher from the runtime behavior of the target scripts, ensuring that long-running or blocking operations do not freeze the user interface. Button events spawn background threads that invoke subprocess.Popen, enabling concurrent execution while optionally capturing and streaming standard output and error messages into a centralized log panel. The approach supports per-script argument passing, working-directory control, duplicate-run prevention, and graceful termination of selected or all running processes. Overall, Option A provides a robust, scalable, and production-safe mechanism for orchestrating multiple Python workflows from a single graphical control panel.