Save files to a new python folder

0
folder = "C:\Users\Martin\Downloads\WL tags"
df = pd.read_csv("Tags para Mandar WL.csv",  header=0,  sep = ",")
for i, g in df.groupby('Inventory Name'):
    g.to_csv(folder, '{}.csv'.format(i.split('/')[0]), index=False)

I want to save my created files in the following folder and I can not do it since I get this error:

IOError: [Errno 13] Permission denied: 'C:\Users\Martin\Downloads\WL tags'
    
asked by Martin Bouhier 04.10.2017 в 05:29
source

1 answer

0

Well, let's see, your answer needs to know something else, since I would consider it irresponsible for me to tell you to give you "maximum" permissions, without your knowing exactly what you are doing. Therefore, the first thing I recommend is to learn about the permissions of folders in operating systems.

Generally, each directory has "read, write, and execute" permissions. They also have "owners", that is, which user or group of users that directory belongs to.

In your case, what you are looking to modify are permissions on "reading, writing and executing" that directory where you are going to save.

Here I leave both links of how to do it in both OS.

MAC: link

WINDOWS: link

I hope it's your solution =)

    
answered by 04.10.2017 / 07:18
source