2 Replies Latest reply on Dec 5, 2012 2:27 PM by shaun_weston-eagle-co-nz-esridist

    List Toolbox then Run

      I'm trying to figure out how to call a tool from another tool in python. In my python script of got something similar to the code below to get a list of all tools and I basically want the script to run them all automatically, but can't figure out how. So basically what is going to happen is someone will create a new tool in the toolbox and this will automatically be added to the process and run automatically without having to alter the code.

      So my question is does anyone know how to automatically run a custom python tool? I can get a list of the tools in the toolbox, just not sure how to get them to run automatically.

      import arcpy
      # Create a list of the conversion tools#
      tools = arcpy.ListTools("*_conversion")
      # Loop through the list and print each tool's usage#   
      e.g., 'Usage: merge <inputs;inputs...> <output> {field_mappings}'#
      for tool in tools:    
      print arcpy.Usage(tool)