where are the .pyc files?

Summercool Summercoolness at gmail.com
Mon Sep 17 03:33:21 EDT 2007


On Sep 16, 6:56 pm, Steve Holden <st... at holdenweb.com> wrote:
> Summercool wrote:

> > how come a program that runs directly doesn't need to be optimized
> > into bytecode first?  Or... is it that the interpreter will just run
> > the program as it goes by, without ever generating a .pyc file?   So
> > what if you have a program that you only update every few weeks...
> > then you can ask a .pyc to be generated so that it runs faster every
> > time?
>
> You can, if you want, compile a program manually:
>
>    http://docs.python.org/lib/module-compileall.html
>
> and run the resulting .pyc file if you wish. Most people don't bother,
> though. If you have a very large main program you can encapsulate it as
> a library and then call the library function from a teent-weeny main
> program that isn't worth compiling.

that's great... I just wonder why there is no command line that says

  python -c try.py

or something like that to force a generation of the byte code.






More information about the Python-list mailing list