Pandas - Read/Write to the same csv quickly.. getting permissions error
Close the file that you are trying to read and write and then try running your script.
Hope it helps
I have a script that I am trying to execute every 2 seconds.. to begin it reads a .csv with pd.read_csv. Then executes modifications on the df and finally overwrites the original .csv with to_csv.
I'm running into a PermissionError: [Errno 13] Permission denied: and from my searches I believe it's due to trying to open/write too often to the same file though I could be wrong.

Any suggestions how to avoid this?
Not sure if relevant but the file is stored in one-drive folder.
It does save on occasion, seemingly randomly.
Increasing the timeout so the script executes slower helps but I want it running fast!

Thanks