Answers for "Delete file in python Using the os module"

0

Delete file in python Using the os module

import os
if os.path.isfile('/Users/test/new_file.txt'):
    os.remove('/Users/test/new_file.txt')
    print("success")
else:    
    print("File doesn't exists!")
Posted by: Guest on April-09-2022

Code answers related to "Delete file in python Using the os module"

Python Answers by Framework

Browse Popular Code Answers by Language