Are there any way to check the file existence in Python script.
Gabriel9999 New Member Mar 21, 2019 34 0 6 Apr 23, 2020 #1 Are there any way to check the file existence in Python script.
S samueltarcin999 New Member Mar 22, 2019 32 0 6 Apr 24, 2020 #2 Python provides exists() function which can be used like below. Look https://www.poftut.com/check-whether-file-exists-using-python/ for more information. import os.path if(os.path.exists("/etc/passwd")): print("/etc/passwd exists")
Python provides exists() function which can be used like below. Look https://www.poftut.com/check-whether-file-exists-using-python/ for more information. import os.path if(os.path.exists("/etc/passwd")): print("/etc/passwd exists")