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


Groups > comp.lang.python > #72283

Re: How to run script from interpreter?

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed1a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'parser': 0.07; 'subject:script': 0.09; 'subject:How': 0.10; 'cc:addr:python- list': 0.11; 'command,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'happily': 0.16; 'subject:run': 0.16; 'two.': 0.16; 'wrote:': 0.18; 'first.': 0.19; 'cc:addr:python.org': 0.22; 'creating': 0.23; 'interpret': 0.24; 'cc:2**0': 0.24; 'gets': 0.27; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; "d'aprano": 0.31; 'steven': 0.31; 'file': 0.32; 'option': 0.32; 'beginning': 0.33; 'fri,': 0.33; 'subject:from': 0.34; "can't": 0.35; 'connection': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'subject:?': 0.36; 'being': 0.38; 'pm,': 0.38; 'rather': 0.38; 'commands': 0.60; 'name': 0.63; 'provide': 0.64; '30,': 0.65; 'between': 0.67; 'connection.': 0.74; 'technically': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=SMzr0Jf0SL5PuFLDoOLvdgMv4aE2s9kdBrSTCNXRmd0=; b=zBhqO/kEJdN1Hv3lpqyip6LohEU3xrdNujK3IddKV7BQwCjQAzVO+75OYnqaR+BB2t LZ6B1tsl7pA09Hs3ucaNN8fRa6FDFQnIxADmuhe73PF9GsY+Fz7M9txQpLFwGg43lpHG Pq2WdADU9q2cuphD5koFR3s2wp2xUuGe6LXaix986zh08XKREpGvqDoA6N8hy9armryj Wr4rp8ZUoovVTvGoP911FSsJeERyphAHRu42NcbEizGyatNJAURCgvBuEH9GcWdsiA6u O/jjdbQgHD+/Qg/rujr4IdPw7MDK1QiPuekMxnUjbS7WUQlc5F7RUADYoe4/HrcGuOC7 hBtA==
MIME-Version 1.0
X-Received by 10.180.87.165 with SMTP id az5mr4017136wib.10.1401434340347; Fri, 30 May 2014 00:19:00 -0700 (PDT)
In-Reply-To <5388233e$0$29978$c3e8da3$5496439d@news.astraweb.com>
References <mailman.979847065.10000.python-list@python.org> <6e96c4c4-17db-464b-b291-816c534b70c4@googlegroups.com> <lm53fo$jhr$1@speranza.aioe.org> <5386a7e2$0$11109$c3e8da3@news.astraweb.com> <lm855p$1mu$1@speranza.aioe.org> <5387d1c4$0$29978$c3e8da3$5496439d@news.astraweb.com> <mailman.10466.1401410797.18130.python-list@python.org> <5387e3b1$0$29978$c3e8da3$5496439d@news.astraweb.com> <mailman.10469.1401415475.18130.python-list@python.org> <5388233e$0$29978$c3e8da3$5496439d@news.astraweb.com>
Date Fri, 30 May 2014 17:19:00 +1000
Subject Re: How to run script from interpreter?
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
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.10477.1401434346.18130.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1401434346 news.xs4all.nl 2855 [2001:888:2000:d::a6]:53698
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:72283

Show key headers only | View raw


On Fri, May 30, 2014 at 4:20 PM, Steven D'Aprano
<steve+comp.lang.python@pearwood.info> wrote:
>> It's on par with creating a file with a name beginning with a
>> hyphen, and then fiddling around with various commands as you try to
>> manipulate it (tip: "rm ./-r" works); programs will happily interpret
>> "-r" as an option rather than a file name, without being concerned that
>> it's technically legal.
>
> I don't see any connection between the two.

-r is a valid file name, just as . is a valid line of input. But with
the rm command, you can't provide it with -r as a file name - you have
to use ./-r or somesuch, because the parser gets to it first. That's
the connection.

ChrisA

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


Thread

Re: How to run script from interpreter? onlyvinish@gmail.com - 2014-05-28 00:44 -0700
  Re: How to run script from interpreter? Terry Reedy <tjreedy@udel.edu> - 2014-05-28 11:32 -0400
  Re: How to run script from interpreter? Mark H Harris <harrismh777@gmail.com> - 2014-05-28 11:39 -0500
    Re: How to run script from interpreter? Steven D'Aprano <steve@pearwood.info> - 2014-05-29 03:22 +0000
      Re: How to run script from interpreter? Mark H Harris <harrismh777@gmail.com> - 2014-05-29 15:26 -0500
        Re: How to run script from interpreter? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-30 00:33 +0000
          Re: How to run script from interpreter? Chris Angelico <rosuav@gmail.com> - 2014-05-30 10:46 +1000
            Re: How to run script from interpreter? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-30 01:49 +0000
              Re: How to run script from interpreter? Chris Angelico <rosuav@gmail.com> - 2014-05-30 12:04 +1000
                Re: How to run script from interpreter? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-30 06:20 +0000
                Re: How to run script from interpreter? Chris Angelico <rosuav@gmail.com> - 2014-05-30 17:19 +1000
                Re: How to run script from interpreter? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-30 11:27 +0000
                Re: How to run script from interpreter? Chris Angelico <rosuav@gmail.com> - 2014-05-30 21:46 +1000
                Re: How to run script from interpreter? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-05-30 19:28 +0000
                Re: How to run script from interpreter? Chris Angelico <rosuav@gmail.com> - 2014-05-31 05:47 +1000
                Re: How to run script from interpreter? Terry Reedy <tjreedy@udel.edu> - 2014-05-30 11:24 -0400

csiph-web