Inconsistency on getting arguments

M

Marco Perniciaro

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top