Assume these variables are supplied:
base_path = "C:\\Python34\\myscript\\" filename = "sassykitten.jpg"
This won't work:
path = os.path.join(base_path, "/images", filename)
path will now contain:
This is due to the slash in
/images, which will make the rest of the join start at root. You can join any number of strings, but they should not include slashes.
Do this instead:
path = os.path.join(base_path, "images", filename)
You will get the desired: