Python Program to check if file exist or not














































Python Program to check if file exist or not



Program to check if file exist or not
This program is tested on Python 3.6

Program:
import os
exists = os.path.isfile('/path/to/file')
if exists:
    print("File Exist")
else:
    print("File doesn't Exist")

Comments