unsupported operand type(s) for %: 'NoneType' and 'tuple'

Xavier Ho contact at xavierho.com
Mon Dec 7 05:37:10 EST 2009


Hi Victor,

the .append function doesn't return anything, so it's a None. And you should
have it inside the parentheses.

>>> tree.append("%s%s" % ("\t" * level, name))

is probably what you're after.

Cheers,
Xav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091207/8457da2b/attachment-0001.html>


More information about the Python-list mailing list