title: List comprehension works in Python shell, but not inside a script
body: <p>I'm writing a math plugin for a bot, and testing my code in the python interactive shell which executes it normally:</p>
  
  <pre><code>&gt;&gt;&gt; text = "!math 0.023*67"
  
  &gt;&gt;&gt; string1 = [b for b in a for a in text.split("!math ") if len(a) != 0]
  
  &gt;&gt;&gt; print string1
  
  ['0', '.', '0', '2', '3', '*', '6', '7']
  </code></pre>
  
  <p>But when i include it in a script, it fails with a TypeError:</p>
  
  <pre><code>Traceback (most recent call last):
  File "/Users/ema/Openshift/pythonbot/plugins/math/math.py", line 61, in &lt;module&gt;
  string1 = [b for b in a for a in text.split("!math ") if len(a) != 0]
  NameError: name 'a' is not defined
  </code></pre>