I need to get the output from netcat in python script. My current code is
response = subprocess.Popen(["netcat","smtp.myserver.net", "25"], stdout=subprocess.PIPE).stdout.read()
x = response.find("220 ***")
I want it to check for 200 * status and work with that, but it seems to wait for my input everytime it runs in a loop. How can I open netcat, get it's result, close it and move on?