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.

3 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
2 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.