Locking a file in Python

后端 未结 13 2406
悲&欢浪女
悲&欢浪女 2020-11-22 03:00

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

13条回答
  •  旧时难觅i
    2020-11-22 03:43

    I found a simple and worked(!) implementation from grizzled-python.

    Simple use os.open(..., O_EXCL) + os.close() didn't work on windows.

提交回复
热议问题