Making the demo more visible

Yes, I’ve been thinking about this today too. In addition to raising the visibility on the web site, in the docs, etc. a couple initial options that come to mind are:

  • Move the demo folder to be a sub-package of the wx package, like wx.demo, and add an entrypoint that will result in a launcher script like wxpython-demo or similar.

  • Make the demo be a separately installable PyPI package, with a entrypoint like the above.

It’s less clear what to do about the current samples folder. Maybe make them launchable from the demo? Also, we’ve always said that the demo samples are intended to be editable and are to be experimented with, and that won’t be as easy if the files are buried in a site-packages folder. It’s still possible with copy/paste from the editor tab in the demo, but then we’ll have more instances of confusion due to the missing run.py and images.py.

Anyway, food for thought.

4 Likes
  • Move the demo folder to be a sub-package of the wx package, like wx.demo, and add an entrypoint that will result in a launcher script like wxpython-demo or similar.

+1

  • Make the demo be a separately installable PyPI package, with a entrypoint like the above.

+1

Karsten

I would certainly prefer to have it in the main distribution.
Scripts/wxdemo would then launch demo.py
A hint could be added more prominently to the PyPi description. Maybe offer the user to run it right after the installation.

With the demo included, it would also be possible to add hints to the API documentation.
A “See site-packages/wx/demo/DVC_ListCtrl.py for example code.” seems more straightforward to me than a any other option.

For 3rd party applications like wxGlade this would allow to add a menu item “Run wxPython demo”. With a separate distribution that’s a bit difficult.

For the samples, I would think a subdirectory inside wx would be good enough. An entry in the demo would be great, listing the samples and having a “Open samples directory” button.

Maybe for each sample an “Export…” button would be an option that would save the demo file plus the required files like run.py into an external directory.
It would be great to have wx.App code inside each demo’s __main__ code instead of the run.py dependency, but I doubt that anyone volunteers…

1 Like

Good ideas, @DietmarSchwertberger. Thanks.

A PyPI package for the demo is a great idea. I’d prefer it over a wx.demo package, because that would add busywork to keep it out of app distributions. At least don’t put samples there; I’ve had build bugs before because cx_Freeze had a bad reaction to a samples directory that didn’t actually contain a Python package.

I too prefer having a separate pypi package to keep it out of app distributions. I think that making the world aware of wxdemo is more important than changing current wxdemo management. There should be a screenshot on the main page of wxpython website close to a link to instructions about installation

Marco

Great idea to have the demo more visible!

+1 for a separate PyPI package. :smiley:

As of now, when looking at this weeks posts, the demo still seems to be invisible.
And from the posts I would also conclude that a separate distribution will not be more visible.
Once people have wxPython installed, they will never search for an additional package. Why should they?

You could equally ask, how will people know to run the demo, if it’s auto-installed without their knowledge? It’s just files on disk until someone reads an instruction telling them to python -m wxdemo or something.

Suppose the installation instructions on wxPython Downloads | wxPython were to change from

pip install -U wxPython

to

pip install -U wxPython wxDemo

followed by:

# To check the install run:
python -m wxdemo
3 Likes

Well, when I install a library and want to learn how to use it, I would look around the library directory. (I would not search in the tools or scripts directories.)

But I like your suggestion, as the code lines are standing out and are visible.

The PyPI page is too long. I would not expect many people to read through to the end.

I’d like to vote +1 for the idea of separate PyPI package for the wxPython-Demo.
I don’t think many people know how to launch wxdemo or even its existence.

For example, when I use OpenGL, I normally install the following packages:

  • PyOpenGL
  • PyOpenGL_accelerate
  • PyOpenGL-Demo

Referring to the brief docs of PyOpenGL (http://pyopengl.sourceforge.net/index.html),
it will help users understand what is required, recommended, and optional.
The choice is yours and you can notice installing the demo package.

:grin: It would be nice to me if resources in wxdemo is available easily:

from wxdemo import images

P.S.

Another idea is to split the package into three parts.

  • wxPython
  • wxPython_advanced (=agw)
  • wxPython-Demo

For people who are stuck to cross-platform appearance, agw package tends to be avoided. In addition, wxPython itself can be more lightweight since agw package occupies almost half of the repository.

run.py has always been a bugbear of mine, as I spend time hacking it out for the umpteenth time.

Often I want to extract a demo into its own standalone module - the dependency on run.py etc means I have to remember how to modify the particular demo so that it runs independently. Wish there was a “save as independent module” button.

1 Like