I want execute netcat command from my python script, so I use the 'subprocess.Popen', but the problem is that the output of this command is directly printed in may shell console, i want o get him in a variable , so i can do some modification before printing it.
res = subprocess.Popen("nc -v 192.168.1.1 25", stdout=subprocess.PIPE, stderr=None, shell=True)
#output = res.communicate()
#output = str(output)
#print output