I want to know how to make variables from functions in imported modules available in the IPython interactive namespace.
I have an example code that I want to run from another script, so I set it 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 to make the variable 'a' available in the interactive namespace? The only way to do this is to make "a" global and run run_test.py directly, rather than importing it and calling the function.
Any pointers appreciated.
source share