Skip to content
/ ParamUI Public

Create App with UI from simple parameter table. Easily generate Python code using LLMs such as ChatGPT

License

Notifications You must be signed in to change notification settings

covao/ParamUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

60 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Japanese(Google Translate)

ParamUI Python

  • Create App with UI from simple parameter table
  • Easy code generation using ChatGPT

Instalation

Method 1

  • Install library in python environment
pip install git+https://github.com/covao/ParamUI

Method 2

  • Download paramui.py and copy to the folder where you run the python script

Usage

Parameter table definition

Parameter table is containing the following columns

  • Prameter Variable
  • Parameter Label
  • Initial Value
  • Range
    • Slider: [Min, Max, Step]
    • Check Box: []
    • Selecter: ['A','B']
    • Edit Box: []
    • File Selecter: '*.txt;*.doc'
    • Folder Selecter: 'folder'
    • Button: 'button'
ParameterTable = [
    ['A', 'Parameter A', 0.5, [0, 1, 0.1]],
    ['B', 'Parameter B This is a pen', 200, [100, 500, 10]],
    ['F1', 'Flag 1', True, []],
    ['F2', 'Flag 2', False, []],
    ['S1', 'Select 1', 'Two', ['One', 'Two', 'Three']],
    ['S2', 'Select 2', 'Three', ['One', 'Two', 'Three']],
    ['Name1', 'Name 1', 'Taro', []],
    ['Name2', 'Name 2', 'Jiro', []],
    ['File1', 'File 1', '', '*.py;*.txt'],
    ['Folder1', 'Folder 1', '', 'folder'],
    ['Run', 'Run!', False, 'button'],
]

Example 1: Run on UI event

from paramui import paramui
def usrfunc(Prm):
    if not Prm.Run:
        return
    print(Prm)
paramui(ParameterTable, usrfunc)

Example 2: Loop & Get Parameters

from paramui import paramui
import time
pu = paramui(ParameterTable)
while pu.IsAlive:
    print(pu.Prm)
    time.sleep(0.5)
    

Example 3: Do not display UI for debug

from paramui import paramui
def usrfunc(Prm):
    if not Prm.Run:
        return
    print(Prm)
paramui(ParameterTable, usrfunc, False)

Hello ParamUI

Demo

Related Sites

About

Create App with UI from simple parameter table. Easily generate Python code using LLMs such as ChatGPT

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published