Consider this snippet:
globalVar = 25 def myfunc(paramVar): localVar = 30 print \"Vars: {globalVar}, {paramVar}, {localVar}!\".format(**VARS_IN_SCOP
You could make your own:
allvars = dict() allvars.update(globals()) allvars.update(locals())
or combine the first two lines:
allvars = dict(globals()) allvars.update(locals())