<div class="gmail_quote">On Thu, Oct 22, 2009 at 5:43 PM, Andreas Roehler <span dir="ltr">&lt;<a href="mailto:andreas.roehler@online.de">andreas.roehler@online.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Rustom Mody wrote:<br>
&gt; On Tue, Oct 20, 2009 at 1:59 PM, Andreas Roehler<br>
</div><div class="im">&gt; &lt;<a href="mailto:andreas.roehler@online.de">andreas.roehler@online.de</a> &lt;mailto:<a href="mailto:andreas.roehler@online.de">andreas.roehler@online.de</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     Rustom wrote:<br>
&gt;     &gt; (cmd (format &quot;exec(compile(open(&#39;%s&#39;).read(), &#39;%s&#39;, &#39;exec&#39;)) #<br>
&gt;     &gt; PYTHON-MODE\n&quot; filename filename)))<br>
<br>
</div>For me both of your variants are working, see output of checks below.<br>
<br></blockquote><div>You probably need to try on windows.<br>See<br><a href="http://bugs.python.org/issue5524">http://bugs.python.org/issue5524</a> <br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

uname -a &amp;&amp; python --version &amp;&amp; cat 2+4.py &amp;&amp; cat exec-read.py &amp;&amp; python exec-read.py &amp;&amp;<br>
                                      cat exec-compile-read.py &amp;&amp; python exec-compile-read.py<br>
<br>
==&gt;<br>
<div class="im"><br>
Linux ... 2.6.22.19-0.2-default #1 SMP 2008-12-18 10:17:03 +0100 i686 athlon i386 GNU/Linux<br>
</div>Python 2.5.1<br>
#! /usr/bin/env python<br>
 # -*- coding: utf-8 -*-<br>
<br>
print 2 + 4<br>
##################<br>
#! /usr/bin/env python<br>
 # -*- coding: utf-8 -*-<br>
<br>
exec(open(&#39;2+4.py&#39;).read())<br>
######################<br>
<br>
6<br>
#! /usr/bin/env python<br>
 # -*- coding: utf-8 -*-<br>
<br>
exec(compile(open(&#39;2+4.py&#39;).read(), &#39;2+4.py&#39;, &#39;exec&#39;))<br>
#################<br>
<br>
6<br>
<br>
<br>
;;;;;;;;;;;;;;;;;<br>
<br>
BTW can you tell whats the us of `compile&#39; here for you?<br>
<br></blockquote><div>See <br><a href="http://stackoverflow.com/questions/436198/what-is-an-alternative-to-execfile-in-python-3-0">http://stackoverflow.com/questions/436198/what-is-an-alternative-to-execfile-in-python-3-0</a> <br>
</div><div> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Do you have some tests for python-mode.el?<br></blockquote></div>As in automated el/py etc? No<br>
As in biological? ...<br>Heres yours truly :-)<br>