Skip to content

Instantly share code, notes, and snippets.

@LilianDamico
Created April 19, 2022 12:28
Show Gist options
  • Save LilianDamico/334a38172037640aa9a717d12840f156 to your computer and use it in GitHub Desktop.
Save LilianDamico/334a38172037640aa9a717d12840f156 to your computer and use it in GitHub Desktop.
Mini PDV
import PySimpleGUI as sg
sg.theme('DarkTanBlue')
layout = [ [[sg.Text('Código: ', size=(5, 1)), sg.InputText(size=(5, 1))]],
[[sg.Text('Saída: ', size=(5, 1)), sg.InputText(size=(20, 1))]],
[sg.Button('Ok'), sg.Button('Cancel')]]
window = sg.Window('Mini PDV', layout)
while True:
event, values = window.read()
if event == sg.WIN_CLOSED or event == 'Cancel':
break
print('Você cadastrou ', values[0])
if values[0] == '2010':
window.find_element(1).Update('Maçã')
elif values[0] == '2020':
window.find_element(1).Update('Banana')
elif values[0] == '2030':
window.find_element(1).Update('Abacaxi')
elif values[0] == '2040':
window.find_element(1).Update('Goiaba')
else:
window.find_element(1).Update('Código não cadastrado.')
window.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment