-
Notifications
You must be signed in to change notification settings - Fork 0
/
puppet_robot.py
37 lines (25 loc) · 1010 Bytes
/
puppet_robot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import PySimpleGUI as sg
import eng_to_ipa as ipa
import csv
import sys
layout = [[sg.Text('Open Script file. It should be a CSV generated from the template')],
[sg.Input(key='_filename_'),sg.FileBrowse()],
[sg.Button('Process Script'), sg.Text('This may take a while!')],
[sg.Text('_' * 40, size=(30, 1))],
[sg.Text('Once the processing is complete you can start the show')],
[sg.Button('Start'),sg.Button('Pause'),sg.Button('Cancel')]
]
window = sg.Window('Robot Theatre System').Layout(layout)
window.Location=(0,0)
def ProcessScript():
text_input = values[0]
ipa_text = ipa.convert(text_input)
print(ipa_text)
while True:
event, values = window.ReadNonBlocking() #
if event == 'Quit':
break
if event == 'Process Script':
ProcessScript()
window.Close()
#final test routine 1