Converting a set of data to string and then into a file

Thomas Guettler guettli at thomas-guettler.de
Thu Oct 7 10:04:35 EDT 2004


Am Thu, 07 Oct 2004 06:30:58 -0700 schrieb Shufen:

> Hi,
>  
> I have set up a upload form where user can add data into the form via
> a web browser and submit it. And these data entered by the user will
> be grabbed by:
> 
> xxxx = data.getvalue.('xxxx')     # data is the name of the form

> The error stated that I can't concatenate 'str'
> and 'NoneType'.

Hi,

You can do it like this:

foo=data.getvalue("....")
if foo==None:
    foo=""

Then you can concatenate the values.

 Thomas




More information about the Python-list mailing list