Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '(at': 0.04; 'output': 0.05; 'subject:getting': 0.07; 'sys': 0.07; 'advice.': 0.09; 'lines:': 0.09; 'mess': 0.09; 'trailing': 0.09; 'yeah,': 0.09; 'python': 0.11; 'gui': 0.12; '2.7': 0.14; 'windows': 0.15; '"python"': 0.16; "'a',": 0.16; "'b',": 0.16; '(windows': 0.16; 'grep': 0.16; 'how,': 0.16; 'investigate': 0.16; 'marco': 0.16; 'parameter.': 0.16; 'received:74.208.4.195': 0.16; 'skip:[ 30': 0.16; 'unsafe': 0.16; 'url:windows': 0.16; 'variable.': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'import': 0.22; 'previously': 0.22; 'print': 0.22; 'header:User-Agent:1': 0.23; 'environment': 0.24; "i've": 0.25; 'script': 0.25; 'least': 0.26; 'header:In-Reply- To:1': 0.27; 'installed': 0.27; 'fixed': 0.29; 'on,': 0.29; 'am,': 0.29; "i'm": 0.30; 'file': 0.32; 'probably': 0.32; 'figure': 0.32; 'quite': 0.32; 'url:python': 0.33; 'maybe': 0.34; "i'd": 0.34; 'could': 0.34; 'display': 0.35; 'common': 0.35; 'something': 0.35; 'but': 0.35; 'doing': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'should': 0.36; 'two': 0.37; 'list': 0.37; 'skip:[ 10': 0.38; 'to:addr:python-list': 0.38; 'issue': 0.38; 'that,': 0.38; 'to:addr:python.org': 0.39; 'system.': 0.39; 'either': 0.39; 'called': 0.40; 'users': 0.40; 'even': 0.60; 'logged': 0.60; 'tell': 0.60; 'new': 0.61; 'simple': 0.61; "you're": 0.61; 'such': 0.63; 'different': 0.65; 'line,': 0.68; 'received:74.208': 0.68; 'user,': 0.69; 'applying': 0.72; 'programs,': 0.74; 'behavior': 0.77; 'commands.': 0.84; 'experiment': 0.84; 'missing.': 0.84; 'otten': 0.84 Date: Tue, 25 Jun 2013 10:17:23 -0400 From: Dave Angel User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Inconsistency on getting arguments References: <5EDCC30CBA986647AAD0B4DA15FAC92D36FCD5FA@NLSRVWP-EXM02.ttg.global> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V02:K0:gmqBsVe5J7Qdw+E+ufuBxKFuXY7ReD3yT+nqcpC7/7u o5tUCicki8pWbox2lqwRNhuiOOBDJVpJf/JIXclGe4nDT/Ht3N 5xYso7azB4oySfrMoiELDdtFdr18w70h+oFi8tj3Oc4358m7bB iyS/VyLlduro++CYRkIu3VjKX+XIcRKsm0iNHB3OicY65FGJrP u+6ySzzNx7gnZmhYZXVWjKpqu3rzd3rh4nFIzzoXrpEwW9wWP1 WITmKzCKcH8xYRpA5cjbzQG7aV1zDBaN7pQ6UjiXsW7anUxbmo Ja4NclSCeKHgdi8HV/nw7C4PEaPoutPVezmFGv2+03ESk/x3IT lmY1pZOgg01y+UFXihPg= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 55 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1372169858 news.xs4all.nl 15903 [2001:888:2000:d::a6]:59021 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:49163 On 06/25/2013 09:55 AM, Peter Otten wrote: > Marco Perniciaro wrote: > >> Hi, >> I've been working with Python for a long time. >> Yet, I came across an issue which I cannot explain. >> >> Recently I have a new PC (Windows 7). >> Previously I could call a Python script with or without the "python" word >> at the beginning. Now the behavior is different if I use or not use the >> "python" prefix! >> >> I only have Python 2.7 installed and the path in in my environment >> variable. I create a simple file called "example.py" which contains two >> lines: >> >> import sys >> print sys.argv >> >> This is the output result: >> >> C:\Users\mapr>example.py a b c >> ['C:\\Users\\mapr\\example.py'] >> >> C:\Users\mapr>python example.py a b c >> ['example.py', 'a', 'b', 'c'] >> >> Can someone please explain? > > I'm not a Windows user, but I'd try > > http://docs.python.org/2/using/windows.html#executing-scripts > > with python.exe instead of pythonw.exe. Maybe the %* is missing. > I'm not a Windows user either (at least for quite a while). But I'd investigate with assoc and ftype and see that the ftype includes the trailing %* parameter. Do not mess with .pyw and pythonw, as they are both for GUI programs, and you're doing a console program. I think if you type ftype it'll list them all. So if you grep that, you should be able to find the line for Python.File And yeah, you can probably tell ftype to just display that line, but I don't have a system to try it on, or even to use /? on, so I'm not going to issue unsafe advice. If the ftype and/or assoc are incorrect, I've been told that it should be fixed in the registry, not using those two commands. Something about applying to all users instead of just the currently logged in one. But I'd have to experiment to figure out just how, and I don't have common access to such a system. -- DaveA