How to organize ping interactively? My version also works, but you need to wait ...
def pings(request, phost): a = subprocess.Popen('ping -n -c 3 -W 2 %s' %phost,shell=True, stdout=subprocess.PIPE) res = a.stdout.readlines() return render_to_response('switch/pingf.html',{'p':res})