Compare commits
2 Commits
testing
...
b5b472eebe
Author | SHA1 | Date | |
---|---|---|---|
|
b5b472eebe | ||
|
9f03de15b8 |
20
__init__.py
20
__init__.py
@@ -32,6 +32,7 @@ except ImportError:
|
|||||||
import math
|
import math
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import time
|
import time
|
||||||
|
import wx
|
||||||
|
|
||||||
localConfig = configparser.ConfigParser()
|
localConfig = configparser.ConfigParser()
|
||||||
globalConfig = configparser.ConfigParser()
|
globalConfig = configparser.ConfigParser()
|
||||||
@@ -116,6 +117,18 @@ def read_config(readGlobal = False):
|
|||||||
except:
|
except:
|
||||||
pass
|
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):
|
def speak(text, interupt=True):
|
||||||
if speechProvider == "speechd":
|
if speechProvider == "speechd":
|
||||||
if interupt: spd.cancel()
|
if interupt: spd.cancel()
|
||||||
@@ -406,6 +419,13 @@ def display_text(text):
|
|||||||
event = pygame.event.clear()
|
event = pygame.event.clear()
|
||||||
time.sleep(0.001)
|
time.sleep(0.001)
|
||||||
|
|
||||||
|
def messagebox(text):
|
||||||
|
while True:
|
||||||
|
speak(text + "\nPress any key to repeat or enter to continue.")
|
||||||
|
event = pygame.event.wait()
|
||||||
|
if event.type == pygame.KEYDOWN:
|
||||||
|
if event.key == pygame.K_ESCAPE or event.key == pygame.K_RETURN: return
|
||||||
|
|
||||||
def learn_sounds(sounds):
|
def learn_sounds(sounds):
|
||||||
loop = True
|
loop = True
|
||||||
pygame.mixer.music.pause()
|
pygame.mixer.music.pause()
|
||||||
|
Reference in New Issue
Block a user