Re: Listing variables

2009-10-25 Thread vsoler
On Oct 25, 5:07 pm, Tim Chase wrote: > >> t...@rubbish:~/tmp$ rm test.py test.pyc > >> t...@rubbish:~/tmp$ python2.5 > >>  >>> import test > >>  >>> dir(test) > >> ['__builtins__', '__doc__', '__file__', '__name__', '__path__'] > >>  >>> test.__file__ > >> '/usr/lib/python2.5/test/__init__.pyc' >

Re: Listing variables

2009-10-25 Thread Tim Chase
t...@rubbish:~/tmp$ rm test.py test.pyc t...@rubbish:~/tmp$ python2.5 >>> import test >>> dir(test) ['__builtins__', '__doc__', '__file__', '__name__', '__path__'] >>> test.__file__ '/usr/lib/python2.5/test/__init__.pyc' because there's apparently a module named "test" in the standard distribu

Re: Listing variables

2009-10-25 Thread vsoler
On Oct 25, 1:32 pm, Tim Chase wrote: > > If I just input dir(test) I don't get "a" in my list. > > import test > dir(test) > > ['__builtins__', '__doc__', '__file__', '__name__', '__package__', > > '__path__'] > > > I am using python 2.6 > > > Am I doing anything wrong? > > Are you impor

Re: Listing variables

2009-10-25 Thread Tim Chase
If I just input dir(test) I don't get "a" in my list. import test dir(test) ['__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__'] I am using python 2.6 Am I doing anything wrong? Are you importing the module you think you are? t...@rubbish:~/tmp$ echo "a=42" > tes

Re: Listing variables

2009-10-25 Thread vsoler
On Oct 25, 12:01 pm, Tim Chase wrote: > > Say that a have: > > > # file test.py > > a=7 > > > At the prompt: > > import test > > dir() > > > I would like to see the variables created in the test namespace. > > However, variable "a" does not appear in the list, only "test". Since > > I know that va

Re: Listing variables

2009-10-25 Thread Dave Angel
vsoler wrote: Say that a have: # file test.py a=7 At the prompt: import test dir() I would like to see the variables created in the test namespace. However, variable "a" does not appear in the list, only "test". Since I know that var "a" is reachable from the prompt by means of test.a, how ca

Re: Listing variables

2009-10-25 Thread Ben Finney
vsoler writes: > At the prompt: > import test > dir() > > I would like to see the variables created in the test namespace. > However, variable "a" does not appear in the list, only "test". Since > I know that var "a" is reachable from the prompt by means of test.a, > how can I list this sort of v

Re: Listing variables

2009-10-25 Thread Tim Chase
Say that a have: # file test.py a=7 At the prompt: import test dir() I would like to see the variables created in the test namespace. However, variable "a" does not appear in the list, only "test". Since I know that var "a" is reachable from the prompt by means of test.a, how can I list this s