Python in Optimized mode with /usr/bin/env

  • Thread starter Paulo Eduardo Neves
  • Start date
P

Paulo Eduardo Neves

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,997
Messages
2,570,239
Members
46,827
Latest member
DMUK_Beginner

Latest Threads

Top