Как я могу разобрать / извлечь данные из ненормализованной ячейки таблицы в MySql?

Вы можете найти pylocker очень полезным. Он может использоваться для блокировки файла или для механизмов блокировки в целом и может быть доступен сразу из нескольких процессов Python.

Если вы просто хотите заблокировать файл, вот как это работает:

import uuid
from pylocker import Locker

#  create a unique lock pass. This can be any string.
lpass = str(uuid.uuid1())

# create locker instance.
FL = Locker(filePath='myfile.txt', lockPass=lpass, mode='w')

# aquire the lock
with FL as r:
    # get the result
    acquired, code, fd  = r

    # check if aquired.
    if fd is not None:
        print fd
        fd.write("I have succesfuly aquired the lock !")

# no need to release anything or to close the file descriptor, 
# with statement takes care of that. let's print fd and verify that.
print fd

0
задан Panthr073 30 December 2018 в 02:31
поделиться