Skip to content

Instantly share code, notes, and snippets.

@rodrigo-x
Created February 15, 2021 04:51
Show Gist options
  • Select an option

  • Save rodrigo-x/c7b27e5cbef7aa0346c0e41ee064e21f to your computer and use it in GitHub Desktop.

Select an option

Save rodrigo-x/c7b27e5cbef7aa0346c0e41ee064e21f to your computer and use it in GitHub Desktop.
PySimpleGui Example..
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import PySimpleGUI as sg
import pyttsx3
ENGINE = pyttsx3.init()
sg.theme('LightGreen')
layout = [ [sg.Text("Qual é o seu nome?")],
[sg.Input()],
[sg.Button('Ok')] ]
window = sg.Window('Hello World', layout)
while True:
event, values = window.read()
if event in (sg.Button, 'Ok'):
ENGINE.say(f'Obrigado {values[0]} você é o cara!')
ENGINE.runAndWait()
ENGINE.stop()
ENGINE.getProperty("rate")
ENGINE.setProperty("self.rate", 225)
break
window.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment