[Tutor] NEWBIE is it possible to use HTML and Python together?

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Thu, 21 Mar 2002 23:47:04 -0800 (PST)


On Thu, 21 Mar 2002, Kirby Urner wrote:

> >Please feel free to ask more questions; we'd like to hear about your
> >progress.  Good luck!
>
> Would it be accurate to suggest that any CGI-Python solution to the dice
> rolling program would involve reloading the page, and/or serving a new
> one?  To change the content of a web page *in place* (without reloading)
> would require some other solution, no? (e.g. JavaScript).


Yes, I was thinking of using form submission.  If we want to make the game
play in-place, it'll would probably involve some client-side Javascript.
But client-side stuff can be tricky and frustrating, especially because
it's traditionally so platform specific.  (I've heard some good things
about Flash though.)


For simple stuff, I think that Python with CGI on the server side can be
effective.  As an example, I cooked up a small cgi program that plays Rock
Paper Scissors, and I've placed the source code on ChalkBoard:

    http://www.decrem.com:8080/ChalkBoard/1016787291

(I'm still running into some wackiness with HTML quoting though... doh!
I have to look into this when I have time...hmm... maybe I should get
ChalkBoard to run CGI scripts.)


Hope this helps!