Re: Anyone has a nice view_var procedure ?

2007-01-18 Thread Stef Mientki
thanks Gabriel str(key)[7:-2] = key.__name__ I didn't know that one Nice to see you built a useful tool! It's a great way to learn a language. Yes, and this group is helping me a whole lot, thanks ! cheers, Stef Mientki -- http://mail.python.org/mailman/listinfo/python-list

Re: Anyone has a nice view_var procedure ?

2007-01-18 Thread Gabriel Genellina
At Thursday 18/1/2007 19:24, Stef Mientki wrote: str(key)[7:-2] = key.__name__ I didn't know that one It's here: http://docs.python.org/lib/specialattrs.html -- Gabriel Genellina Softlab SRL __

Re: Anyone has a nice view_var procedure ?

2007-01-17 Thread Gabriel Genellina
At Tuesday 16/1/2007 20:13, Stef Mientki wrote: Ok, here's my current solution, probably not very Pythonian, (so suggestions are welcome) but it works. It appears that you're a number crunching guy - you absolutely ignore all types except numeric ones! :) (Too bad I can get the name of

Re: Anyone has a nice view_var procedure ?

2007-01-17 Thread Stef Mientki
hi Gabriel, It appears that you're a number crunching guy - you absolutely ignore all types except numeric ones! :) Is there anything else than numbers ? ;-) But indeed I forgot the else statement, which should look like this: else: line = 'UNKNOWN: ' + type(V) print line

Re: Anyone has a nice view_var procedure ?

2007-01-17 Thread Gabriel Genellina
At Wednesday 17/1/2007 19:46, Stef Mientki wrote: for key,value in count: line += ' %s=%d' % (key, value) I didn't succeed to use value as a enumerator, and I had to typecast key into a string (and skipping some redundant information, but then it works great, thanks !! Ouch,

Re: Anyone has a nice view_var procedure ?

2007-01-16 Thread Neil Cerutti
On 2007-01-15, Gabriel Genellina [EMAIL PROTECTED] wrote: At Monday 15/1/2007 17:45, Stef Mientki wrote: Is there some handy/ nice manner to view the properties of some variable ? As a newbie, I often want to see want all the properties of a var, and also some corner values (large arrays) etc.

Re: Anyone has a nice view_var procedure ?

2007-01-16 Thread Duncan Booth
Neil Cerutti [EMAIL PROTECTED] wrote: dir( [object]) [...] The list is not necessarily complete. If the object is a module object, the list contains the names of the module's attributes. If the object is a type or class object, the list contains the names of its attributes,

Re: Anyone has a nice view_var procedure ?

2007-01-16 Thread Stef Mientki
Adam wrote: Stef Mientki wrote: hello, Is there some handy/ nice manner to view the properties of some variable ? As a newbie, I often want to see want all the properties of a var, and also some corner values (large arrays) etc. Probably it's not so difficult, but I don't see how to

Anyone has a nice view_var procedure ?

2007-01-15 Thread Stef Mientki
hello, Is there some handy/ nice manner to view the properties of some variable ? As a newbie, I often want to see want all the properties of a var, and also some corner values (large arrays) etc. Probably it's not so difficult, but I don't see how to distinguish for example between a string and

Re: Anyone has a nice view_var procedure ?

2007-01-15 Thread Gabriel Genellina
At Monday 15/1/2007 17:45, Stef Mientki wrote: Is there some handy/ nice manner to view the properties of some variable ? As a newbie, I often want to see want all the properties of a var, and also some corner values (large arrays) etc. You can try dir(x), vars(x). If you want a nice print,

Re: Anyone has a nice view_var procedure ?

2007-01-15 Thread Adam
Stef Mientki wrote: hello, Is there some handy/ nice manner to view the properties of some variable ? As a newbie, I often want to see want all the properties of a var, and also some corner values (large arrays) etc. Probably it's not so difficult, but I don't see how to distinguish for

Re: Anyone has a nice view_var procedure ?

2007-01-15 Thread Larry Bates
Stef Mientki wrote: hello, Is there some handy/ nice manner to view the properties of some variable ? As a newbie, I often want to see want all the properties of a var, and also some corner values (large arrays) etc. Probably it's not so difficult, but I don't see how to distinguish for