[Tutor] web-based python?

Che M pine508 at hotmail.com
Tue Aug 3 06:08:18 CEST 2010

Thanks, Alan, for this set of helpful pointers.  Just a few responses.

> Actually web apps are all pretty similar. They consist of three basic 
> parts
> (maybe 4):
> 1) A mechanism for mapping a URL to a Python function or method.
> 2) A mechanism for generating HTML with embedded data values
> 3) A data storage mechanism
> 4) Some client code for a more dynamic feel

What does "client code" and "more dynamic feel" mean here?

> > - The easiest possible "Hello, World!" (just text) in a web browser.
> <html><body><p>Hello, World!</body></html>
> That's it as a one liner.

I guess I meant the easiest possible "Hello, World!" that incorporates
Python and works through a server, etc.  This is just the HTML.  And
even with this, a total beginner will have no idea that he or she should
copy that into a Notepad window, save it as helloworld.html, and then
open that file from Firefox to see it as HTML.  The point is, in many
discussions of web programming all the elements (and there are 
many) are scattered and disconnected from the concrete steps one 
needs to take to put them into working order.  

I recall that CherryPy has a little walk-through on how to get something
very simple working with it, and that's closer to what I'm recommending.
(Though obviously you're just answering bullet points in an email and
this is not your tutorial :D ).

> If you want it as a CGI program in Python its only slightly longer
> and the CGI documentation shows you how...

Probably that's what I'm after, but my guess is the CGI documentation
is not particularly approachable (though haven't checked).  A beginner
would also not know where "the" CGI documentation is.

> > - How you can get more than just text on a web app, that is, 
> > widgets, and
> >   therefore what are currently the options for that (learning 
> > javascript and whatever
> >   widget toolkits are out there for that; qooxdoo; Pyjamas; others).
> This is where it gets very complicated. 

And yet I think this what it's all about.  When beginners think about
a web app (or dynamic web page as someone else here put it), they
don't think about HTML and text going back and forth to/from a server, 
they think about widgets similar to widgets seen on the desktop 
(calendars, buttons, textboxes, checkboxes, etc.).  I was excited to
see the Quooxdoo widget set and heard it might be possible to use
it with a Python backend...via JSON (which I don't know about) but
it was too nebulous to motivate pursuing when I am still working on
learning desktop programming.

> > - How you can develop your web app on your own computer and when you
> >   need to test it actually on the web.
> Thats usually just a case of running a web server on your PC.

And that's its own topic.  "Running a web server on your PC" rings zero
bells for beginners.  

> Wikipedia is your friend and the partial topic that I did on web
> programming did include some of the basic stuff with lots of
> links to Wikipedia articles.

I don't think Wikipedia is the beginner's friend on this sort of thing.
I have not found it good for learning how to program.  Just looking
at the topic "web development" shows this; it is an overview of the
field, but there is no instructional/tutorial material.  It doesn't teach
how to do it.

> HTH,

It is helpful, and like anything one can probably work his or her way through
the topic slowly and stumblingly, but I do think that a thorough starting-with-
zero-knowledge-and-defining-all-terms tutorial would be a wonderful thing to 
have.  As you said before, web programming is a lot more involved than 
desktop programming.  I think it would be really a fun challenge to put
together a great soup-to-nuts tutorial on this (but I am far from the one
to do it!), since it incorporates so many elements.  I wish you luck on
the Py3 tutorial and and web app tutorial work when you have the chance.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100803/c0deb012/attachment.html>

More information about the Tutor mailing list