I have a list of files for which I would like to replace a substring within their name. The glob.glob(path)
returns:
'./path\\2016_Joe_Black_tall_blond',
etc.
where Joe_Black
should become Joe-Black
.
I would have to do the same for other names, e.g. Tim_Blue
becomes Tim-Blue
etc.
(can I gather all those into names=[Joe_Black, Tim_Blue ...]
?)
I have found multiple approaches online, but what would be the best to do it?