Where to save text files on macosx

Joined
Mar 20, 2012
Messages
1
Reaction score
0
Points
1
I am doing natural language processing-related stuff and I have .txt files I need to parse. I just switched over from Windows 7 to mac and I'm still getting acquainted with the file structure. I'm working with Python. In Windows I would just save all my text files to the sitepackages folder and play around with them in IDLE from there. On my mac, I saved the text file under lib/python2.7 and tried doing a simple open('file.txt', 'r') in IDLE and it didn't recognize the file. My question is where should I save text files so that IDLE or .py modules can find them?

thnx
 

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Use the full path to the file - you shouldn't be saving anything in your site-packages folder. Put them somewhere in your user folder.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top