sys.argv in a windows environment
Question: I'm attempting to learn python using the book 'a byte of python'. The code:

    
    
    import sys
    
    print('the command line arguments are:')
    for i in sys.argv:
        print(i)
    
    print('\n\nThe PYTHONPATH is', sys.path, '\n')
    

outputs:

    
    
    the command line arguments are:
    C:/Users/user/PycharmProjects/helloWorld/module_using_sys.py
    
    
    The PYTHONPATH is ['C:\\Users\\user\\PycharmProjects\\helloWorld', 'C:\\Users\\user\\PycharmProjects\\helloWorld', 'C:\\Python34\\python34.zip', 'C:\\Python34\\DLLs', 'C:\\Python34\\lib', 'C:\\Python34', 'C:\\Python34\\lib\\site-packages'] 
    

when the book said that the output should be:

    
    
    The command line arguments are:
    module_using_sys.py
    we
    are
    arguments
    
    
    The PYTHONPATH is ['/tmp/py',
    # many entries here, not shown here
    '/Library/Python/2.7/site-packages',
    '/usr/local/lib/python2.7/site-packages']
    

The book is written for python 2, whereas I am using python 3. My question is
**why is there a difference?**


Answer: You are calling the script wrong

Bring up a cmd (command line prompt) and type:

    
    
    cd C:/Users/user/PycharmProjects/helloWorld/
    module_using_sys.py we are arguments
    

And you will get the correct output.

