1
Is there a function that returns the name of the variables defined in a Python instance? Something similar to the command who
in Matlab that returns the names of the user-defined variables.
1
Is there a function that returns the name of the variables defined in a Python instance? Something similar to the command who
in Matlab that returns the names of the user-defined variables.
3
3
According to the Stack in English would be as follows:
dir()
returns a list of variables in the scopeglobals()
returns a dictionary of global variableslocals()
returns a dictionary of local variablesBrowser other questions tagged python variables
You are not signed in. Login or sign up in order to post.
These functions serve, but it is not the way I would like because they also return everything that is set automatically and also by the imports of modules. I made a script to filter by variable type.
– Myke
In the link in English has several different examples that may help.
– Karl Zillner