TypeError: unsubscriptable object
k.retheesh at gmail.com
k.retheesh at gmail.com
Fri Jun 9 14:52:30 EDT 2006
I did the same,
The function type is < NoneType> and the description type is <Unicode>
so how can i print a part of this 2 output.
These values are returned by database.
Thanks
Retheesh
Laszlo Nagy wrote:
> k.retheesh at gmail.com írta:
> > So wat should I do ??
> >
> You should do this:
>
> print type(Function),type(Description)
> raise SystemExit
>
> Instead of this:
>
> print template % (ID, IID, Function[:10], Description[:10],ErrorNumber, StatusCD)
>
> Then probably you will see:
>
> <type 'int'> <type 'int'>
>
> instead of
>
> <type 'str'> <type 'str'>
>
>
> or something similar. (Of course in your case, it can be 'float instead of list' or 'dictionary instead of tuple' etc.)
>
> Then you should debug your program and find out why the 'Function' and 'Description' objects are not string but int.
>
>
> Laszlo
More information about the Python-list
mailing list