Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed1.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.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'forgive': 0.05; 'say,': 0.05; 'subject:Python': 0.06; 'lines,': 0.07; 'compact': 0.09; 'sure,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; 'gui': 0.12; 'background.': 0.14; '"create': 0.16; '(which,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'i.e.,': 0.16; 'imo,': 0.16; 'nail': 0.16; 'repl': 0.16; 'reusable': 0.16; 'component': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'written': 0.21; 'feb': 0.22; 'cc:addr:python.org': 0.22; 'setup,': 0.24; 'fairly': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'this:': 0.26; 'primary': 0.26; 'asking': 0.27; 'header:In-Reply- To:1': 0.27; "doesn't": 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'lines': 0.31; 'that.': 0.31; 'libraries': 0.31; 'object.': 0.31; 'with,': 0.31; 'writes:': 0.31; 'run': 0.32; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'really': 0.36; 'otherwise.': 0.36; 'entry': 0.36; 'being': 0.38; 'depends': 0.38; 'generic': 0.38; 'window': 0.38; 'handle': 0.38; 'pm,': 0.38; 'rather': 0.38; 'little': 0.38; '12,': 0.39; 'extremely': 0.39; 'how': 0.40; 'matter': 0.61; 'john': 0.61; 'simply': 0.61; 'simple': 0.61; "you're": 0.61; 'making': 0.63; 'such': 0.63; 'more': 0.64; 'great': 0.65; 'within': 0.65; 'of:': 0.68; 'user,': 0.69; 'hammer': 0.84; 'prepackaged': 0.84; 'subject:Top': 0.84; 'worthless': 0.84; 'to:none': 0.92; 'picture': 0.97 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=DLb78OumZzLZRS1mJZ4+W/ObI6ZT6afOyVooxLunWvs=; b=OmzJjHLQZIFEvLjhUvliBRHX6DtuLJztNfLY/LJTytM5brJC/KnZIlI81oOmng/deA I7RDgvngRdlpBDOCHE5Sx9IeVPQ0teRUUG7MZwi6QT+Qp+wPRvbW3Y+PHASv5I1Z8lSu 8pFp8eIKHzmRKfut5SY9n62a+i6uJQ7RfjNQK/xj3w2nr/pB0ajpO+EgwaXbgag4AK/u cO/yF5xbu2ZHKvDLi/2LITEG40y9mIHOf3Dv+a+Rf5DMSlnwMWWCC51V2jOXWZgtZMLL Dh8leanHKqF4wR1QaH48htfDzq9y6pXxq0PFRKK0XZGyZpNfguOtH6/pcXRut/ZS0AED fE4A== MIME-Version: 1.0 X-Received: by 10.68.112.164 with SMTP id ir4mr20710553pbb.153.1392191432475; Tue, 11 Feb 2014 23:50:32 -0800 (PST) In-Reply-To: References: Date: Wed, 12 Feb 2014 18:50:32 +1100 Subject: Re: Top down Python From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 37 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392191435 news.xs4all.nl 2916 [2001:888:2000:d::a6]:59454 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66005 On Wed, Feb 12, 2014 at 6:40 PM, John Gordon wrote: > In John Allsup writes: > >> I want to be able to say: >> 1. Put a nice picture on the background. >> 2. Put a terminal window with, say, 64x20 lines, dead centre. >> 3. Run a simple REPL program written in Python or Ruby within it. >> I do not really want to write any more lines of code than I need to. >> Why do we not have langauges and libraries that can do the above >> with only five lines of code (line 0 == setup, line 4 == cleanup). > > You're asking for prepackaged libraries with extremely specific behavior. > Forgive me for making an analogy on the Internet, but your request is akin > to asking for a hammer that will automatically pound six-penny nails > through half-inch drywall, while facing south, on Tuesdays. > > Such a hammer is great if those are your specific requirements, but > worthless otherwise. It's much better to sell a generic hammer. Sure, > it's a little more work for the user, but it will pound any type of nail > though a variety of surfaces. I.e., it's reusable. There is a reusable component to this: a "terminal window" GUI object. If one existed, then this would be a matter of: 1) Create window 2) Put picture as background 3) Create terminal window with size 64x20 (which, IMO, is tiny) 4) Call on subprocess to handle REPL Depending on how compact the code is, it might take 6-10 lines rather than five, but it would be fairly short. However, it depends on being able to simply "create terminal window" the way you "create button" or "create entry field". As far as I know, this doesn't exist *anywhere*, which is why I've written a number of MUD clients whose primary purpose is to do exactly that. ChrisA