How to sum-up the numbers for the similar groups?
<p>I'm not a regular python programmer, so please bare with me.  </p>

<p>I've two questions. I'm trying to write a script which takes command line arguments and I see I can start the script either using:</p>

<pre><code>#!/bin/env python
</code></pre>

<p>or</p>

<pre><code>exec python -x "$0" "$@"
</code></pre>

<p>What's the difference between those two?</p>

<p>The second question is with scripting. I have an input data-set like this:</p>

<pre><code>group_a 5
group_a 7
group_c 6
group_a 8
group_b 8
group_b 4
group_c 7
group_a 8
....
....
</code></pre>

<p>How can I group together all the similar items and sum up the numbers like this: </p>

<pre><code>group_a 28
group_b 12
group_c 13
</code></pre>

<p>Thanks in advance for your time. I really appreciate your help. cheers!! </p>
