[Python-Dev] PEP 397 (Python launcher for Windows) reference implementation (original) (raw)

Vinay Sajip vinay_sajip at yahoo.co.uk
Fri Jul 1 18:17:03 CEST 2011


Mark Hammond <skippy.hammond gmail.com> writes:

Sure, that would be awesome! I think that will mean your impl is fairly close to the first draft of the PEP I checked into HG, which is nice and still quite useful to use :)

My C implementation of the launcher is now available at

https://bitbucket.org/vinay.sajip/pylauncher

It's been built using VS 2008, and tested on Windows 7 (32-bit) with ActivePython 2.6.2.2 and ActivePython 3.2.0.0 installed.

I've added support for .ini files [commands] section; I haven't looked at implementing [defaults] yet.

There's incomplete support for -32 suffix at the moment - that can be looked at in due course.

A couple of points:

I've also allowed for /usr/local/bin/python as a built-in command, this can always be removed later if YAGNI.

I've assumed that if a customised command is provided with arguments in the shebang line, these will be ignored - if people want to run with different options they can always define more customised commands. If you agree with this, the PEP should probably explicitly state this.

In a couple of cases I've implemented using fixed size arrays - for the lists of installed Pythons and customised commands. Of course these can be made dynamic, but what's there is good enough for the moment for exploration.

Do have a play, and let me know what you think.

Regards,

Vinay Sajip



More information about the Python-Dev mailing list