If reading and writing to the local file system, then something like this should work...
import os
# create four dummy files
in_file_names = ['in_file_number_{}.txt'.format(i) for i in xrange(7, 11)]
print(in_file_names)
for file_name in in_file_names:
if not os.path.isfile(file_name):
with open(file_name, 'w') as out_file:
out_file.write('This file was only created for a demo.\n\tYou can safely delete this file.')
# The real app starts here...
def rename_files(in_file_names, out_file_fmt = '', starting_number = 1):
out_file_fmt = out_file_fmt or 'freshly_watermarked_file_{:0>3}.txt'
for in_file_name in in_file_names:
out_file_name = out_file_fmt.format(starting_number)
assert not os.path.isfile(out_file_name), 'File already exists: ' + out_file_name
os.rename(in_file_name, out_file_name)
starting_number += 1
rename_files(in_file_names)