This is the main.py
All checks were successful
Potlatch Loggers Organization/ComputerKeeper/pipeline/head This commit looks good
All checks were successful
Potlatch Loggers Organization/ComputerKeeper/pipeline/head This commit looks good
This commit is contained in:
parent
2cb23bfc0e
commit
c9bb9cb290
38
main.py
Normal file
38
main.py
Normal file
@ -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()
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user