You could use subprocess to invoke lsof from the command line like this
import subprocessfile_lock = str(subprocess.check_output("lsof | grep file_name", shell=True))