As I move through my small collection of python scripts written for arcgis 9.3 I'm discovering that many things work with little or no changes in arcgis 10. For example this pattern "just works":
import arcgisscripting
gp = arcgisscripting.create(9.3)
gp.workspace = 'd:/scratch'
even though the new way is:
import arcpy
from arcpy import env
env.workspace = 'd:/scratch'
So my question is, what it is the best structure to follow so that scripts are only written in the v10 way when they need functionality not available in earlier versions? Or perhaps better phrased as, what is the best structure for backwards compatiblity? I don't want to make my stuff automatically unavailable to people on earlier versions, just when it wouldn't work anyway.
from arcpy import env as gp... (shudders) – Mike T Mar 16 '11 at 11:27