Answers for "how to check if a folder contains a file in python"

13

python directory contains file

import os.path

if os.path.isfile('filename.txt'):
    print ("File exist")
else:
    print ("File not exist")
Posted by: Guest on May-03-2020
0

python if certain file is in a directory

import os

os.path.exists('./final_data_2020.csv')
Posted by: Guest on September-08-2021

Code answers related to "how to check if a folder contains a file in python"

Python Answers by Framework

Browse Popular Code Answers by Language