[EMAIL PROTECTED] írta: > 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. > The unicode object IS subscriptable. It is a unicode string which has characters. The value None is not subscriptable. It probably means that you have a NULL value in your database. Try the following:
def nulltoemptystr(value): if value is None: return "<EMPTY>" else: return value[:10] print template % (ID, IID, nulltoemptystr(Function), nulltoemptystr(Description),ErrorNumber, StatusCD) You can also try to do the same in SQL. For example, this works with FireBird, PostgreSQL and many others: select coalesce(Function,"") as Function from TableName instead of select Function from TableName But first of all, I would recommend you to go over the Python tutorial. It explains these things and more. http://docs.python.org/tut/tut.html Best, Laszlo -- http://mail.python.org/mailman/listinfo/python-list