[Tutor] why the recompile?

Michael P. Reilly arcege@speakeasy.net
Wed, 13 Feb 2002 14:18:14 -0500


On Tue, Feb 12, 2002 at 05:24:33PM -0600, Christopher Smith wrote:
> I am trying to get an installation distributed on a set of iBooks for a
> course.  I ran compileall on my own installation, copied that to the
> master server disk and from there it gets copied onto the individual
> iBooks.  The hope was to avoid having to recompile every time a new
> session is started.  (Even though the recompile is done, the installation
> is restored to the original set during shutdown of the computer.)
> 
> Here's the problem:  when the IDE starts up it recompiles a bunch of
> files.  For example, codeop.py (created July 18,2001 and modified Aug
> 19,2001) is recompiled even though the existing codeop.pyc in that
> directory has the creation and modification dates of Feb 7, 2002.  There
> are 68 files in all that are recompiled, located in lib; mac/Lib;
> Mac/Tools/IDE; and mac/lib/carbon.
> 
> Why is this recompiling and what can I do to avoid this?  The .pyc's date
> is more recent than the .py's.  I confirmed this with the stat() function
> as well and can see that the time of modification matches that which I see
> on the file in the Finder.  The IDE itself (if it matters) was created at
> 6:43 pm on 2/7 and the codeop.py file at 11:32 am)

I don't really have an answer to offer.  But possibly a work around.

Unless you are trying to get the students to see the Python code,
you could remove all the .py files (except the calling program file)
and just keep the .pyc files.  The python interpreter would not care
if it was using pre-compiled or raw source, but it would prevent it
from always trying to recompile the .pyc files.

  -Arcege