[Python-bugs-list] [ python-Bugs-539319 ] sys.argv only works with python exe
noreply@sourceforge.net
noreply@sourceforge.net
Thu, 04 Apr 2002 09:26:26 -0800
Bugs item #539319, was opened at 2002-04-04 10:38
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=539319&group_id=5470
Category: Python Library
Group: Platform-specific
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Mike Hostetler (thehaas)
Assigned to: Nobody/Anonymous (nobody)
Summary: sys.argv only works with python exe
Initial Comment:
This is a weird one, and I've know it works on other
Win2000 installations, but it doesn't work on mine.
sys.argv only works when I put "python" in front of it
in the cmd command line. However, the script does run
if I just type in it's name, but it ignores all command
line arguments.
Version: 2.2
Platform: Win2000
Example:
C:\stuff>type test.py
import sys
print sys.argv
C:\stuff>test.py arg1 arg2
['C:\stuff\test.py']
C:\stuff>python test.py arg1 arg2
['test.py', 'arg1', 'arg2']
Is this something with my setup, or something else??
----------------------------------------------------------------------
>Comment By: Mike Hostetler (thehaas)
Date: 2002-04-04 11:26
Message:
Logged In: YES
user_id=116274
I went into that, I had got the PY option, but instead it
sais "PY File". And instead of an advanced button, it had
"Change", with the text beside it saying "Change to Default
'Python File"" I hit that button, which than turned to
"Advanced" and the PY option turned into "Python File".
When I hit "Advanced" the option was 'C:\python22\python.exe
"%1" %*', it it now works from the command line:
C:\stuff>test.py arg1
['C:\stuff\test.py', 'arg1']
I'm not sure what caused it to change (perhaps Vim??) but it
works now.
Closing it myself. Thanks for the help
----------------------------------------------------------------------
Comment By: Thomas Heller (theller)
Date: 2002-04-04 11:13
Message:
Logged In: YES
user_id=11105
I can reproduce this behaviour if I change the association
for Python files from the default entry
'C:\python22\python.exe "%1" %*'
into
'C:\python22\python.exe "%1"'.
You can find this entry from Windows Explorer,
Tools->Folder Options->File Types.
Select the 'PY Python File' entry, press advanced, select
the 'open' entry, press edit, and look at the "Appplication
used to perform action" entry.
Probably something wrong with your setup.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=539319&group_id=5470