[Tutor] CGI/Python

Kalle Svensson kalle@gnupung.net
Mon, 29 Jan 2001 13:08:42 +0100


--k+w/mQv8wyuph6w0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Sez Jason Drake:
> if not form_ok:
>     print "<H1>Error</H1>"
>     print "Please fill in the name and addr fields."
>     return
------^^^^^^
This line is the problem.  As this code is outside of any function, you
can't return from it.  Either put the code in a function:

def main():
    # All the code

main()

Or use sys.exit().  Sorry for the brief explanation, but I've got a lot to
do.  Hope it helps anyway.

Peace,
  Kalle
--=20
Email: kalle@gnupung.net     | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
PGP fingerprint: 0C56 B171 8159 327F 1824 F5DE 74D7 80D7 BF3B B1DD

--k+w/mQv8wyuph6w0
Content-Type: application/pgp-signature
Content-Disposition: inline

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

iD8DBQE6dV1KdNeA1787sd0RAu6BAJ4ttEp7wzJn31Vjb43pVvpXcUsWRQCcDrGU
dYnyW4X6qTxVb5bhrc7hBHA=
=Kzb5
-----END PGP SIGNATURE-----

--k+w/mQv8wyuph6w0--