Source Code:
(back to article)
import os # Check if "myfile.txt" is a regular file if os.path.isfile("myfile.txt"): print("File found!") else: print("File not found.")
Result:
Report an issue