rename a file to that of its name python code example Example: rename file python import os os.rename('old_name.txt','new_name.txt')