On 12/07/07, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Right, but it's supposed to be cross platform, as mentioned in the > > patch. This will work on Windows. > > But in the description, you said that you do the same on Windows > by making a file that is both a zip file and a batch file. So my > approach is also cross-platform, no?
Getting the details of such a batch file header right on Windows is not easy, not least because there is no "exec" equivalent on Windows. The following works, but (a) uses 2 processes, and (b) doesn't preserve the exit code. The first issue is minor, but the second is a big problem (and one I don't know how to fix). Also, on Windows, zip-packaged GUI programs could be useful - these would be executed using "pythonw -z" > How do you get the -z option to work on Windows? What extension > do you use, and how is the zipfile created? The patch suggests using .pyz and adding a default association to the installer (much like .py and .pyw have). It also offers a script for building the zipfiles - either as sample code, or to be included with Python (it's not clear to me). It's arguable that .pyz files should use pythonw -z, not python -z, as file extensions are more often useful for clickable programs in the GUI. You could have two extensions (.pyz and .pzw, maybe) but I'm not sure it's worth it. The point here is that the fiddly part (setting sys.path, locating the main module, etc) is covered by the -z option, deployment considerations are easier to handle (and hence the exact defaults supplied are less crucial) once -z is available. Paul. _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com