cyarrow

Python export from ModelBuilder Error- IndexError: list index out of range

Discussion created by cyarrow on Mar 30, 2011
Latest reply on Oct 21, 2018 by curtvprice
Please bear with me, I'm new to using Python.

I am trying to create a scheduled task to run a model from ModelBuilder weekly.
First, I exported my model from ModelBuilder as a Python script (to verify, this models runs when manually prompted in Modelbuilder). Then, I wanted to verify the model ran as a Python script, so I ran the module using IDLE, however, I keep getting an error:

Traceback (most recent call last):
  File "\\<server>\gis\<project_folder>\Scripts\<script_name>.py", line 24, in <module>
    <event_name> = sys.argv[1]
IndexError: list index out of range

I have searched other forums with little taken from them as I cannot view line 24. I can only view the sys.argv[1] as:

<event_name> = sys.argv[1]
if <event_name> == '#':
<event_name> = "<event_name>" # provide a default value if unspecified

Please, if someone can help, offer your assistance!

Outcomes