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