[Tutor] Help with vars()
Charlie Clark
Charlie Clark <charlie@begeistert.org>
Fri, 10 Aug 2001 10:37:29 +0200
I'd like to use vars() in together with a database command (Marc André
Lemburg's mxODBC) but seem to have missed something.
articles = {'sternzeichen': 'Wassermann', 'text': 'Es wird besser',
'headline': 'Horoskop f\xc3\xbcr Peter'}
when I use
insert = "%headline, %text, %sternzeichen" %vars(articles)
I get a TypeError:
TypeError: vars() argument must have __dict__ attribute
but articles is a dictionary... what screamingly obvious thing am I missing?
Charlie