How can I print some part of a returned stdout of a subprocess? E.g. From the example below, how can I print only the "Number of features" and the "Number of predicates" ?
command = "java -cp \"C:\mallet-2.0.7\class;C:\mallet-2.0.7\lib\mallet-deps.jar\" cc.mallet.fst.SimpleTagger --train true --model-file model train
p = Popen(command, stdout=PIPE, stderr=STDOUT, shell = True)
for line in p.stdout:
print line
>>>
Number of features in training data: 6
Number of predicates: 6
Labels: O noun non-noun
Preparing O
O->O(O) O,O
.........