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


Groups > comp.lang.python > #66054

Re: Top down Python

Date 2014-02-12 16:40 +0000
From John Allsup <pydev@allsup.co>
Subject Re: Top down Python
References <52FB1D27.8090009@allsup.co>
Newsgroups comp.lang.python
Message-ID <mailman.6763.1392223253.18130.python-list@python.org> (permalink)

Show all headers | View raw


I've realised that the best way to do this is to use a web browser for 
the graphical front end: high end graphics are simply not a necessity 
here, so one does not need to leave the confines of the browser.  Thus 
we need a simple server script.

I'm still minimalist, so I guess we want xmlrpc and a python server, 
with a bit of javascript in the browser to sort out the drawing end. 
This now seems way simpler than trying to play with Gtk or Qt.

Basically the lesson is to use a web browser engine as a graphics engine 
unless you have performance issues.  Hopefully in future html rendering 
engines will not be so strongly coupled to browsers, or even to the html 
format itself, but will be a general purpose user graphics engine (an 
ncurses for bitmapped displays).

Can anybody suggest the quickest way to learn the bits of xmlrpc (in 
python) that I need to do this.  Once it's working, I'll stick a source 
code download on my website.  There will be only one version released: 
the one that works properly.  Thus there is no need to github this.

All the best,

def my_sig():
     print("--")
     print(signame(['n','o','h',uppercase('j')]).written_backwards)

On 12/02/2014 07:05, John Allsup wrote:
> What is needed for proper learning is near-absolute simplicity.
> Even one toy too many to play with is an intolerable distraction,
> but one too few massively hampers learning and induces boredom.
>
> 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).
>
> Programming should be that efficient if we learn to make things
> beautiful and not tolerate wastes of lines and characters, on
> a global scale as well as locally to our projects.
>
> Consider
> ====
> #!/usr/bin/env python3
>
> from myappfw import app
> from myapp1 import repl
> app.background = "Moutains1"
> t = app.terminal.open(title="Typing commands One Oh One",position="centre",
>      width="80%",height="72%",rows="20",columns="64")
> exit(t.run(repl))
> ====
>
> What Python would I need to write, as concise but readable as
> practically possible, so that the above program works as desired (for
> any repl that obeys the basic input-process-output behaviour of a repl)?
>
> This is top-down design done right IMO (as described in Thinking Forth,
> by the way).

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


Thread

Re: Top down Python John Allsup <pydev@allsup.co> - 2014-02-12 16:40 +0000
  Re: Top down Python Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-02-13 11:54 +1300

csiph-web