In Python, how do you use decimal module in a script rather than the interpreter?
<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>

<blockquote>
  <p>>>> from decimal import *</p>
  
  <p>>>> Decimal('1.2')+ Decimal('2.3')<br>
  Decimal("3.5")</p>
</blockquote>

<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 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>
