I am writing a utility in Python that may require a user to open a file while the Python program is writing to it.
The file is open as so in the Python program: CSV = open(test.csv, "a")
When the Python program is running and the user double clicks test.csv
in the OS, the Python program halts with the following error:
PermissionError: [Errno 13] Permission denied: 'test.csv'
I understand why this happens. I am wondering if there is something I can do so that the Python program can still write to the file while the file (a read-only copy perhaps) is open. I've noticed in the past that Perl programs, for example, still write to a file while it is open, so I know that this is programmatically possible. Can this be done in Python?