Summercool wrote: > On Sep 16, 10:36 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: >> The `*.pyc` files are usually only created when you import a module, not >> when a module is run directly. > > 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. regards Steve -- Steve Holden +1 571 484 6266 +1 800 494 3119 Holden Web LLC/Ltd http://www.holdenweb.com Skype: holdenweb http://del.icio.us/steve.holden Sorry, the dog ate my .sigline -- http://mail.python.org/mailman/listinfo/python-list