how to modify text in html form from python

Paul McNett p at ulmcnett.com
Fri Oct 21 15:30:47 EDT 2005


Philippe C. Martin wrote:
> PS: If my question is not clear, I am trying to "share" the form between the
> client and server.
> 
> just as many sites out there allow you to modify existing data:
> 1) the server pops up a form with your data in it.
> 2) the client can modify it and submit.
> 
> I know this is a _basic_ question, sorry.

When debugging Python cgi scripts, it is helpful to run the scripts from a
command line just to make sure there aren't any compiler errors. Depending on
how the server is set up, you'll get a server error or just a blank page if your
script won't compile. When I run your script directly as I suggest, here's what
I get:

pmcnett at sol:~$ python test.py
   File "test.py", line 23
     <html>
     ^
SyntaxError: invalid syntax

D'oh! You needed to surround the html with quotes to make it a string, as in:

print """
<html>
...
</html>
"""

I don't really understand your original problem, but perhaps this will help get
you rolling again.


-- 
Paul McNett
http://paulmcnett.com
http://dabodev.com





More information about the Python-list mailing list