可以输入2-6位的词根来查询他们在固定范式下的伪意义:
import PySimpleGUI as sg
import get_pseudo_meanning as gpm
switch = True
while switch:
layout = [
[sg.Text('Please enter an English word you want to look up to and memorize\n with associative picture (within 2-6 letters):')],
[sg.InputText(),sg.Submit('Lookup')]
]
input_window = sg.FlexForm('Pseudo Meaning Generator for English Words',layout)
event,value = input_window.Read()
text_input = value[0]
pseudo_meaning_of_input = gpm.get_pseudo_meanning(text_input)
# message = pseudo_meaning_of_input
input_window.Close()
output_windows = sg.FlexForm('Pseudo Meaning Generator for English Words')
output_layout = [
[sg.Text(pseudo_meaning_of_input)],
[sg.OK('Continue'),sg.Cancel('Exit')]
]
button, values = output_windows.Layout(output_layout).Read()
if button == 'Cancel':
switch = False
output_windows.Close()
运行结果如下:
点击lookup按钮之后,得到查询结果: