Re: [Tutor] Help with vars()
by Charlie Clark other posts by this author
Aug 10 2001 10:18AM messages near this date
Re: [Tutor] Help with vars()
|
Re: [Tutor] Help with vars()
> Ehe....I didn't know about the %(foo)[s|d|whatever] format string, all this
> time I was doing things like (for the example above):
>
> insert = "%s, %s, %s" % (articles['headline'], articles['text'],
> articles['sternzeichen'])
>
> Now, I'm curious, is this a *BAD THING* to do ???
http://starship.python.net/quick-ref1_52.html and search for vars() as it's
not in the standard documentation
I don't think what you do is bad as I had to do it like that myself but it is
a bit clumsy particularly when you have a lot of keys.
Charlie
_______________________________________________
Tutor maillist - Tutor@[...].org
http://mail.python.org/mailman/listinfo/tutor
Thread:
Charlie Clark
Danny Yoo
Steven Burr
Charlie Clark
Steven Burr
Charlie Clark
lonetwin
Charlie Clark
Steven Burr
|