When to use Absolute Path vs Relative Path in Python
For reference. The absolute path is the full path to some place on your computer. The relative path is the path to some file with respect to your current working directory (PWD). For example: Absolute path: C:/users/admin/docs/stuff.txt If my PWD is C:/users/admin/ , then the relative path to stuff.txt would be: docs/stuff.txt Note, PWD + relative path = absolute path. Cool, awesome. Now, I wrote some scripts which check if a file exists. os.chdir("C:/users/admin/docs") os.path.exists("stuff.txt") This returns TRUE if stuff.txt exists and it works . Now, instead if I write, os.path.exists("C: