Error if an output file already exists (matplotlib)
If I have a file already, and try to overwrite it, I get an error:
file = __builtin__.open(filename, mode, buffering)
IOError: [Errno 13] Permission denied:
I use the matplotlib savefig function.
Full Error Output: http://rn0.ru/show/8AXiJGpriPqIQa8cdcGk/
The error only occurs if I restart the worksheet. If I manually delete all the file(s), there is no problem. How can I fix it? An easy solution would be to delete the output files before I try to overwrite them, but how can I delete files?
I found a quick and dirty way: import os os.remove(DATA+"CSVFullOutput.csv")