# Import system modules
import sys, string, os
dir = 'F:\\test'
# Import arcpy module
import arcpy
files = os.listdir(dir)
for f in files:
if os.path.splitext(f)[1] == '.grd':
# Script arguments...
Input_raster_file = dir + os.sep + f
# Local variables...
Output_data_type = "FLOAT"
Raster_Format = "TIFF"
Output_Workspace = "f:\\test\\TIFF"
# =============== file name process ======================
basename = os.path.splitext(f)[0];
Output_raster = Output_Workspace + os.sep + basename + ".tif";
if os.path.exists(Output_raster) == False:
print Input_raster_file
# Process: Raster To Other Format (multiple)...
arcpy.RasterToOtherFormat_conversion(Input_raster_file,
Output_Workspace, Raster_Format)
print Output_raster