Created
February 15, 2021 04:51
-
-
Save rodrigo-x/c7b27e5cbef7aa0346c0e41ee064e21f to your computer and use it in GitHub Desktop.
PySimpleGui Example..
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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