Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #66488

passing an option to the python interpreter

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jabba.laci@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'scripts': 0.03; 'interpreter': 0.05; 'output': 0.05; 'error:': 0.07; 'problem?': 0.07; 'option,': 0.09; 'skip:/ 10': 0.09; 'python': 0.11; '"python': 0.16; 'exist.': 0.16; 'script,': 0.16; 'system-wide': 0.16; 'virtualenv.': 0.16; 'subject:python': 0.16; 'thanks,': 0.17; 'command': 0.22; 'looks': 0.24; 'this:': 0.26; 'tried': 0.27; 'thus': 0.29; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'run': 0.32; 'skip:# 10': 0.33; 'subject:the': 0.34; 'could': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'hi,': 0.36; 'to:addr:python-list': 0.38; 'skip:. 10': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'first': 0.61; 'such': 0.63; 'overcome': 0.74; 'env': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=ACPEeoSSbznGck7okVyxAZ9ZD07IHSkiLSykOOV6Hm8=; b=xxG86P5GUAJNJ9ptVx2fQ5Iy74p3X624/AxcB6RJq4EaVCWANjpXZMqXdY/sQNyCEO kfFwLj7uBpfQ0fhNmVSBrAClmOW93cOuO8gGCqW2yJXJyHS9X1QqOWUK1qcp+JiRm87r V7iTpwWMBULd/nRQjUBQqVYuZBVhq4dG/6CVvevrNoFg01mk1PO2MiBhRsroslNbIfij /WUY/24yVoZm8S/SRsP4uPIY3y1TLSv/uhBMkZLMA9wVJ+6w7Z/DQVmxtRcfqyE9kGJp cBYEDhNTKNemDcmfFc02um3HLZJCGKiNzIZngmBypwLUw27RAIYmvusTH2HV9/p5LY9G u9oQ==
X-Received by 10.60.116.74 with SMTP id ju10mr13228462oeb.6.1392503593283; Sat, 15 Feb 2014 14:33:13 -0800 (PST)
MIME-Version 1.0
From Jabba Laci <jabba.laci@gmail.com>
Date Sat, 15 Feb 2014 23:32:53 +0100
Subject passing an option to the python interpreter
To Python mailing list <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.7026.1392503602.18130.python-list@python.org> (permalink)
Lines 29
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392503602 news.xs4all.nl 2905 [2001:888:2000:d::a6]:38687
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:66488

Show key headers only | View raw


Hi,

The first line in my scripts looks like this:

#!/usr/bin/env python

I would like to use unbuffered output in a script, which can be done
with the -u option, thus I tried this:

#!/usr/bin/env python -u

But if I want to run it from the command line ($ ./unbuffered.py), I
get this error:

/usr/bin/env: python -u: No such file or directory

env is looking for "python -u" but such a command doesn't exist.

How to overcome this problem? I could write

#!/usr/bin/python -u

but I prefer to call python through env. For instance if I put this
last one in a virtualenv, that would call the system-wide interpreter
not the one in the virtualenv.

Thanks,

Laszlo

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

passing an option to the python interpreter Jabba Laci <jabba.laci@gmail.com> - 2014-02-15 23:32 +0100
  Re: passing an option to the python interpreter Marko Rauhamaa <marko@pacujo.net> - 2014-02-16 00:47 +0200
    Re: passing an option to the python interpreter Anssi Saari <as@sci.fi> - 2014-03-02 21:40 +0200

csiph-web