Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #83132 > unrolled thread

Re: Command Line Inputs from Windows

Started byChris Angelico <rosuav@gmail.com>
First post2015-01-03 08:29 +1100
Last post2015-01-03 08:29 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Command Line Inputs from Windows Chris Angelico <rosuav@gmail.com> - 2015-01-03 08:29 +1100

#83132 — Re: Command Line Inputs from Windows

FromChris Angelico <rosuav@gmail.com>
Date2015-01-03 08:29 +1100
SubjectRe: Command Line Inputs from Windows
Message-ID<mailman.17334.1420234154.18130.python-list@python.org>
On Sat, Jan 3, 2015 at 6:44 AM, Ken Stewart <gordon_ken_stewart@msn.com> wrote:
> This works:
> python myScript.py arg1 arg2 arg3
>
> This doesn’t work:
> myScript.py arg1 arg2 arg3

The latter form is governed by the association. I don't know off-hand
where that's set in the registry, but you should be able to poke
around in folder settings to find it (but, thank you very much
Microsoft, the exact menu path has changed a number of times between
Win2K and Win8). On WinXP, if I have my test-box set up correctly,
it's View, Folder Options, File Types, select the one for .py,
Advanced, select "open", Edit. That'll tell you that the application
used is something like:

"C:\Python27\python.exe" "%1" %*

The %* should mean that arguments get carried through; if that's
missing, you won't get any args.

I may have some details wrong, and it's likely to be a little
different on Win7, but poke around and look for a missing %*. Or,
better still, make sure you have the py.exe launcher; then you can
have Python scripts request a specific interpreter using a PEP 397
compliant shebang, which will also work nicely on Unix systems.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web