diff --git a/__init__.py b/__init__.py index d2bac2c..74403d4 100755 --- a/__init__.py +++ b/__init__.py @@ -32,6 +32,7 @@ except ImportError: import math import numpy as np import time +import wx localConfig = configparser.ConfigParser() globalConfig = configparser.ConfigParser() @@ -116,6 +117,18 @@ def read_config(readGlobal = False): except: pass + +def get_input(prompt = "Enter text:", text = ""): + app = wx.App(False) + dialog = wx.TextEntryDialog(None, prompt, "Input", text) + dialog.SetValue(text) + if dialog.ShowModal() == wx.ID_OK: + userInput = dialog.GetValue() + else: + userInput = None + dialog.Destroy() + return userInput + def speak(text, interupt=True): if speechProvider == "speechd": if interupt: spd.cancel()