How do you get the path showing automatically for the output file in a script tool

Discussion created by badruddin on Mar 29, 2011
Latest reply on Mar 30, 2011 by garnertb
How can I display the directory path of my workspace (C:\\temp\\GIS222\\Data) in the outputDir  for the following code in a script tool intended to run Buffer? Any help will be highly appreciated.

import arcpy
arcpy.env.workspace = "C:\\temp\\GIS222\\Data"
input = arcpy.GetParameterAsText(0)
outputDir = arcpy.GetParameterAsText(1)
outputFile = arcpy.GetParameterAsText(2)
distance = arcpy.GetParameterAsText(3)

arcpy.Buffer_analysis(input, outputDir + "\\" + outputFile,distance, "","","ALL")