Top down Python

Chris Angelico rosuav at gmail.com
Wed Feb 12 02:50:32 EST 2014


On Wed, Feb 12, 2014 at 6:40 PM, John Gordon <gordon at panix.com> wrote:
> In <mailman.6729.1392188714.18130.python-list at python.org> John Allsup <pydev at allsup.co> 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



More information about the Python-list mailing list