1

I have written a Python script which models an academic problem which I wish to publish. I will put the source on Github and some academics that just happen to know Python may get my source and play with it themselves. However there are probably more academics that may be interested in the model but that are not python programmers and I would like them to be able to run my model too. Even though they are not programmers they could at least try out editing the values of some of the parameters to see how that affects the results. So now my question is how could I arrange for a non-python programmer to run a Python program as easily (for them) as possible. I would guess that my options may be...

  • google colab
  • an online python compiler like this one
  • compiling the program into an exe (and letting the user set parameters via a config file)
  • something else?

So now a couple of complications that makes my problem trickier.

  1. The output of the program is graphical and uses matplotlib. As I understand it, the utilities that turn python scripts into exe files struggle or fail altogether when it comes to matplotlib.
  2. The source is split into two separate files, one small neat file which contains the model and the user might like to have a good look at it and get the gist of it even if they're not really a python programmer. And a separate large ugly file which just handles the graphics - an academic would have no interest in this and I'd like to spare them the gory details.

EDIT: I did ask a related question here - but that was all about programmers that won't mind doing things like installing python and using pip... this question is in relation to non-programmers who would not be comfortable doing things like that.

Mick
  • 8,284
  • 22
  • 81
  • 173
  • Can we see the code? – Jack Adee Apr 08 '20 at 13:25
  • Does this answer your question? [Robust way to ensure other people can run my python program](https://stackoverflow.com/questions/60928734/robust-way-to-ensure-other-people-can-run-my-python-program) – Thomas Apr 08 '20 at 13:26
  • Still a work in progress, but here: https://github.com/reissgo/money-simulation – Mick Apr 08 '20 at 13:26
  • @PNX: - no - that's just for programmers. This question is for non-programmers. – Mick Apr 08 '20 at 13:27
  • 1
    If you are pushing on github, you might consider "compiling" the python script into a standalone executable using [`pyinstaller`](https://www.pyinstaller.org/) or similar and publish it with your release. `matplotlib` is part of the supported modules. – r.ook Apr 08 '20 at 13:32
  • Give the program a GUI and/or write a manual which explains how to use it. – mkrieger1 Apr 08 '20 at 13:33

1 Answers1

1

Colab can handle the 2 problems, but you may need to adapt some code.

  • Matplotlib interface: Colab can display plots just fine. But you may want user to interact with slider, checkbox, dropdown menu. Then, you need to use Colab's own Form UI, or pywidgets. See an example here

  • 2 separate python files: you can convert one of them to a notebook. Then import the other. Or you can create a new notebook that import both files. Here's an example.

korakot
  • 37,818
  • 16
  • 123
  • 144