Skip to content

rowdyghostz/RunPyScript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silent Python Script Launcher

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.

Features

  • 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

Installation

  1. Clone the repository:
git clone https://github.com/yourusername/RunPyScript.git
cd RunPyScript
  1. Install dependencies:
pip install -r requirements.txt

Usage

Running from Source

python silent_launcher.py <script_path> [script_arguments]

Examples

  1. Run a basic script:
python silent_launcher.py your_script.py
  1. Run a script with arguments:
python silent_launcher.py your_script.py arg1 arg2

Using the Executable

  1. Double-click the executable and select your Python script
  2. Or from command line: silent_launcher.exe your_script.py

Building the Executable

To create a standalone executable:

pyinstaller --noconsole --onefile --icon=icon.ico silent_launcher.py

The executable will be created in the dist directory.

Process Management

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

Error Handling

If any errors occur, they will be logged to error_log.txt in the same directory.

Requirements

  • Windows OS
  • Python 3.x
  • psutil>=5.9.0 (for process management)
  • PyInstaller>=6.0.0 (for building executable)

Development

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE file for more information.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages