[Python-ideas] Using Python for end user applications

Paul Moore p.f.moore at gmail.com
Tue Feb 7 10:27:56 EST 2017


On 7 February 2017 at 14:29, Steve Dower <steve.dower at python.org> wrote:
> You can leave python.exe out of your distribution to avoid it showing up on
> PATH, or if your stub explicitly LoadLibrary's vcruntime140.dll and then
> python36.dll you should be able to put them wherever you like.

Understood, but I may need python.exe present if the script uses
multiprocessing, so I'm trying to avoid doing that (while I'm doing
things manually, I can do what I like, obviously, but a generic "build
my app" tool has to be a bit more cautious).

LoadLibrary might work (I'm only calling Py_Main). I seem to recall
trying this before and having issues but that might have been an
earlier iteration which made more complex use of the C API. Also, I
want to load python3.dll (the stable ABI) as I don't want to have to
rebuild the stub once for each Python version, or have to search for
the correct DLL in C. But I'll definitely give that a go.

> I think what we really want is a self-extractor that "installs" into the
> user's AppData directory without prompting for admin. I'm seeing more apps
> about like this and I think it's the right model for Python.

My goal is explicitly self-contained applications - the "xcopy
deployment" model. I'm looking for things that can be used in *very*
constrained environments (no install ability, possibly not even any
access to locations outside of My Documents).

> We probably
> want to include the Electron shell as well, or make it trivially easy to add
> (I've been using a built-in Windows tool that is similar, but it's not
> ideal). There's a real chance we could have very modern, cross-platform
> Python apps with this approach.

I presume you mean http://electron.atom.io/? I've never used it, but
again my goal is essentially command line apps here. Definitely "pure
Python" apps. I don't know how I'd use electron from a Python script,
but I'm guessing you're looking more at targeting GUI apps with
traditional installers? It's an interesting area (GUI interfaces have
always been a rough edge in Python development) but not one I am
looking at at the moment. (Offtopic, but are there any tutorials on
building apps using Python and Electron, as it sounds like an
interesting thing to investigate).

Paul


More information about the Python-ideas mailing list