title: In Python, how do you use decimal module in a script rather than the interpreter?
body: <p>I'm using Python 2.5.4 and trying to use the decimal module. When I use it in the interpreter, I don't have a problem.  For example, this works:</p>
  
  <pre><code>&gt;&gt;&gt; from decimal import *
  &gt;&gt;&gt; Decimal('1.2')+ Decimal('2.3')
  Decimal("3.5")
  </code></pre>
  
  <p>But, when I put the following code:</p>
  
  <pre><code>from decimal import *
  print Decimal('1.2')+Decimal('2.3')
  </code></pre>
  
  <p>in a separate file (called decimal.py) and run it as a module, the interpreter complains:</p>
  
  <blockquote>
    <p>NameError: name 'Decimal' is not defined</p>
  </blockquote>
  
  <p>I also tried putting this code in a separate file:</p>
  
  <pre><code>import decimal
  print decimal.Decimal('1.2')+decimal.Decimal('2.3') 
  </code></pre>
  
  <p>When I run it as a module, the interpreter says:</p>
  
  <blockquote>
    <p>AttributeError: 'module' object has no attribute 'Decimal' </p>
  </blockquote>
  
  <p>What's going on?</p>