A utility to run Python scripts silently without showing the terminal window. Perfect for running GUI applications or background scripts. Includes proper process management to ensure no orphaned processes are left running.
- Runs Python scripts without showing a terminal window
- Supports GUI applications (PyQt, tkinter, etc.)
- Forwards command line arguments to the target script
- Provides error logging
- Works with both development and PyInstaller bundled environments
- Ensures proper cleanup of all child processes on exit
- Handles SIGTERM and SIGINT signals gracefully
- Clone the repository:
git clone https://github.com/yourusername/RunPyScript.git
cd RunPyScript- Install dependencies:
pip install -r requirements.txtpython silent_launcher.py <script_path> [script_arguments]- Run a basic script:
python silent_launcher.py your_script.py- Run a script with arguments:
python silent_launcher.py your_script.py arg1 arg2- Double-click the executable and select your Python script
- Or from command line:
silent_launcher.exe your_script.py
To create a standalone executable:
pyinstaller --noconsole --onefile --icon=icon.ico silent_launcher.pyThe executable will be created in the dist directory.
The launcher includes robust process management that:
- Tracks all child processes of the launched script
- Properly terminates all processes when the main application exits
- Handles system signals (SIGTERM, SIGINT) for clean shutdown
- Prevents orphaned processes from running in the background
If any errors occur, they will be logged to error_log.txt in the same directory.
- Windows OS
- Python 3.x
- psutil>=5.9.0 (for process management)
- PyInstaller>=6.0.0 (for building executable)
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Distributed under the MIT License. See LICENSE file for more information.
Contributions are welcome! Please feel free to submit a Pull Request.