[Fwd: [Distutils] Automatic creation of .pyc files]
Andrew MacIntyre
Andrew.MacIntyre@aba.gov.au
Mon Apr 1 19:04:02 2002
> -----Original Message-----
> From: Andy Todd [mailto:andy47@halfcooked.com]
> Sent: Tuesday, 26 March 2002 2:29 PM
{...}
> When packaging a Python module is it possible to stop the automatic
> creation of .pyc on installation?
>
> I ask because in PythonCard we currently store our
> configuration data in
> files that are imported but never executed (i.e. they just contain a
> list). When I package up the prototype and make it available I would
> like to be able to stop .pyc versions of these files being created.
Perhaps I'm missing something, but just importing the module will force
recompilation and creation of the .pyc file anyway (unless the directory
containing it is not writeable) so I don't see what the real issue is.
If the .py file gets updated, the .pyc file will then get updated
(file/directory permissions permitting) on the next import.
If this really bugs you, perhaps eval() is a more attractive solution.
-----------------------------------------------------------------------
Andrew MacIntyre \ E-mail: andrew.macintyre@aba.gov.au
Planning & Licensing Branch \ Tel: +61 2 6256 2812
Australian Broadcasting Authority \ Fax: +61 2 6253 3277
-> "These thoughts are mine alone!" <----------------------------------