Willy Ortiz
Willy Ortiz

Reputation: 11

Python: change directory to download folder in chrome os

I'm new to python and I can not figure out how to change the directory to the downloads folder in chrome OS. i have a main.py file i wanted to import.

i've tried

os.chdir("file:///home/chronos/user/downloads")

os.chdir("/home/chronos/user/downloads")

I can only get as far as /home and then it stops me. I wasnt sure if i had to be in developer mode or not to chdir past /home can anyone help?

Upvotes: 1

Views: 2444

Answers (1)

Alex Shroyer
Alex Shroyer

Reputation: 3829

What are you up to?

Chromebooks and Chromeboxes by default don't have Python, or a way to install it. That's kind of the point of Chrome OS. So a little info about your setup would be most helpful.

That said, Chrome OS can be made to do lots of useful things (such as... run Python scripts), but yes, at minimum you have to enable developer mode and install some things.

Easiest possible answer:

Since I use crouton for all my Chromebook developer stuff, I'll answer with the assumption that you do too:

From inside the chroot, try /home/[username]/Downloads instead. This points to the same Downloads directory as the one you can see from within Chrome OS.

Upvotes: 1

Related Questions