import os def rename_description_files(directory): for root, _, files in os.walk(directory): for file in files: if file.endswith('.description'): base_name = file.rsplit('.', 2)[0] # Split twice to remove the extra extension new_name = f"{base_name}.txt" old_path = os.path.join(root, file) new_path = os.path.join(root, new_name) os.rename(old_path, new_path) print(f"Renamed: {old_path} to {new_path}") if __name__ == "__main__": current_directory = os.getcwd() rename_description_files(current_directory)