list active variables

S

Steven D'Aprano

Hi,

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()
functions.
 
A

Aahz

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()
functions.

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
474,291
Messages
2,571,493
Members
48,158
Latest member
MariQuinon

Latest Threads

Top