Dec-14-2019, 03:59 PM
Why not use the user-friendly pathlib module from the standard library ?
from pathlib import Path file1_name = Path("D:") / "Backupdata" post_fix = Path() / "PythonCodes" / "InputCSV1.csv" if (file1_name / post_fix).isfile(): print("File exists") else: print("No such file")