Help with python scripting (newbie level)
Hello! Im newbie at Python and i need help! Please take a look of example of my script and tell me what i did wrong.
from os import popen
from sys import argv
from subprocess import Popen, PIPE
string = Popen(['arg1', 'arg2', 'arg3'...], stdin=PIPE, stdout=PIPE)
if "ABCD" in string: print "1"
else: print "0"
So the script should enter command with arg1,2,3 and output shoud have lot of informations, and in those informations it should include string "ABCD", so i want this... IF string "ABCD" is found print 1, else print 0.
I get error:
TypeError: argument of type 'Popen' is not iterable
I would really appreciate your help!
Thanks in advance
|