title: Python: Count how many process ID's are running for a given script
body: <p>I need to check to see if there are more than 5 Process ID's running for a given script in python. Particularly, What module/methods would you recommend using to check if there are 5 or more processes of the same script that you are trying to run?  </p>
  
  <p>i.e. my script will be hypothetically be called <code>pythonrules.py</code>. I want to get a processlist to figure out how many <code>pythonrules.py</code> scripts are currently running on my system, and <code>exit()</code> if the <code>processcount &gt;= 5</code>. </p>
  
  <p>Please note this will be running in a linux environment.</p>