Path: csiph.com!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder1.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'syntax': 0.03; 'output': 0.04; 'subject:Python': 0.05; 'bash': 0.07; 'completeness': 0.07; 'though:': 0.07; 'scripts': 0.09; 'python': 0.09; 'received:155': 0.09; 'scripting': 0.09; 'tab': 0.09; 'to:addr:pobox.com': 0.09; 'wraps': 0.09; 'index': 0.13; 'library': 0.15; 'bash,': 0.16; 'disclaimers': 0.16; 'disclaimers,': 0.16; 'distinct': 0.16; 'echo': 0.16; 'footnotes': 0.16; 'from:addr:jpmorgan.com': 0.16; 'fuzzy': 0.16; "isn't.": 0.16; 'oct': 0.16; 'reasonably': 0.16; 'received:155.180': 0.16; 'received:155.180.234': 0.16; 'received:155.180.234.122': 0.16; 'received:159.53': 0.16; 'received:159.53.110': 0.16; 'received:bankone.net': 0.16; 'received:exchad.jpmchase.net': 0.16; 'received:jpmchase.com': 0.16; 'received:jpmchase.net': 0.16; 'received:se3.svr.bankone.net': 0.16; 'received:svr.bankone.net': 0.16; 'securities,': 0.16; 'specified.': 0.16; 'strange,': 0.16; 'subject:based': 0.16; 'syntax.': 0.16; 'url:disclosures': 0.16; 'url:jpmorgan': 0.16; 'variable.': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'variables': 0.17; 'shell': 0.18; '(or': 0.18; 'appropriate': 0.20; 'equivalent': 0.20; 'to:name:python- list@python.org': 0.20; 'bit': 0.21; 'supposed': 0.21; 'commands,': 0.22; 'needed.': 0.23; 'to:2**1': 0.23; 'seems': 0.23; 'received:169.254': 0.24; 'command': 0.24; 'script': 0.24; 'header:In-Reply-To:1': 0.25; 'am,': 0.27; 'accuracy': 0.27; 'besides': 0.27; 'lines': 0.28; 'run': 0.28; 'far,': 0.29; 'quoting': 0.29; 'scripting,': 0.29; 'received:169': 0.29; 'maybe': 0.29; 'header:Received:8': 0.30; '(and': 0.32; 'could': 0.32; 'mixed': 0.33; 'to:addr:python-list': 0.33; 'clear': 0.35; 'open': 0.35; 'doing': 0.35; 'something': 0.35; 'but': 0.36; 'possible': 0.37; 'does': 0.37; 'two': 0.37; 'drop': 0.37; 'subject:: ': 0.38; 'easier': 0.38; 'some': 0.38; 'things': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'little': 0.39; 'subject:-': 0.40; 'think': 0.40; 'information,': 0.63; 'url:email': 0.63; 'more': 0.63; 'making': 0.64; 'legal': 0.65; 'subject': 0.66; 'talking': 0.66; 'purchase': 0.67; 'benefit': 0.70; 'saw': 0.75; 'sale': 0.76; 'agenda,': 0.84; 'completly': 0.84; 'received:169.254.8': 0.84 X-DKIM: OpenDKIM Filter v2.1.3 sj3.jpmchase.com q94MP6v0007818 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpmorgan.com; s=smtpout; t=1349389506; bh=ukcRWBwa81HCa7KxNhfAH7lEluMw0dFbswWekz2brYU=; h=From:To:Subject:Date:Message-ID:References:In-Reply-To: Content-Transfer-Encoding:MIME-Version:Content-Type; b=azpqto1uz/1rKup0sybOK3/d6tXEy9LZwURXiKtNuLNIrKBMv2kd0TH0SIY4oEU5S 86b8brAkAAH3z7B/UdDObmH6tOMcOxXeV2ky5/9DjQjQF342aDYdN0dmN7w+H3Obki jyafjV9K9Y4LtydkPedBJQwIb56K6uOSEdWHgYtY= From: "Prasad, Ramit" To: Jonathan Hayward , "python-list@python.org" Subject: RE: Experimental Python-based shell Thread-Topic: Experimental Python-based shell Thread-Index: AQHNoPRV0wgQLeiccEK25RVYzyMRw5en3e6AgAAd74CAAAyzAIAAEJKAgAGfa/A= Date: Thu, 4 Oct 2012 22:24:17 +0000 References: <8646284b-df85-45fe-a793-56b081c6262c@googlegroups.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.67.79.47] Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-DLP-FWD: Yes 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 40 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1349389515 news.xs4all.nl 6946 [2001:888:2000:d::a6]:50058 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:30753 (A little quoting manipulation to make it easier to read with=0D=0Aappropri= ate context=2E)=0D=0A=0D=0A> > On Wed, Oct 3, 2012 at 11:25 AM, Amirouche B= oubekki wrote:=0D=0A> >=0D=0A> 2012/10/3= Jonathan Hayward =0D=0A> > > The chief ben= efit besides the searching, so far, is that you can use Py3k mixed with she= ll commands as the=0D=0A> > > scripting language--so script in Python inste= ad of bash=2E=0D=0A> > >=0D=0A> > > When using Python for scripting, Python= lines are indented by an extra tab (or four spaces) while shell-like=0D=0A= > > > commands are not indented=2E So:=0D=0A> =0D=0A> > > cjsh> =A0 =A0 for= index in range(10):=0D=0A> > > ----> echo %(index)d=0D=0A> > > ---->=0D=0A= > > > 0=0D=0A> > > 1=0D=0A> > > 2=0D=0A[snip]=0D=0A> > =0D=0A> > > Echo cou= ld (and maybe should) be a built-in, but it isn't=2E The output is os=2Esys= tem()'ed to bash, which echoes=0D=0A> > > based on a command that includes = the value of a Python variable=2E The implementation is a bit crude, but it= is=0D=0A> > reasonably powerful=2E=0D=0A> > > =0D=0A> > > I have other thi= ngs on the agenda, like making it able to run scripts and doing fuzzy match= ing, but for now=0D=0A> > > those are the main two attractions=2E=0D=0A> > = =0D=0A=0D=0A> > Is it possible to drop completly the bash syntax and use so= me python library (I saw it on github) that wraps=0D=0A> > bash commands wi= th python functions or the other around making it possible to call python f= unctions with a bash-=0D=0A> > like syntax=2E The syntax you are talking ab= out seems strange=2E=0D=0A> > =0D=0A> > Regards,=0D=0A> > =0D=0A> > Amirouc= he=0D=0A=0D=0AJonathan Hayward wrote:=0D=0A> I am open to suggestions and p= atches=2E I don't think the syntax strange, though: it offers a clear and d= istinct=0D=0A> way to differentiate Python and shell commands, and shell co= mmands can access Python variables when specified=2E=0D=0A> And it is a sim= ple rule, without footnotes needed=2E=0D=0A=0D=0AI need more footnotes=2E := ) Does every shell command not have indentation? =0D=0AHow can you tell if = the shell command is supposed to be in the loop or after=0D=0Athe loop?=0D= =0A=0D=0A for index in range(10):=0D=0A # do something=0D=0Aecho = %(index)d=0D=0A=0D=0AIs the above equivalent to Python pseudo-code solution= A or B?=0D=0A=0D=0ASolution A,=0D=0Afor index in range(10):=0D=0A #do s= omething=0D=0APopen('echo', file_path)=0D=0A=0D=0ASolution B,=0D=0Afor inde= x in range(10):=0D=0A #do something=0D=0A Popen('echo', file_path)=0D= =0A=0D=0AHow do I make achieve the other solution?=0D=0A=0D=0A=0D=0AThis em= ail is confidential and subject to important disclaimers and=0D=0Acondition= s including on offers for the purchase or sale of=0D=0Asecurities, accuracy= and completeness of information, viruses,=0D=0Aconfidentiality, legal priv= ilege, and legal entity disclaimers,=0D=0Aavailable at http://www=2Ejpmorga= n=2Ecom/pages/disclosures/email=2E