Is that possible to check what variables or instance of any classes exist in the current python workspace/environment? can I use any functions to list them? Thanks in advance!
Asked
Active
Viewed 2,306 times
0
-
https://docs.python.org/2/library/functions.html#locals – larsks Jul 28 '16 at 14:40
-
1`dir()` will give you a list of all modules, variables classes, functions etc. `globals()` and `locals()` give a dictionary, enabling you to access their values. – alexpeits Jul 28 '16 at 14:42
1 Answers
4
My answer is at least 30 characters, and most definitely not 9, therefore I can submit this.
globals()

Tasos Papastylianou
- 21,371
- 2
- 28
- 57