[Python-ideas] A GUI for beginners and experts alike

Steve Barnes gadgetsteve at live.co.uk
Fri Aug 24 00:58:46 EDT 2018



On 24/08/2018 02:04, Mike Barnett wrote:
> Wow, Thank you Steve!
> 
> 
> This is exactly the kind of information I was hoping for!!
> 
> 
> 
>> Acceptance for *what* precisely?
> 
> That is a great question... you're right shoulda asked a specific question.
> 
> I would like to see if become something official so that it gets out to people automatically.  Perhaps a stdlib module.
> 
> I should have also mentioned I'm the author.  That 3rd person thing didn't sound right.
> 
> Definitely want to stress that the current implementation is a prototype for something official.  It would need to be rewritten should it be submitted.  As it is now it likely needs refactoring to get the interface to be PEP8 compliant.  If it's possible to look past some of those blemishes and more at what the interface accomplishes and how it goes about doing it.
> 
> There are a number of Python-like aspects of the project that fit within a learning environment.  These concepts are all touched upon in a natural way:
> * The use of Lists, Dictionaries for return values.
> * The window/form is specified using a List layout that visibly resembles the GUI layout.
> * Widgets are configured in place by using optional parameters.
> * The calls collapse down into a single-line of Python code for a custom GUI should you want to write it that way.
> 
> The other questions:
> 
> Is this an attempt to draw people's attention to PySimpleGUI?
> To start a dialog about finding something better?
> 
> Yes - I want to begin the process of getting some attention... get some ideas on how I can get in front of audiences that may be interested.  I don't want to spam the Python world, but I do want to help people add a nice front-end to their programs.
> 
> 
> (.... then I don't understand the comment about pip install and
> dropping the PySimpleGUI into people's project folder -- that isn't
> necessary if its a std lib module.)
> 
> The single-file aspect is a detail about today's implementation.
> 
> 
> Thank you for asking helpful questions.
> 
> 
> 
> @mike
> 
> 
Mike,

A couple of points:

  1. If you were to package PySimpleGUI into a pip installable library 
then this allows anybody who pip installs it to import and use it 
without copying it anywhere, (just like it being in the stdlib other 
than the pip step).
  2. You can add a package to pypi, and improve on it & its 
documentation, without needing a PEP or any of the rigmarole needed to 
get it into the stdlib.
  3. Once a pypi package gets a) stable & b) the traction for mass use 
it may be considered to inclusion into the standard lib, (or go there to 
die as any changes become very slow & constrained.
  4. Python Ideas is probably not the best channel to publicise such a 
package.
So all in all I would suggest concentrating on that initially.

There are already 2 ways of turning a python program that uses argparse 
into a GUI, (Gooey for wx & Quicken for QT IIRC), with minimal 
modification. There are a lot of good arguments for teaching people to 
use argparse and to write their code to be able to run from the command 
line but there is not a mechanism that I am aware of for turning 
argparse based code into a TK GUI this might be a fruitful area to look 
at. It might even be a really great idea to get in touch with the 
authors of the two package mentioned to see if it might not be possible 
to come up with a unified library that allowed something like:

```
import pyUniGUI as gui
gui.set_backend(tk)  # or qt or wx (maybe others)

@gui.from_argparse
def parse_args():
     """ Parse command line arguments (also defines GUI). """
     ...
```

Can I also suggest taking a look at the Enthought Traits & TraitsUI 
(https://github.com/enthought/traitsui) packages to see what can be done 
for automating GUI generation. TraitsUI can use wx or QT (via various 
bindings) as GUI backends, (I know that is an unusual turn of phrase), 
but adding a TK backend would be a great move.

-- 
Steve (Gadget) Barnes
Any opinions in this message are my personal opinions and do not reflect 
those of my employer.

---
This email has been checked for viruses by AVG.
https://www.avg.com



More information about the Python-ideas mailing list