Here I'm trying to rename the files bbut idont know what is wrong i'm getting FileNotFoundError: [WinError 2] The system cannot find the file specified: 'Screenshot (72).png' -> '72-Screenshot.png' plz anyone show me the path to resolve this error
import os
for i in os.listdir('Experiment'):
f_name, f_ext = os.path.splitext(i)
f_name, f_num = f_name.split('(')
f_name = f_name.strip()
f_num, f_useless = f_num.split(')')
k = f'{f_num}-{f_name}{f_ext}'
os.rename(i, k)
[[1]: https://i.stack.imgur.com/XYpdL.png[1]
-----------> remove the space form the <file_name>.png Program :