Hello
I am getting error to run this code with Python 2.7
Error invalid characters at this part
f"{os.path.splitext(txtFileNameWithExt)[0]}_{datetime.datetime.now():%Y_%m_%d}"
how can I fix this it? I need to run it on 2.7 .
#rename shapefile
txtFileNameWithExt = "Ops.shp"
txtFileNameNoExt = f"{os.path.splitext(txtFileNameWithExt)[0]}_{datetime.datetime.now():%Y_%m_%d}"
arcpy.env.workspace = my_Path
arcpy.Rename_management(txtFileNameWithExt,f"{txtFileNameNoExt}.shp")