[Tutor] which file runs

Christopher Arndt chris.arndt at web.de
Wed Dec 6 02:13:01 CET 2006


Chris Hengge wrote:
> I have a script that makes my python scripts into .pyc files and I can 
> run those without a .py in the directory or anywhere else on the system 
> for that matter. No clever tricks needed.

You're right. Probably this trick was only needed in (very) old versions 
of Python. Also works with .pyo files:

python -OO -c "import myfile"
python myfile.pyo

Chris


More information about the Tutor mailing list