mardi 30 décembre 2014

Is it possible to view/change/test against the variables in a python script that's being run from another script?

I have the following code as part of a 'whole application' test framework (as opposed to, say, Unit testing):



with open("test.py") as f:
#Open, read, compile, execute the code
code = compile(f.read(), "test.py", 'exec')
exec(code)


Is there any way for me, the programmer in the file calling that code, to access the variables within that code?


Aucun commentaire:

Enregistrer un commentaire