Issue
I get a huge error output in IPython when I import a certain module. I cannot scroll up to the top of this error so I want to re-direct the output to a file. How can I do this?
Thanks!
EDIT: I also tried the following, but it didn't work
In [1]: logstart -o
Activating auto-logging. Current session state plus future input saved.
Filename : ipython_log.py
Mode : rotate
Output logging : True
Raw input log : False
Timestamping : False
State : active
In [2]: import theano
... the error...
In [3]: logstop
I exit IPython and check ipython_log.py and it looks like this
# IPython log file
import theano
Solution
I believe @stark, in his comment above, was recommending that you run the script from the command line by typing something like
./scriptname.py 2>error.log
which runs the script called scriptname.py
(you can replace with your actual script's name) and redirects error messages to a file called error.log
.
If you are not comfortable working from the command line, I think you can do the same by running
!./scriptname.py 2>error.log
from IPython.
Answered By - Nicholas Flees
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.