Python using os and chdir to read and write to iCloud

Viewed 25

I am using the following python code to access a folder in iCloud. I am getting an error of:

FileNotFoundError: [Errno 2] No such file or directory:

import os
os.chdir('/Users/me/Library/Mobile\ Documents/com~apple~CloudDocs/jupyter/')

Is there something I am missing?

1 Answers

There is no backslash in the directory name; you aren't using a shell, so the space does not need to be escaped.

os.chdir('/Users/me/Library/Mobile Documents/com~apple~CloudDocs/jupyter/')
Related