I understand what you mean... Indeed, the purpose of my script is to replace the white space in shapefiles contained in a workspace:
# Import arcpy module
import arcpy
import os
# Split input values using a semicolon.
inputs = sys.argv[1]
inputlist = inputs.split(";")
#Character to be replaced
old = sys.argv[2]
#New character
new = sys.argv[3]
outWorkspace = sys.argv[4]
try:
# Loop through the list of inputs.
for input in inputlist:
arcpy.AddMessage("Input: " + input)
newname = input.replace(old, new)
arcpy.AddMessage("Newname: " + newname)
#VALIDATE THE NEW FEATURE CLASS NAME FOR THE OUTPUT WORKSPACE
output = outWorkspace + os.sep + newname[newname.rfind(os.sep)+1:]
arcpy.AddMessage("Output: " + output)
#MESSAGE
arcpy.AddMessage("Converting " + str(input[input.rfind(os.sep)+1:]) + " to " + str(output[output.rfind(os.sep)+1:]))
#COPY FEATURES
arcpy.CopyFeatures_management(input,output, "", "0", "0", "0")
arcpy.Delete_management(input)
arcpy.AddMessage(str(input[input.rfind(os.sep)+1:]) + " Deleted")
arcpy.AddMessage("Processed" + "\n")
except:
arcpy.AddMessage(arcpy.GetMessages())