A couple of Python CGI questions
sean
sean_berry at cox.net
Tue Mar 30 01:23:27 EST 2004
I think I found the answer to my third question. I found an example using
something like the following.
form = cgi.FieldStorage()
" userid" = form['userid'].value
but should it be "userid" =?
I would think it should be userid =.
Thanks.
"sean" <sean_berry at cox.net> wrote in message
news:9g8ac.65379$Bg.14309 at fed1read03...
> I tried getting mod_python to work but have had lots of problems getting
it
> running. So, I have settled on using python cgi.
>
> I have already got it going and it seems to run fast enough for me.
>
> My questions are:
> 1. Is there any way to access variables from within a string like perl
cgi?
> I have found that the best way for me to write html tables is to use a
print
> """<blah blah blah>""" string. That way I can write one print """, and
then
> write html as if I were writing an html file. For example:
> print """
> <table border="0" cellspacing="0">
> <tr>
> <td>This is cool</td>
> </tr>
> </table>
> """
> I really like this and it is a lot like typing the following in Perl cgi:
> print <<EOF
> <table border="0" cellspacing="0">
> <tr>
> <td>This is cool</td>
> </tr>
> </table>
> EOF
>
> So, is there any way to access variables from within the string, besides
> using %s? In perl, I just put the $variable in the string and it replaces
> the varname with the value.
>
> 2. Is there a good online resourse for pyton cgi?
> 3. How do you collect request variables from forms sent to the python cgi
> page, whether post or get?
>
>
> Thanks very much for the help... I will continue to google for my answers.
>
> Sean
>
>
>
More information about the Python-list
mailing list