Call me a pedant, but what'd wrong with:
print 'closed: ' + filename or print 'closed:', filename
?
I always figure that debug-oriented output like that in example code is very likely to be changed in format, or to include more information, by the person actually using it. So string substitution makes it more flexible; less work for them.
-- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list