From c9bb9cb290d12b620dbed35b74d2bfd5c797451c Mon Sep 17 00:00:00 2001 From: Josh b Date: Thu, 18 Aug 2022 19:17:43 -0700 Subject: [PATCH] This is the main.py --- main.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..9586c9b --- /dev/null +++ b/main.py @@ -0,0 +1,38 @@ +"""This is the main function""" + +import PySimpleGUI as sg + + +# Define the window's contents +layout = [[sg.Text("What's your name?")], + [sg.Input(key='-INPUT-')], + [sg.Text(size=(40,1), key='-OUTPUT-')], + [sg.Button('Ok'), sg.Button('Quit')]] + + + + +def main(): + """Core of ComputerKeeper - The Main Application.""" + print("hello, world!") + # Create the window + window = sg.Window('Window Title', layout) + + # Display and interact with the Window using an Event Loop + while True: + event, values = window.read() + # See if user wants to quit or window was closed + if event == sg.WINDOW_CLOSED or event == 'Quit': + break + # Output a message to the window + window['-OUTPUT-'].update('Hello ' + values['-INPUT-'] + "! Thanks for trying PySimpleGUI") + + # Finish up by removing from the screen + window.close() + +if __name__ == "__main__": + main() + + + +