compilation

Michael P. Soulier msoulier at nortelnetworks.com
Tue Jun 27 11:40:17 EDT 2000


In article <Pine.LNX.4.21.0006270751280.2223-100000 at fep132.fep.ru>, 
Oleg Broytmann wrote:

>#! /bin/sh
>
>if [ -z "$1" ]; then
>   echo "Usage: compyle file.py..."
>   exit 1
>fi
>
>TEMPLATE="from py_compile import compile; compile('"
>
>for file in $*; do
>   pgm=$TEMPLATE$file"')"
>   python -c   "$pgm" || exit 1
>   python -OOc "$pgm" || exit 1
>done
>
>   (I know I call python in the loop instead of looping inside python; I do
>this by purpose).

	Neat. So, once it's compiled into a pyc and pyo files, is there a way to
run those directly for better performance? I know that freeze links in the
interpreter. I guess I should use that if I want it. 

	Thanks,

	Mike

-- 
Michael P. Soulier, 1Z22, SKY  Tel: 613-765-4699 (ESN: 39-54699)
Optical Networks, Nortel Networks 
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to UNIX



More information about the Python-list mailing list