Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Python using os and chdir to read and write to iCloud

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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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/')
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading