Just a few weeks until the 2021 JavaScript Full-Stack Bootcamp opens.
Signup to the waiting list!


The os.path.exists() method provided by the os standard library module returns True if a file exists, and False if not.

Here is how to use it:

import os

filename = '/Users/flavio/test.txt'

exists = os.path.exists(filename)

print(exists) # True


The 2021 JavaScript Full-Stack Bootcamp will start at the end of March 2021. Don't miss this opportunity, signup to the waiting list!

More python tutorials: