Reputation: 3
Is there a way to run a script in iPyton with the %run myscript.py
so that it will take into consideration the things I have already entered in the interactive iPython console?
Example:
In [1]: asdf = 18
In [2]:
Then if myscript.py was:
print asdf
And it was ran from iPython like this:
In [2]: %run myscript.py
18
In [3]:
Can this be done?
Upvotes: 0
Views: 311
Reputation: 672
Use %logstart/%logon and %logstop/%logoff. With these controls, you will have a python_log.py file that stores your history.
Upvotes: 0