79425795

Date: 2025-02-09 22:43:47
Score: 0.5
Natty:
Report link

Still learning, but I found solution that satisfies me at least.

  1. Create fifo descriptor in parent
if not os.path.exists(fifo_path):
        os.mkfifo(fifo_path)
  1. Launch process that will write to this fifo
    python_process = multiprocessing.Process(
        target=child_func,
    )
    python_process.start()
    
   
    write_fd = open(fifo_path, "w")
    write_fd.close()
  1. Open fifo and pass to subprocess

      fifo = os.open(fifo_path, os.O_RDONLY)
      fzf = subprocess.Popen(
           [
               "fzf",
           ],
           stdin=fifo,
           text=True,
       )

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Vladislav Zikunov