Skip to main content

Configurable GUI runner for Python/Node.js scripts

Project description

GUI Runner

Project Overview

A configurable GUI runner based on Tkinter for executing Python and Node.js scripts. Supports parameter configuration, multi-language interfaces, and configuration file management. Ideal for script execution scenarios requiring graphical operations.

Key Features

  • Visual Parameter Configuration: Supports multiple parameter types including file paths, directory selection, checkboxes, and dropdown lists
  • JSON-based Configuration: Uses JSON files instead of command-line arguments for better handling of scripts with numerous parameters
  • Multi-language Support: Customizable interface text through simple configuration (English by default)
  • Configuration Management: Load/save configuration files in JSON format
  • Script Execution:
    • Automatically detects execution method based on script extension (Python/Node.js)
    • Real-time log display in sub-windows during execution
  • Cross-platform Support: Implemented using Python's standard library, compatible with Windows, macOS, and Linux systems, but requires Tkinter library to be pre-installed.

Installation

pip install gui-runner

Launch Methods

  1. Command-line launch after installation:
    gui-runner --config=config.json --dict=dict.txt
    
  2. Programmatic integration:
    import tkinter as tk
    from gui_runner import ConfigurableGUI
    
    def run_gui():
        root = tk.Tk()
        app = ConfigurableGUI(root, "dict.txt", "config.json")
        root.mainloop()
    
    if __name__ == "__main__":
        run_gui()
    

Configuration Files

  • Main configuration:config.json(specify with --config parameter)
  • Language dictionary: dict.txt (specify with --dict parameter)

Extending Functionality

  1. Adding new features:
    • Add new categories in the categories array within config.json
    • Each category can contain multiple function items (see examples)
  2. Configuring parameter interfaces:
    • Create JSON-formatted UI configuration files
    • Supported parameter types: boolean, choice, array, file, directory, string, number, integer
    • Supports parameter dependencies

Configuration File Formats

Main Configuration (config.json)

{
  "main_title": "GUI Title",
  "categories": [
    {
      "name": "Category Name",
      "description": "Category Description",
      "functions": [
        {
          "name": "Function Name",
          "description": "Function Description",
          "script": "script_path",
          "config_file": "parameter_config_path",
          "ui_config_file": "ui_config_path"
        }
      ]
    }
  ]
}

UI Configuration (function_config.json)

{
  "notes": "Important notes",
  "groups": [
    {
      "name": "Parameter Group Name",
      "parameters": [
        {
          "name": "parameter_name",
          "label": "Display Label",
          "type": "Parameter Type",
          "tip": "Tooltip Information",
          "default": "Default Value",
          "choices": ["Option1", "Option2"],  // For choice type
          "extensions": [".txt", ".csv"],    // For file type
          "item_type": "file",               // For array type
          "depends_on": "dependency_param"   // Boolean dependencies only
        }
      ]
    }
  ]
}

Language File Format

  1. Create a text file (e.g., dict.txt)
  2. Format:
    # Comments (optional)
    key_name: Translated Text
    
  3. Example (dict.txt):
    # Main window texts
    back_button: Back
    run_script_button: Run Script
    
    # Error messages
    error_title: Error
    config_format_error: Configuration format error
    

    Full key list reference: See _init_default_values method in src/ui_dict.py

Directory Structure

gui-runner/
├── src/                      # Source code
│   ├── config_manager.py     # Configuration management
│   ├── gui_main.py           # Main window
│   ├── gui_subwindow.py      # Function sub-windows
│   ├── main.py               # Entry point
│   ├── tooltip.py            # Tooltip component
│   ├── ui_dict.py            # Multi-language management
│   └── utils.py              # Utility functions
├── config.json               # Sample configuration
├── setup.py                  # Installation script
└── README.md                 # Documentation

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gui_runner-0.1.0.tar.gz (16.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gui_runner-0.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file gui_runner-0.1.0.tar.gz.

File metadata

  • Download URL: gui_runner-0.1.0.tar.gz
  • Upload date:
  • Size: 16.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for gui_runner-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f1e566920b1b598d3e15192cabb63f2b4ec3e47b09018ff8d5b07054c67b09a2
MD5 1f66e2eaab666306ac784aa6a4895193
BLAKE2b-256 ff539794908b25282fd2590f9d8049d3af90e781f2b1efe177c7a8e349e129a1

See more details on using hashes here.

File details

Details for the file gui_runner-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: gui_runner-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for gui_runner-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 84c25ab3ca67d6ff435c5ed136e23599f94d56f6ef865ada4712f29094cdf35d
MD5 6d93bced43eaaea6cf7a392bf84f6f16
BLAKE2b-256 6e15bc9678c45720cd156c78f0f44c139ac417bd46a8d47dbc8e5e4582f37fc7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page