I want to know how to make variables from functions in imported modules available in the IPython interactive namespace.
I have some example code which I want to run from another script so I set it up as run_test.py:
def run_test():
a = 5
if __name__ == "__main__":
run_test()
I import the module as follows and call the function:
import run_test
run_test.run_test()
How do I make variable 'a' available in the interactive namespace? The only way I can do it is to make 'a' a global and run run_test.py directly rather than importing it and calling the function.
Any pointers appreciated.