Can anyone help me with this or some guidance for this, I need to display the output of the subprocess.popen in the browser in real time but i can make it work i know its possible but I've been searching for days for the answer but still no luck.
so far i have this running and im using eclipse as the IDE
views.py
def test1(request):
p = subprocess.Popen(['ping', 'google.com'], stdout=subprocess.PIPE, bufsize=1)
for line in iter(p.stdout.readline, b''):
pr = print(line)
p.stdout.close()
p.wait()
return HttpResponse(pr)
I get this code in this link and it works fine but the output is just on the console window in eclipse and in the browser the output is None. I want to return the pr = print(line)
in the browser if its possible.
thank you very much in advance :)