[PySimpleGUI] Tutorial - Name, Address, Phone GUI - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: GUI (https://python-forum.io/forum-10.html) +--- Thread: [PySimpleGUI] Tutorial - Name, Address, Phone GUI (/thread-11968.html) |
[PySimpleGUI] Tutorial - Name, Address, Phone GUI - PySimpleGUI - Aug-02-2018 MODERATORS - Please review this post meant for the GUI section. Here's a very basic form using the package PySimpleGUI import PySimpleGUI as sg form = sg.FlexForm('Simple data entry form') # begin with a blank form layout = [[sg.Text('Please enter your Name, Address, Phone')], [sg.Text('Name', size=(15, 1)), sg.InputText()], [sg.Text('Address', size=(15, 1)), sg.InputText()], [sg.Text('Phone', size=(15, 1)), sg.InputText()], [sg.Submit(), sg.Cancel()]] button, (name, address, phone) = form.LayoutAndRead(layout) print(name, address, phone) To get PySimpleGUI: pip install PySimpleGUI RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - Larz60+ - Aug-03-2018 I'm going to have to take a look at this package. Maybe I can get to it today. I'll post my opinion afterwards. RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - Gribouillis - Aug-03-2018 It looks like an input forms module like easygui, easygui_qt, guidata or psidialogs. I often use pythondialog in a linux terminal, which works easily over ssh... RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - PySimpleGUI - Aug-03-2018 (Aug-03-2018, 10:58 AM)Gribouillis Wrote: It looks like an input forms module like easygui, easygui_qt, guidata or psidialogs. I often use pythondialog in a linux terminal, which works easily over ssh... Thank you so much for the extended list of similar packages. I went through as many as I could find prior to writing PySimpleGUI. I found nothing close to what I needed for my projects, so I wrote a new package. I honestly have not found anything that uses the language to create a natural feeling GUI framework, without all of the need to understand what a GUI is and how it works. I'm highly interested in feedback.... I want to push this design as far as I take it into the world of Python to see if I can get it to catch on. I'm searching for a middle ground between super-easy for beginners and flexible enough for professionals to use for their needs too..... for example, IT professionals looking for a front-end to their daily tools. I appreciate your time looking this over! RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - PySimpleGUI - Aug-03-2018 I would like my post of the tutorial to appear in the "tutorials" forum under "GUI" if possible. RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - PySimpleGUI - Aug-04-2018 WOW... I just realized all that code can be compacted down to a SINGLE LINE of Python code! Not that I would, just saying it's possible. Not sure how many other Python GUIs can do this in 1 line of code. The design is even more Python-like than I thought. button, (name, address, phone) = sg.FlexForm('Simple data entry form').\ LayoutAndRead([[sg.Text('Please enter your Name, Address, Phone')], [sg.Text('Name', size=(15, 1)), sg.InputText()], [sg.Text('Address', size=(15, 1)), sg.InputText()], [sg.Text('Phone', size=(15, 1)), sg.InputText()], [sg.Submit(), sg.Cancel()]]) RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - jfong - Aug-04-2018 Can you add a "focus" option for some elements? just like some widgets the tkinter has. RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - PySimpleGUI - Aug-04-2018 Added to list of enhancements. Thank you for the feedback! RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - metulburr - Aug-04-2018 (Aug-04-2018, 12:18 AM)PySimpleGUI Wrote: Not sure how many other Python GUIs can do this in 1 line of code. The design is even more Python-like than I thought.Python's goal is not to make it into one line. It is more readable in your first example. The zen of python states: Quote:Beautiful is better than ugly. (Aug-03-2018, 04:48 PM)PySimpleGUI Wrote: to push this design as far as I take it into the world of Python to see if I can get it to catch on.Time will tell. Are you going to be here 5 years from now, or even 10 years from now maintaining the same package? We only put common GUI frameworks in tutorials. A lot of people will make GUI frameworks and then abandon them within a year. RE: [PySimpleGUI] Tutorial - Name, Address, Phone GUI - PySimpleGUI - Aug-04-2018 Quote:Time will tell. Are you going to be here 5 years from now, or even 10 years from now maintaining the same package? We only put common GUI frameworks in tutorials. A lot of people will make GUI frameworks and then abandon them within a year. You're absolutely right. I looked through packages that are both active and abandoned before writing this. I wrote it with the immediate idea of trying to get it adopted down the road. I have every intention of sticking with this project. I've been at this for 4 decades. The implementation isn't the best at the moment, but it's solid. I was still learning Python at that time. I appreciate you taking the time to bring up stuff like this. Comments only make it a better package in the end, right? Just finished posting the documentation here: http://pysimplegui.readthedocs.io This provides an hotlinked outline of the same content as the readme file. |