<div class="gmail_quote">On Thu, Oct 22, 2009 at 5:43 PM, Andreas Roehler <span dir="ltr"><<a href="mailto:andreas.roehler@online.de">andreas.roehler@online.de</a>></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>
> On Tue, Oct 20, 2009 at 1:59 PM, Andreas Roehler<br>
</div><div class="im">> <<a href="mailto:andreas.roehler@online.de">andreas.roehler@online.de</a> <mailto:<a href="mailto:andreas.roehler@online.de">andreas.roehler@online.de</a>>> wrote:<br>
><br>
> Rustom wrote:<br>
> > (cmd (format "exec(compile(open('%s').read(), '%s', 'exec')) #<br>
> > PYTHON-MODE\n" 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 && python --version && cat 2+4.py && cat exec-read.py && python exec-read.py &&<br>
cat exec-compile-read.py && python exec-compile-read.py<br>
<br>
==><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('2+4.py').read())<br>
######################<br>
<br>
6<br>
#! /usr/bin/env python<br>
# -*- coding: utf-8 -*-<br>
<br>
exec(compile(open('2+4.py').read(), '2+4.py', 'exec'))<br>
#################<br>
<br>
6<br>
<br>
<br>
;;;;;;;;;;;;;;;;;<br>
<br>
BTW can you tell whats the us of `compile' 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>