I'd like to rename files in the current directory with the *.inp and *out extensions
#!/usr/bin/env python
import glob
import os
for namefile in glob.glob('*.inp'):
new_namefile = namefile.replace('dim', 'mon')
os.rename(namefile, new_namefile)
How can I rename files *.inp and *.out at the same time?