User Input in PySimpleGUI Last Updated : 04 Aug, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report It is important how keys are key for understanding PySimpleGUI elements. If the user does not specify a key, then the element will be called an input element, a key will be provided to the user by default in integer form, starting the numbering with zero. If the user doesn't specify any keys, then the values returned will be returned as a list as the keys are sequential integers. This below example has no keys specified. The 3 input fields will have keys 0, 1, 2. Your first input element will be accessed as values[0], value[1] for the second, value[2] for the third, and so on. Example: Python Program for User Input using PySimpleGUI . Python3 import PySimpleGUI as sg # Add some color # to the window sg.theme('SandyBeach') # Very basic window. # Return values using # automatic-numbered keys layout = [ [sg.Text('Please enter your Name, Age, Phone')], [sg.Text('Name', size =(15, 1)), sg.InputText()], [sg.Text('Age', size =(15, 1)), sg.InputText()], [sg.Text('Phone', size =(15, 1)), sg.InputText()], [sg.Submit(), sg.Cancel()] ] window = sg.Window('Simple data entry window', layout) event, values = window.read() window.close() # The input data looks like a simple list # when automatic numbered print(event, values[0], values[1], values[2]) Output: Comment More infoAdvertise with us Next Article User Input in PySimpleGUI V vigneshsuresh4499 Follow Improve Article Tags : Python Programming Language Python Programs python-modules Python-gui +1 More Practice Tags : python Similar Reads Themes in PySimpleGUI Themes are used for designing Beautiful windows. It gives the user a choice to showcase his creativity on the GUI with colors. Coloring the GUI window can be accomplished with 1 line of code. sg.theme('Dark Amber 5')Note: Dark Amber is the name of the Theme and 5 is the version or the patch. We make 3 min read Asynchronisation Usage in PySimpleGUI We use this design pattern for projects that actually will need to poll or output something on a regular basis. In this case, we're indicating we want a timeout=10 in our window.read call. Also, this will cause the call to return a "timeout key" as the event every 10 milliseconds has passed without 2 min read Introduction to PySimpleGUI It is easy to use with simple yet HIGHLY customizable features of GUI for Python. It is based solely on Tkinter. It is a Python GUI For Humans that Transforms Tkinter, PyQt, Remi, WxPython into portable user-friendly Pythonic interfaces. How can we use PySimpleGUI? The Steps for using the GUI packag 1 min read Adding Customized Color Theme in PySimpleGUI PySimpleGUI allows users to choose Themes for its Theme list. Also, it allows users to specify and customize the Theme according to their choice. The User only should know the Color shades i.e the hex codes of the Colors. Accordingly, he/she can customize the Theme by new Colors. Example: Python3 im 1 min read Disappearing Text Desktop Application in Python In this article, we will build an exciting desktop application using Python and its GUI library, Tkinter. Disappearing Text Desktop Application in PythonThe app is simple to use. The user will start writing whatever he wants to write. If he takes a pause for 5 seconds, the text he has written is del 12 min read Like