Python in Optimized mode with /usr/bin/env

Paulo Eduardo Neves pauloneves at gmail.com
Tue Nov 22 09:22:25 EST 2005


This is more of a shell or env question, but I believe others here have
gone through this.

I want to run an optimized python using the portable /usr/bin/env, but
the obvious ways aren't working.

#!/usr/bin/env  python -O
when I run ./test.py I get:
/usr/bin/env: python -O: No such file or directory

#!/usr/bin/env PYTHONOPTIMIZE=YES python
freeezes when I run ./test.py

#!/usr/local/bin/python -O
works fine.

Any suggestion about how to do it without using an ugly hack as making
an shell script just to set the environment?

thanks in advance for any help.




More information about the Python-list mailing list