How to count number of strings in a list
<p>My needs check windows process number. </p>

<pre><code>import sys
import os
import commands

ip = sys.argv[5]
val = sys.argv[1]
oid = "HOST-RESOURCES-MIB::hrSWRunName"
cmd = "snmpwalk -v 2c -c public %s %s" % (ip,oid)
(r_c,r_e) = commands.getstatusoutput(cmd)
if r_c != 0:
    print "C - snmpwalk is Error."
else:
    for i in r_e.split('\n'):
    a  =  i.split(':')[-1].strip(' "')
    print a
</code></pre>

<p>Result：</p>

<pre><code>conhost.exe
conhost.exe
conhost.exe
conhost.exe
fdhost.exe
cmd.exe
fdhost.exe
</code></pre>

<p>I hope the result is. I do not know how to achieve it.</p>

<pre><code>if sys.argv[1] &lt;5:#count(conhost.exe)
    print "critical -"
else:
    print "OK - "
</code></pre>

<p>How the statistics of my results? conhost.exe 4 conhost.exe 1 conhost.exe 1</p>
