Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'escape': 0.07; 'exit': 0.07; 'function,': 0.07; 'plenty': 0.07; 'python': 0.09; 'inserted': 0.09; 'notation': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'snippet': 0.09; 'portion': 0.13; '"current': 0.16; '(date': 0.16; 'amiga': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'candidates': 0.17; 'processor': 0.17; 'shell': 0.18; 'windows': 0.19; 'feb': 0.19; 'define': 0.20; 'operations.': 0.22; 'insert': 0.23; "python's": 0.23; 'statement': 0.23; "i've": 0.23; 'linux': 0.24; 'command': 0.24; 'script': 0.24; 'header:X-Complaints-To:1': 0.28; 'lines': 0.28; '(my': 0.29; "d'aprano": 0.29; 'mode.': 0.29; 'steven': 0.29; 'fri,': 0.30; 'mode': 0.30; 'code': 0.31; 'file': 0.32; 'could': 0.32; "aren't": 0.33; 'url:home': 0.33; 'handle': 0.33; 'to:addr:python-list': 0.33; 'text': 0.34; 'nature': 0.35; 'open': 0.35; 'similar': 0.35; 'something': 0.35; 'received:org': 0.36; 'but': 0.36; 'charset:us-ascii': 0.36; 'editor': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'perform': 0.38; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'address': 0.60; 'easy': 0.60; 'most': 0.61; 'save': 0.61; 'first': 0.61; 'subject:...': 0.63; 'published': 0.71; 'saw': 0.75; '2013': 0.84; 'drive.': 0.84; 'manuals': 0.84; 'viable': 0.84; 'dennis': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Opinion on best practice... Date: Fri, 08 Feb 2013 12:41:06 -0500 Organization: > Bestiaria Support Staff < References: <5111b826$0$29969$c3e8da3$5496439d@news.astraweb.com> <5112eb4a$0$29965$c3e8da3$5496439d@news.astraweb.com> <51134e9f$0$21812$c3e8da3$76491128@news.astraweb.com> <51142f5e$0$6512$c3e8da3$5496439d@news.astraweb.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-253-106-181.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 3.3/32.846 X-No-Archive: YES 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: 52 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1360345278 news.xs4all.nl 6873 [2001:888:2000:d::a6]:34594 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:38468 On Fri, 08 Feb 2013 09:49:02 +1100, Steven D'Aprano declaimed the following in gmane.comp.python.general: > > Well, Dennis claims that he *does* do it, and that it is one of the better > features of REXX. And in the code snippet you published earlier, I saw > plenty of code intended for the shell, but no CALL statement in sight. > I've not used it in years, but yes... Since on the Amiga many applications opened a "rexxport" they were candidates for "current command processor". REXX implementations on Windows and Linux aren't as flexible -- for the most part the only viable command processor is spawning a shell to handle one statement (a la Python's os.system() ). On the Amiga, one could script the systems text editor by using something similar to (my manuals are in storage): /* */ address EDITOR open "somefile.txt" 3d i date('n') save address COMMAND copy somefile.txt df0: (I don't recall the notation used to actually escape out of insert mode. Translated: Define the editor as the command processor Editor open file command Move down three lines Enter insert mode Insert current date (date is the REXX data function, what is inserted is the return value from calling date() Exit insert mode Save the file Revert to the normal command shell Use normal shell command to copy the file to the first floppy drive. It's the interactive nature seen in the editor portion that is not easy to perform using Python -- even with subprocess.Popen() and the various read/write operations. -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/