I'm new to Python and have the Python Reference Manual Release 2.5.2 as my only guide so far, but here's my problem:
I've got a custom class 'Foo' with two functions - 'hello' and 'goodbye' that just print a string.
I'm assigning the output of the dir() function to a variable and want to then perform a dir() on each index value of the first variable and Python doesn't like it. Here's what I've got:
a = dir()
print dir(a[0])
When I execute this the output is the generic classes and does not include the functions of my custom Foo class at all. Now when I forget about assigning the output of the dir() to an array and just hard code dir(Foo) it works fine, returning my two functions. I've noticed that the problem is related to the compiler reading it as a string or a 'literal' I guess it's called, because the output of these two commands is completely different:
dir(Foo)
and
dir('Foo')
The first output without the quotes being the one I'm trying to get by an array variable of the entire generic dir() function alone.
I've printed out the array for testing purposes and sure enough, index 0 is Foo so it should in theory work.
Is there some kind of pickle method or function I need to perform to make dir(a[0]) work???
Thanks!
Navic