Are there any way to check the file existence in Python script.
Printable View
Are there any way to check the file existence in Python script.
Python provides exists() function which can be used like below.
import os.path
if(os.path.exists("/etc/passwd")):
print("/etc/passwd exists")