A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-January/076349.html below:

[Python-Dev] #! magic

[Python-Dev] #! magicOleg Broytmann phd at phd.pp.ru
Sun Jan 20 19:40:37 CET 2008
On Sun, Jan 20, 2008 at 07:30:03PM +0100, Christian Heimes wrote:
> Oleg Broytmann wrote:
> > #! /usr/bin/env python -O
> > 
> >    [trying to execute the script on Linux]
> > 
> > /usr/bin/env: python -O: No such file or directory
> > 
> > Oleg.
> 
> Oh right. I was sure that I've seen a shebang with options somewhere. It
> might have been a shell script or a perl script.

   Yes, one can write
#! /usr/bin/python -O
   This works. The OS (exec system call) splits the string into a program
(python) and a single parameter (-O), and python knows how to handle -O.

   The problem with
#! /usr/bin/env python -O
   is that exec splits it into a program (env) and a single parameter
(python -O) and env doesn't know how to run "python -O".

> Yet another python executable could solve the issue

   I doubt it. It is env that doesn't know how to run "python -O" in my
example, not python's problem.

Oleg.
-- 
     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4