code: def get_open_fds():
      
      pid = os.getpid()
      procs = subprocess.check_output(["lsof", '-w', '-Ff', "-p", str(pid)])
      procs = procs.decode("utf-8")
  
      return len([s for s in procs.split('\n')
                  if s and s[0] == 'f' and s[1:].isdigit()])
docs: Return the number of open file descriptors for current process
  
      .. warning: will only work on UNIX-like OS-es.