0

I reviewed this question. But I have another, slightly different question.

I have a script that runs several python programs (Windows os) and they write in append mode to a same file. I wanted to use some kind of lock, so when a program is writing to file, it will be locked.

In the absence of a lock, what happens if program1 is writing to file - can other programs wait until it finishes writing? Or can there be an error since the file is not accessible to other programs to write? Can you comment of good way to write file in append mode by several programs in python?

ccdq23
  • 7
  • 2
  • only one program can append to a file at a time ... this seems like bad program design... i would think a database would be more appropriate for what you want – Joran Beasley Sep 30 '17 at 00:51
  • I have only a line to write in the file. Database would be overkill – ccdq23 Sep 30 '17 at 00:57

0 Answers0