Problem running compiled Python script
<p>So I have compiled a python script with py2exe according to <a href="http://stackoverflow.com/questions/4158369/can-i-somehow-compile-a-python-script-to-work-on-pc-without-python-installed">this answer</a>. There were no errors during compilation, everything went fine.</p>

<p>When I run the script from a cmd like this:</p>

<pre><code>C:\Users\Richard\Dist\backprop3.exe 60
</code></pre>

<p>This is the output I get:</p>

<pre><code>C:\Users\Richard&gt;C:\Users\Richard\Dist\backprop3.exe 60
Traceback (most recent call last):
  File "backprop3.py", line 209, in &lt;module&gt;
  File "backprop3.py", line 175, in demo
NameError: global name '__file__' is not defined

C:\Users\Richard&gt;
</code></pre>

<p>Which is referring to this line:</p>

<pre><code>image = Image.open( os.path.dirname( os.path.abspath( __file__ ) )+"/backprop-input.bmp" )
</code></pre>

<p>That line just loads an image from a current directory. Where is the problem?</p>
