how to append cgi FieldStorage Class instance
fuzzyman at gmail.com
Fri Jul 29 10:12:06 CEST 2005
praba kar wrote:
> Dear All,
> I have doubt in python cgi script. I describe
> that doubt with below code
> import cgi
> form = cgi.FieldStorage()
> passwd = form['passwd'].value
> print passwd
> But Now I want to assign some value to form['passwd']
> field value
> form['passwd'] = 'surese'
> Now If I try to print
> print form['passwd'].value. It will raise error.
> So kinldy let me how to edit or append instance
> of FieldStorage class
A form *isn't* a dictionary, this means that your code :
form['passwd'] = 'surese'
Turn the form into a dictionary and use that.
Why are you trying to assign values directly in the form ?
> Too much spam in your inbox? Yahoo! Mail gives you the best spam protection for FREE! http://in.mail.yahoo.com
More information about the Python-list