简体   繁体   中英

Import a csv file from desktop into Pycharm (on Mac)

I have trouble importing a csv file from my desktop into my Project folder in Pycharm. I would like to have this csv file in the same directory inside Pycharm.

I tried PyCharm->Project Structure->+Add content root, but it's not working.

Any ideas? Thank you

You can just copy and paste the csv file into the desired folder within the PyCharm project navigation window. Then you can use this code to open the file:

file = open("path to file here", "r")

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM