mardi 14 avril 2020

Access a file's variable in python

I want to be able to see what a function sees in another python file. I want that file to give me its scope and then I wanna do stuff with it.

but locals() doesn't include globals or nonlocals, and globals() doesn't include builtins, and neither support attribute access, as they're dicts.

I need to be able to do things like:

scope.ValueError
scope.re.error

and so on.





Aucun commentaire:

Enregistrer un commentaire