Output from php in my handle.py

Hi !
I’m trying to get output from my php script in my intent handling local command : handle.py like that:

elif intent == "StartARecord":
	process = subprocess.Popen(["curl","-s", ""],stdout=subprocess.PIPE,encoding='utf-8')
	data = process.communicate()
		for line in data:
			if line == "Process via_rec_audio_start.sh is already running\n":
				speech('my speech')

But i can’t view any output in data - object. If I try get output in my test python file it work well:

	process = subprocess.Popen(["curl","-s", ""],stdout=subprocess.PIPE,encoding='utf-8')
	data = process.communicate()

I’ma newbie in python. And maybe can me explain where do I dig to get my stdout from php

Thanks in advance!

Are you running the docker version of Rhasspy? I find that If I use the deb version my handle.py script can interface with other parts of the operating system better, like curl, gpio etc…

import sys
import json
import random
import os
from datetime import datetime
#above we import all the crazy things we might need

def speech(text):
    global o
    o["speech"] = {"text": text}

# get json from stdin and load into python dict
o = json.loads(sys.stdin.read())
intent = o["intent"]["name"]

if intent == "IntroduceSelf":
    reply =  "I am Marvin. I have been assigned to do voice stuff. Brain the size of a raspberry pi and they turn me into a voice program. All is never ending Woe!"

# convert dict to json and print to stdout

Thanks to reply!
I have a docker version. And my curl work’s well, but only i can’t get output from my php: stdout=subprocess.PIPE