#!/usr/bin/python3

import os
import random


def rename_files(path):
    file_list = os.listdir(path)
    print(file_list)

    for file_name in file_list:
        # Remove numbers from filename.
        # new_file_name file_name.translation(None, "0123456789")

        # Add random numbers to beginning of filename.
        new_file_name = str(random.randint(1, 99)) + file_name

        print("Renaming " + file_name + " to " + new_file_name)
        os.rename(os.path.join(path, file_name), os.path.join(path, new_file_name))


print("# Python program - Adding random numbers to beginning of filename.")

rename_files("./prank")

[((8, 16, 8, 32), 'os.listdir', 'os.listdir', ({(8, 27, 8, 31): 'path'}, {}), '(path)', False, 'import os\n'), ((19, 18, 19, 47), 'os.path.join', 'os.path.join', ({(19, 31, 19, 35): 'path', (19, 37, 19, 46): 'file_name'}, {}), '(path, file_name)', False, 'import os\n'), ((19, 49, 19, 82), 'os.path.join', 'os.path.join', ({(19, 62, 19, 66): 'path', (19, 68, 19, 81): 'new_file_name'}, {}), '(path, new_file_name)', False, 'import os\n'), ((16, 28, 16, 49), 'random.randint', 'random.randint', ({(16, 43, 16, 44): '(1)', (16, 46, 16, 48): '(99)'}, {}), '(1, 99)', False, 'import random\n')]