title: Python: How to write to a file while it is open in the OS
body: <p>I am writing a utility in Python that may require a user to open a file while the Python program is writing to it. </p>
  
  <p>The file is open as so in the Python program: <code>CSV = open(test.csv, "a")</code></p>
  
  <p>When the Python program is running and the user double clicks <code>test.csv</code> in the OS, the Python program halts with the following error: </p>
  
  <blockquote>
    <p>PermissionError: [Errno 13] Permission denied: 'test.csv'</p>
  </blockquote>
  
  <p>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?</p>