Psychopy prevents other programs from accessing .txt files?

I have a psychopy program that occasionally writes to a .txt file. I have a separate python file that is continuously detecting that .txt. However, I am finding that while my psychopy program is running, my python program does not have access to the .txt file, even when the psychopy program is not currently writing or reading the file.

Any ideas on why this may be? Or if this is an issue not related to psychopy maybe?

To prevent conflicts, files tend to get locked when a program wants to access them. Another program may be able to read the locked file but not open it with full edit access.

If the file is a bespoke data file perhaps you can close the connection to it when it isn’t being written to so your other program can access it.