Idiom for running compiled python scripts?
mark.iinet.news at mailinator.com
Fri Mar 23 13:22:44 CET 2007
On Fri, 23 Mar 2007 22:24:07 +1100, Steven D'Aprano wrote:
> if not os.path.exists(compiledname) or \ os.stat(compiledname)[MT] <
> # compiled file doesn't exist, or is too old
Surely the validity check done by Python is more sophisticated than
this? Doesn't the binary file have to be compiled under the same python
> Now don't forget to test whether launching the subshell takes longer
> than the 20ms you might save. All that effort, and wouldn't it be ironic
> if it was actually *slower* than executing the script from scratch each
But Python proper is executing all the above anyhow isn't it? So the 20
msecs advantage I measured already includes this logic.
Anyhow, I give up. Compilation, it seems, only applies to python
modules. Compilation is not appropriate for Python scripts. Should be
in the FAQ.
More information about the Python-list