Skip to content

Files

47 lines (28 loc) · 1.61 KB

OS_Remove_file.md

File metadata and controls

47 lines (28 loc) · 1.61 KB



Template request | Bug report | Generate Data Product

Tags: #os #python #remove #file #system #library #snippet #operations

Author: Florent Ravenel

Description: This notebook will show how to remove file from system using os library.

References:

Input

Import libraries

import os

Setup Variables

  • file_path: path of the file to be removed
file_path = "untitled.txt"

Model

Remove file

This function will remove the file from the system.

os.remove(file_path)

Output

Display result

print(f"The file '{file_path}' has been removed from the system.")