Idiom for running compiled python scripts?

Alex Martelli aleax at
Fri Mar 23 15:47:04 CET 2007

Mark <markbpan at> wrote:
> so I could just do a "python_compile_and_run" and it would
> do what I want, i.e. run myscript.pyc if available and valid, generate
> and run it if necessary.

You can use

python -c 'import myscript; myscript.main()'

and variations thereon.


More information about the Python-list mailing list