I have made two python scripts. One will run always, another one will run when I start it. Suppose program A runs all time. I insert some information to a file through program B. Program A will check that file after some time and do the works according to instruction. I want to prevent the deadlock or dirty rear situation.
When I shall give input to the file, then program A will be unable to read that file. How can I do this in Python 3?