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


Groups > comp.lang.python > #49156

Inconsistency on getting arguments

From Marco Perniciaro <Marco.Perniciaro@tomtom.com>
Subject Inconsistency on getting arguments
Date 2013-06-25 09:16 +0000
Newsgroups comp.lang.python
Message-ID <mailman.3826.1372164608.3114.python-list@python.org> (permalink)

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

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?

Regards,
Marco


Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Inconsistency on getting arguments Marco Perniciaro <Marco.Perniciaro@tomtom.com> - 2013-06-25 09:16 +0000

csiph-web