[Tutor] sys.argv[1: ] help

Jeff Shannon jeffshannon at gmail.com
Mon Feb 28 00:12:21 CET 2005


On Sun, 27 Feb 2005 17:55:54 +0000, Richard gelling
<uselinux34 at yahoo.co.uk> wrote:
> 
> No What I get if I was to type in
> ./arg1.py a  b c
> 
> All I get is
> []

It sounds as though the command shell is not passing along the
additional parameters.  Try opening Windows Explorer, and go to the
Folder Options (in the Tools menu, IIRC).  Go to the "File Types" tab,
find PY (Python File), and click the "Advanced" button.  In the
resulting dialog, select the "open" action and click "edit", then look
at the command line that it's using.  You want something that looks
like:

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

The '%*' bit at the end is what I suspect may be missing in your settings.

(There's some chance that cmd.exe uses a different set of settings
than Windows Explorer does, in which case you'll have to research that
independently.  I know that you can use the "assoc" command to
associate the .py extension with the Python.File filetype, but I'm not
sure how to create filetypes or change actions that are taken upon
filetypes if it's different from the Explorer settings....)

Jeff Shannon


More information about the Tutor mailing list