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, save, 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.1.tar.gz (16.3 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.1-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gui_runner-0.1.1.tar.gz
  • Upload date:
  • Size: 16.3 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.1.tar.gz
Algorithm Hash digest
SHA256 0d57518d5dd3ee2e13dcbf5db9e23c3d18f4ad31e12162d8a76e935ef55f55ef
MD5 f0a08e721ea597c477dac80122a4bd6d
BLAKE2b-256 5442f2aa3a7afe30841354978f7c0d67f9bc42b7ce47700f7299c1b214844388

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gui_runner-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4b9eca1547cbadee88b5a8468bbf7ea96362af227825017c755adba733977de3
MD5 cb947f02d3eccdae310f9d79d4b0b8f0
BLAKE2b-256 6cef18fe348184bae92272097b688f9f5ac371afe64eff38e224f5ad63e9b558

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