I'm trying to write a binary file i'm downloading from The Movie Database. I can successfully save the file if it's on the same folder the .py file is, but cannot save it on a location outside it even after the containing directory is created by the script and using absolute path:
FileNotFoundError: [Errno 2] No such file or directory: '/home/gabriel/Desktop/movies/w185/tt2024544.jpeg'
Pice of code:
filepath = os.path.join(webDir,size,imdbid + '.' + filetype);
f = open(filepath, "wb");
I'm puzzled. Any tips?
Thanks!