Last active
April 19, 2024 08:29
-
-
Save jmquintana79/3b9a3eac5caa5fd33b77508d0022c3c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
if os.path.isfile("filename.txt"): | |
# file exists | |
f = open("filename.txt") | |
if os.path.isdir("data"): | |
# directory exists | |
if os.path.exists(file_path): | |
# file or directory exists |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment