Idiom for running compiled python scripts?

Alex Martelli aleax at mac.com
Fri Mar 23 10:47:04 EDT 2007


Mark <markbpan at mailinator.com> wrote:
   ...
> so I could just do a "python_compile_and_run myscript.py" 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.


Alex



More information about the Python-list mailing list