Reputation: 69
I have a Python file in /Users/homedir/...
and I want it to access a csv
file on an external hard drive.
Does anyone know how to do this? I only need reading permission.
Upvotes: 6
Views: 11211
Reputation: 91
I have USB connected WD 4 TB hard drive that appears as "My Passport for Mac" in finder. I have created a folder called model on this drive and stored a file called model.json
Here is code to read the file.
import os
import sys
# load json and create model
json_file = open('/Volumes/My Passport for Mac/model/model.json', 'r')
loaded_model_json = json_file.read()
json_file.close()
My Mac Mini has 121 GB SSD which I find limiting when I work with huge data for ML exercises. I used to keep getting messages such as "low volume. clean up your disk " often and then I had to clean the files. To work around I bough 4 TB external HD from WD and attached it to MAC mini via USD. I put all my data files and models onto this drive now and it works fine.
Upvotes: 6
Reputation: 340
External drives can be found under /Volumes on macOS. If you provide the full path and have read access you should be able to read in your csv.
Upvotes: 8