X-Git-Url: https://git.cweiske.de/enigma2.git/blobdiff_plain/30562d78ee2be5fe628a88cce45f7671ff0644bb..510fe63aa7bf232fcca7f2a3d0fdab2c45307b78:/tools/host_tools/FormatConverter/input.py diff --git a/tools/host_tools/FormatConverter/input.py b/tools/host_tools/FormatConverter/input.py new file mode 100644 index 00000000..7a206273 --- /dev/null +++ b/tools/host_tools/FormatConverter/input.py @@ -0,0 +1,23 @@ +import sys + +def inputText(): + input = sys.stdin.readline() + return input.strip() + +def inputChoices(list, backcmd = "b", backtext = "back"): + repeat = True + while(repeat): + repeat = False + count = 0 + for item in list: + print count, "-", item + count += 1 + print backcmd, "-", backtext + input = inputText() + if input == backcmd: + return None + + action = int(input) + if action >= len(list): + repeat = True + return action \ No newline at end of file