Inconsistency on getting arguments

Discussion in 'Python' started by Marco Perniciaro, Jun 25, 2013.

  1. 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
    Marco Perniciaro, Jun 25, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Krishan

    color format inconsistency?

    Krishan, Sep 13, 2003, in forum: Java
    Replies:
    2
    Views:
    676
    Tim Tyler
    Sep 14, 2003
  2. Peter Otten

    Re: Inconsistency on getting arguments

    Peter Otten, Jun 25, 2013, in forum: Python
    Replies:
    0
    Views:
    113
    Peter Otten
    Jun 25, 2013
  3. Dave Angel
    Replies:
    0
    Views:
    99
    Dave Angel
    Jun 25, 2013
  4. Chris Angelico

    Re: Inconsistency on getting arguments

    Chris Angelico, Jun 25, 2013, in forum: Python
    Replies:
    0
    Views:
    101
    Chris Angelico
    Jun 25, 2013
  5. Dennis Lee Bieber

    Re: Inconsistency on getting arguments

    Dennis Lee Bieber, Jun 26, 2013, in forum: Python
    Replies:
    0
    Views:
    101
    Dennis Lee Bieber
    Jun 26, 2013
Loading...

Share This Page