I am trying to remove all the hyphen from 50 file names and replace it with a space. I am sure my code is correct, but I am getting an error, I am not sure why it is happening, read many documentation and watch several instruction video, and still no luck. I would also prefer a regex method if possible.
for f in os.listdir(dstPath):
r = f.replace("-", "")
if (r != f):
os.rename(f, r)
And it gives the error below. My destination of the file path is saved inside a variable named "dstPath"
FileNotFoundError: [WinError 2] The system cannot find the file specified: