[Python-ideas] A GUI for beginners and experts alike
Mike Barnett
mike_barnett at hotmail.com
Thu Aug 23 16:59:27 EDT 2018
Maybe we're on different planes?
I'm talking about 5 lines of Python code to get a custom layout GUI on the screen:
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('1', key='name')],
[sg.Text('Address', size=(15, 1)), sg.InputText('2', key='address')],
[sg.Text('Phone', size=(15, 1)), sg.InputText('3', key='phone')],
[sg.Submit(), sg.Cancel()]
]
button, values = form.LayoutAndRead(layout)
gets you this window:
https://user-images.githubusercontent.com/13696193/43934091-8100e29a-9c1b-11e8-8d0a-9bd2d13e6d8e.jpg
@mike
-----Original Message-----
From: Jonathan Fine <jfine2358 at gmail.com>
Sent: Thursday, August 23, 2018 4:14 PM
To: Mike Barnett <mike_barnett at hotmail.com>
Cc: python-ideas at python.org
Subject: Re: [Python-ideas] A GUI for beginners and experts alike
Hi Mike
Thank you for your message. I agree, in broad terms, with your statement of goals, and welcome their being discussed here. Python has important roots are in education. We benefit from taking care of them.
Here is what I take to be your statement of goals.
> While the Python language is awesomely compact, the GUI code is far
> from compact. Tkinter will create a nice looking GUI, but you’ve got
> to be skilled to use it. A student in their first week of Python
> programming is not going to be working with tkinter.
My preferred approach to solve this problem is to use a web browser as the GUI platform, and communicate with it using a simple local server.
I've been learning about https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Felm-lang.org%2F&data=02%7C01%7C%7Ceb7eab650615436dbeb108d609350659%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636706520676613184&sdata=pD2CihHk00chVTBlKHlIUDSwGBzpgVJZ9%2BoVdSgbI1k%3D&reserved=0. It impresses me. Here's some URLs.
https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Felm-lang.org%2F&data=02%7C01%7C%7Ceb7eab650615436dbeb108d609350659%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636706520676613184&sdata=pD2CihHk00chVTBlKHlIUDSwGBzpgVJZ9%2BoVdSgbI1k%3D&reserved=0
https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fguide.elm-lang.org%2F&data=02%7C01%7C%7Ceb7eab650615436dbeb108d609350659%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636706520676613184&sdata=uhkgRZy1FAk%2B9QipthduzIFuhn5o8tnpD9svIUEcGPE%3D&reserved=0
https://nam01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fellie-app.com%2F37gXN5G4T2sa1&data=02%7C01%7C%7Ceb7eab650615436dbeb108d609350659%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636706520676613184&sdata=Ffq7dCPKpMgN3VjtvjhM4xXMIxo%2BwsZaIc8JOVD%2F6a8%3D&reserved=0
https://nam01.safelinks.protection.outlook.com/?url=http%3A%2F%2Felm-lang.org%2Fblog%2Ftime-travel-made-easy&data=02%7C01%7C%7Ceb7eab650615436dbeb108d609350659%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636706520676613184&sdata=WYoUZzQZmyZ7IEiMWBNnZQhai50G18ExTIEu0BrKL%2Fc%3D&reserved=0
However, I don't want to have this thread turn into a discussion of elm. Rather, I'm putting forward using HTML5 in a browser as the GUI platform, rather than tkinter. And elm is one of several examples we can learn from.
Thank you for your work on PySimpleGUI, and for your statement of goals.
with best regards
Jonathan
More information about the Python-ideas
mailing list