Compare commits
7 Commits
testing
...
d5c79c0770
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d5c79c0770 | ||
|
|
24f9a126d4 | ||
|
|
c316d4e570 | ||
|
|
e66655d75f | ||
|
|
c5406d5089 | ||
|
|
b5b472eebe | ||
|
|
9f03de15b8 |
23
__init__.py
23
__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()
|
||||
@@ -406,6 +419,16 @@ def display_text(text):
|
||||
event = pygame.event.clear()
|
||||
time.sleep(0.001)
|
||||
|
||||
def messagebox(text):
|
||||
speak(text + "\nPress any key to repeat or enter to continue.")
|
||||
while True:
|
||||
event = pygame.event.wait()
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_ESCAPE or event.key == pygame.K_RETURN:
|
||||
return
|
||||
else:
|
||||
speak(text + "\nPress any key to repeat or enter to continue.")
|
||||
|
||||
def learn_sounds(sounds):
|
||||
loop = True
|
||||
pygame.mixer.music.pause()
|
||||
|
||||
Reference in New Issue
Block a user