script wont accept parameters at command line

Discussion in 'Python' started by Kiddo463, Sep 22, 2008.

  1. Kiddo463

    Kiddo463

    Joined:
    Sep 22, 2008
    Messages:
    1
    Hi,
    I'm very new to Python and have been using it for very simple automation scripts so far. Until now, I have been running my scripts from within Pythonwin and ArcGIS software with great success. However, I'd like to start running from the command line now, but Python will not read in my parameters.

    For example, my script called script1.py is only these three lines:

    import sys
    params = sys.argv[0:]
    print params

    This is what I type at the command line:
    script1.py param1 param2 param3

    This is the result:
    ['C:\\scripts\\script1.py']

    Why will it not read in my other parameters? I have PY files set to run with Python.exe. Is there something else I have to set up on my machine? Any help would be great.

    thanks,
    Keith
     
    Kiddo463, Sep 22, 2008
    #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. John
    Replies:
    2
    Views:
    1,493
    Eliyahu Goldin
    Jul 31, 2005
  2. Jonck van der Kogel
    Replies:
    2
    Views:
    996
    Jonck van der Kogel
    May 27, 2004
  3. Patrik Carlsson
    Replies:
    2
    Views:
    498
    Patrik Carlsson
    Sep 2, 2003
  4. TOMERDR
    Replies:
    5
    Views:
    506
    Diego Martins
    Apr 4, 2006
  5. Bubba
    Replies:
    4
    Views:
    291
    Bubba
    Jun 29, 2011
Loading...

Share This Page