I was always wishing there was an easy way to create a unique scratch name for outputs of geoprocessing scripts. Today I found the simple solution http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/CreateScratchName/000v0000001z000000/
The Create Scratch Name code does just that so if you are making a temporary copy of features or a temporary buffer or whatever you can slap this line in and have it make names for you. Its great for someone like me that has to run their code 70 times before finishing it.
After trying too much I realized that this approach cannot be used to create tables. At least not in a geodatabase. Lame.
ReplyDeleteThe work around is to use the arcpy.Exists()function to see if a name exists then delete it if it does.