py vs pyc

Tomasz Lisowski list at notmyisp.pl
Mon Jan 9 04:23:09 EST 2006


Sakcee wrote:
> Hi
> 
> I want to know that is .pyc files execute faster than .py files,? since
> both are interpreted by python  , is there any speedup in using one or
> other.?
> 
> e.g.
> 
> what is the difference between runing from cmd  "python test.py" and
> "python test.pyc"
> 
> 
> thanks
> 
When running "python test.py" the interpreter will first precompile the 
test.py source file, and then execute it. When running "python 
test.pyc", the interpreter will go straight to the execution of the script.

Tomasz



More information about the Python-list mailing list