Python in Optimized mode with /usr/bin/env

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paulo Eduardo  Neves

    #1

    Python in Optimized mode with /usr/bin/env

    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.

  • Christoph Zwerschke

    #2
    Re: Python in Optimized mode with /usr/bin/env

    Paulo Eduardo Neves schrieb:[color=blue]
    > I want to run an optimized python using the portable /usr/bin/env, but
    > the obvious ways aren't working.[/color]

    Seems to be a Linux problems others also experienced:


    -- Christoph

    Comment

    Working...