A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2013-July/127314.html below:

[Python-Dev] Adding Python scripts to PATHEXT on Windows

[Python-Dev] Adding Python scripts to PATHEXT on WindowsPaul Moore p.f.moore at gmail.com
Mon Jul 15 10:26:50 CEST 2013
With the addition of the Python launcher (PEP 397), Python scripts on
Windows are executable in much the same way as on Unix. However, "out of
the box" it is still not quite possible to use Python scripts. This is
because the .py extension is not registered with Windows in the PATHEXT
environment variable (which holds all file extensions which should be
looked for on PATH at the command line).

There are two main consequences to this:

1. Under powershell, ".py" files on PATH are not found at all (this is not
the case with cmd.exe, and may be technically a bug in powershell - but
it's unlikely to change nevertheless).
2. Under both powershell and cmd, users have to explicitly include the
extension when invoking the command.

I would like to propose that the .py extension be added to PATHEXT as part
of the "Register Python Extensions" option in the Python MSI installer.
This would mean that Python users had a clean way of writing cross-platform
"wrapper scripts" and command-line applications out of the box, just by
writing a normal Python script with a #! line at the top.

Does anyone have any objections to this? I could try to write a patch, but
I know next to nothing about building MSIs, so if any of the installer
experts could help that would be fantastic.

Paul

PS There would still be one difference, in that scripts intended to be used
as commands would be named with '.py' on Windows and with no extension on
Unix, but that's a pretty trivial difference, and reflects fundamental
platform differences rather than configuration. So I don't propose worrying
about this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130715/da10c602/attachment.html>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4