[Tutor] CGI Programming in Python

dman dman@dman.ddts.net
Fri, 24 May 2002 00:19:31 -0500


--Nq2Wo0NMKNjxTN9z
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, May 23, 2002 at 01:50:19PM -0700, Britt Green wrote:
| Hello all,
|=20
| I've been trying to find some good sites for CGI programming in Python.
| But so far I'm not having much luck. I'm hoping the members of this
| mailing list can send a few sites my way; sites that are CGI
| newbie-friendly! :)

google for CGI.  It's pretty much the same in any language.  It works
like this :
    o   an HTTP request arrives at the web server

    o   it forks and execs your script

    o   when your script is invoked, certain environment variables are
        set (any of the CGI pages found through google will explain them)

    o   you want to import the 'cgi' (or 'cgilib', whatever it's
        called) module in your script.  It will parse the request and
        provide you with an object to extract all the form values
        from.

    o   the rest is just python programming and printing valid HTML on
        stdout

3 and 4 are the only interesting steps for you, and the cgilib module
takes care of the details.  The library reference tells you the
interface to it.

Once you understand how CGI works, take a look at zope to build a
non-trivial web application.

HTH,
-D

--=20

Come to me, all you who are weary and burdened, and I will give you
rest.  Take my yoke upon you and learn from me, for I am gentle and
humble in heart, and you will find rest for your souls.  For my yoke
is easy and my burden is light.
        Matthew 11:28-30
=20
GnuPG key : http://dman.ddts.net/~dman/public_key.gpg


--Nq2Wo0NMKNjxTN9z
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAjztzWIACgkQO8l8XBKTpRQr5QCfeFDuN8fiIM9iC00JvFDDhJqC
LsYAoMNqPBz6lt2bLHSyHvtbXXrYs6qH
=55Pj
-----END PGP SIGNATURE-----

--Nq2Wo0NMKNjxTN9z--