Skip to content

Latest commit

 

History

History
48 lines (29 loc) · 1.65 KB

OS_Rename_file.md

File metadata and controls

48 lines (29 loc) · 1.65 KB



Template request | Bug report | Generate Data Product

Tags: #os #python #snippet #operations

Author: Divakar

Description: This notebook will show how to rename file using os library.

References:

Input

Import libraries

import os

Setup Variables

  • input_file_path: input file path
  • output_file_path: output file path
input_file_path = "test1.ppt"
output_file_path = "test2.ppt"

Model

Rename file using os

os.rename(input_file_path, output_file_path)

Output

Display result

print(f"File {input_file_path} successfully renamed: {output_file_path}!")