Skip to content
Advertisement

Tag: file-locking

Locking a file in Python

I need to lock a file for writing in Python. It will be accessed from multiple Python processes at once. I have found some solutions online, but most fail for my purposes as they are often only Unix based or Windows based. Answer Alright, so I ended up going with the code I wrote here, on my website link is

Advertisement