Repository navigation
Releases: gene-2012/Term2GUI
Release list
Term2GUI V1.0
Full Changelog: V1.0PRE...V1.0
Term2GUI V1.0 Pre
Term2GUI
Introduction
Term2GUI is a graphical user interface (GUI) application designed to simplify the execution of command-line programs. It reads configuration files in JSON format to dynamically generate a user-friendly interface for setting command-line arguments. The application supports various argument types, including string, formatted string, and boolean.
Features
- Dynamic UI Generation: Automatically generates input fields based on the provided JSON configuration.
- Argument Types: Supports
str,fmtstr, andboolargument types. - Real-time Command Preview: Displays the constructed command before execution.
- Output Display: Captures and displays the standard output and error of the executed command.
Installation
To install and run Term2GUI, follow these steps:
Clone the Repository
git clone https://github.com/gene-2012/Term2GUI.git
cd Term2GUIConfiguration
The configuration for Term2GUI is defined in a JSON file, cfg.json as default. You can find some example in the example directory. More example can be found here.
Here's a basic example of a configuration file:
// cfg.json
{
"title": "Your Application Title",
"exec": "command_to_execute",
"args": {
"input": {
"type": "fmtstr",
"format": "-i %s",
"prompt": "Input File"
},
"output": {
"type": "fmtstr",
"format": "%s",
"prompt": "Output File"
},
"option": {
"type": "bool",
"true": "-o",
"false": ""
},
"flag": {
"type": "str",
"value": "-f"
}
}
}Useage
To run Term2GUI, simply execute the main.py script:
# If you want to use the default configuration filename
python main.py
# Or specify your own config filename
python main.py your_config_filenameAttention:
Themain.pyscript will automatically detect thecfg.jsonfile in the current directory. If you want to use a different configuration file, you need to specify the filename as an argument when running the script.
Contact
For any questions or feedback, please contact me at:
- Email: geneluo@qq.com.
- Github: @gene-2012.
You can also issue a pull request or open an issue on the GitHub repository.
License
This project is licensed under the GPL 3.0 License.