Home > Software engineering >  Python using os and chdir to read and write to iCloud
Python using os and chdir to read and write to iCloud

Time:09-21

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?

CodePudding user response:

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