From 652b334d2c621c24c55d7f418052642032111270 Mon Sep 17 00:00:00 2001 From: Zusier Date: Sat, 20 Nov 2021 13:10:57 -0800 Subject: [PATCH] Add multiplechoice dialog --- README.md | 8 +++++++- multi/multichoice.py | 15 +++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 multi/multichoice.py diff --git a/README.md b/README.md index 4ad67ef..c5de749 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,10 @@ Source Repo for utilities used in Atlas Simple file picker in Go using [go-common-file-dialog](https://github.com/harry1453/go-common-file-dialog) -This returns just the path of an executable e.g. `C:\Windows\System32\notepad.exe` \ No newline at end of file +This returns just the path of an executable e.g. `C:\Windows\System32\notepad.exe` + +## MultiChoice-py + +Simple multiple choice dialog in Python (TODO: Go) using [easygui](https://pypi.org/project/easygui) + +This returns a semi-colon delimited string e.g. `Yes;No;Maybe` \ No newline at end of file diff --git a/multi/multichoice.py b/multi/multichoice.py new file mode 100644 index 0000000..5acad9b --- /dev/null +++ b/multi/multichoice.py @@ -0,0 +1,15 @@ +from easygui import * +import sys +# 1st arg, title of thw window +# 2nd arg, prompt message +# 3rd arg, choices + +# Window title +title = str(sys.argv[1]) +prompt = str(sys.argv[2]) +# argument will be a semicolon delimited list, like "1;2;3;" +choices = sys.argv[3].split(";") +# Create window +output = multchoicebox(prompt, title, choices) +# convert back to semicolon delimited list +print(str(";".join(list(map(str, output))))) \ No newline at end of file