I encountered a problem with the scope variables have when IPython is invoked at the end of a python script.
All functions I call in the script itself can modify variables, which will subsequently be used by other functions.
If I call the same functions in ipython, the scripted ones can access the changed variables but variables which existed when ipython was called don’t change.
Thus my question: How do I propagate the global variables into ipython?
(I could do something like A=globals()[‘A’] of course but thats ugly)
I encountered a problem with the scope variables have when IPython is invoked at
Share
You could create a class with a static method (decorator:
@staticmethod) that returns a singleton instance of that class. That object can contain any number of members that function as globals.Prints: