Re: printing variables

2006-10-06 Thread hanumizzle
On 10/6/06, Gerrit Holl <[EMAIL PROTECTED]> wrote: > >>> import fnmatch > >>> var1, var2, var3 = "foo", "bar", "baz" > >>> for k in fnmatch.filter(locals(), "var*"): > ... print locals()[k] > ... > foo > baz > bar > > This is evil. > It's unpythonic. It's so evil, Perl 4 would look upon it in sc

Re: printing variables

2006-10-06 Thread Gerrit Holl
On 2006-10-06 04:50:33 +0200, [EMAIL PROTECTED] wrote: > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... >

Re: printing variables

2006-10-05 Thread MonkeeSage
[EMAIL PROTECTED] wrote: > Thanks all for the answers. Yup, i think i will use dicts/tuples/lists > instead... Even though you should be using some kind of container, you can still do what you origianlly asked for with relative ease...you just have to use the evil eval function (gasp!): for i in

Re: printing variables

2006-10-05 Thread s99999999s2003
Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > say i have variables like these > > > > var1 = "blah" > > var2 = "blahblah" > > var3 = "blahblahblah" > > var4 = "" > > var5 = "...".. > > > > bcos all the variable names start with "var", is there a way to > > conveniently print

Re: printing variables

2006-10-05 Thread Dan Bishop
On Oct 5, 9:47 pm, [EMAIL PROTECTED] wrote: > hi > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... > eg prin

Re: printing variables

2006-10-05 Thread Gary Herron
[EMAIL PROTECTED] wrote: > hi > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... > eg print var* ?? > i don't

Re: printing variables

2006-10-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... do you often (or alwa

Re: printing variables

2006-10-05 Thread John Machin
[EMAIL PROTECTED] wrote: > hi > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... > eg print var* ?? > i don'

Re: printing variables

2006-10-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > say i have variables like these > > var1 = "blah" > var2 = "blahblah" > var3 = "blahblahblah" > var4 = "" > var5 = "...".. > > bcos all the variable names start with "var", is there a way to > conveniently print those variables out... do you often (or always) trea

printing variables

2006-10-05 Thread s99999999s2003
hi say i have variables like these var1 = "blah" var2 = "blahblah" var3 = "blahblahblah" var4 = "" var5 = "...".. bcos all the variable names start with "var", is there a way to conveniently print those variables out... eg print var* ?? i don't want to do : print var1, var2, var3, var4 .