list active variables

Aahz aahz at
Fri May 1 01:27:23 CEST 2009

In article <pan.2009. at>,
Steven D'Aprano  <steven at> wrote:
>On Wed, 29 Apr 2009 12:25:46 -0700, Iamanalien wrote:
>> how can i list all the variables that i am using?
>You can't.
>What you can do though is list all the available names that Python knows 
>about, whether you are using them or not, by using the dir() or vars() 

You can also get a complete list of Python container objects with
gc.get_objects(); however, that does not show you strings and ints that
aren't in container objects.  Still, that gets you most of it.
Aahz (aahz at           <*>

"If you think it's expensive to hire a professional to do the job, wait
until you hire an amateur."  --Red Adair

More information about the Python-list mailing list