Skip to content

Commit

Permalink
Add multiplechoice dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
Zusier committed Nov 20, 2021
1 parent f3f8031 commit 652b334
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
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`
15 changes: 15 additions & 0 deletions multi/multichoice.py
Original file line number Diff line number Diff line change
@@ -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)))))

0 comments on commit 652b334

Please sign in to comment.