On Thu, Oct 22, 2009 at 5:43 PM, Andreas Roehler <andreas.roeh...@online.de>wrote:
> Rustom Mody wrote: > > On Tue, Oct 20, 2009 at 1:59 PM, Andreas Roehler > > <andreas.roeh...@online.de <mailto:andreas.roeh...@online.de>> wrote: > > > > Rustom wrote: > > > (cmd (format "exec(compile(open('%s').read(), '%s', 'exec')) # > > > PYTHON-MODE\n" filename filename))) > > For me both of your variants are working, see output of checks below. > > You probably need to try on windows. See http://bugs.python.org/issue5524 > uname -a && python --version && cat 2+4.py && cat exec-read.py && python > exec-read.py && > cat exec-compile-read.py && python > exec-compile-read.py > > ==> > > Linux ... 2.6.22.19-0.2-default #1 SMP 2008-12-18 10:17:03 +0100 i686 > athlon i386 GNU/Linux > Python 2.5.1 > #! /usr/bin/env python > # -*- coding: utf-8 -*- > > print 2 + 4 > ################## > #! /usr/bin/env python > # -*- coding: utf-8 -*- > > exec(open('2+4.py').read()) > ###################### > > 6 > #! /usr/bin/env python > # -*- coding: utf-8 -*- > > exec(compile(open('2+4.py').read(), '2+4.py', 'exec')) > ################# > > 6 > > > ;;;;;;;;;;;;;;;;; > > BTW can you tell whats the us of `compile' here for you? > > See http://stackoverflow.com/questions/436198/what-is-an-alternative-to-execfile-in-python-3-0 > Do you have some tests for python-mode.el? > As in automated el/py etc? No As in biological? ... Heres yours truly :-)
_______________________________________________ Python-mode mailing list Python-mode@python.org http://mail.python.org/mailman/listinfo/python-mode