AnsweredAssumed Answered

IndexError: list index out of range

Question asked by baroan on May 8, 2012
Latest reply on May 9, 2012 by baroan
I am new to Python programming and I am trying to see if a working directory is there and if not create it.  I keep getting the following error IndexError: list index out of range.  Not sure what I am doing wrong.
I would appreciate it if anyone can lend some assistance.

import string, sys, shutil, glob, os, arcpy  #print sys.argv  print arcpy.CheckOutExtension("Spatial") from arcpy.sa import * arcpy.env.overwriteOutput = True  #check to see if scratch directory exists: if os.path.isdir(sys.argv[1] + "/working")<> True:     arcpy.CreateArcInfoWorkspace_management(sys.argv[1], "working")      if os.path.isdir(sys.argv[1] + "/output")<> True:     arcpy.CreateArcInfoWorkspace_management(sys.argv[1], "output") arcpy.AddMessage ("Output workspace created")  arcpy.env.workspace = sys.argv[1]

Outcomes