To elaborate a little. For instance if the script is based on the one written by Joshua Bixby it would look like this:
def main():
import arcpy
import os
gdb = arcpy.GetParameterAsText(0)
search_for = arcpy.GetParameterAsText(1)
replace_with = arcpy.GetParameterAsText(2)
walk = arcpy.da.Walk(gdb, datatype="FeatureClass")
for root, dirs, files in walk:
rename = (name for name in files if search_for in name)
for fc in rename:
arcpy.AddMessage("Replacing '{0}' by '{1}'".format(fc, fc.replace(search_for, replace_with)))
arcpy.Rename_management(os.path.join(root, fc),
os.path.join(root, fc.replace(search_for, replace_with)))
if __name__ == '__main__':
main()
The tool would have 3 parameters:
And executing the tool would be like this:
The user will be provided information on the progress: