Sorry, this is not possible at the moment with Spyder. This is the closest thing you can do to get the result you want:
import inspect
local_vars = {}
def main():
global local_vars
a = 2
b = 4
c = a+b
local_vars = inspect.currentframe().f_locals
return c
main()
After running it you should see that the local_vars
dictionary contains the local variables defined inside the main
function.
Note: After giving double-click to local_vars
contents, Spyder will open a new window which is basically equivalent to the view shown in our variable explorer but only with your local variables.