Note that there are some explanatory texts on larger screens.

plurals
  1. POLog IPython output?
    primarykey
    data
    text
    <p>Is there any way to make IPython's logging capability include output as well as input? </p> <p>This is what a log file looks like currently:</p> <pre><code>#!/usr/bin/env python # 2012-08-06.py # IPython automatic logging file # 12:02 # ================================= print "test" </code></pre> <p>I'd like to have one more line show up:</p> <pre><code>#!/usr/bin/env python # 2012-08-06.py # IPython automatic logging file # 12:02 # ================================= print "test" # test </code></pre> <p>(the <code>#</code> is because I assume that is needed to prevent breaking IPython's <code>logplay</code> feature)</p> <p>I suppose this is possible using IPython notebooks, but on at least one machine I need this for, I'm limited to ipython 0.10.2.</p> <p>EDIT: I'd like to know how to set this up automatically, i.e. within the configuration file. Right now my config looks like </p> <pre><code>from time import strftime import os logfilename = strftime('ipython_log_%Y-%m-%d')+".py" logfilepath = "%s/%s" % (os.getcwd(),logfilename) file_handle = open(logfilepath,'a') file_handle.write('########################################################\n') out_str = '# Started Logging At: '+ strftime('%Y-%m-%d %H:%M:%S\n') file_handle.write(out_str) file_handle.write('########################################################\n') file_handle.close() c.TerminalInteractiveShell.logappend = logfilepath c.TerminalInteractiveShell.logstart = True </code></pre> <p>but specifying <code>c.TerminalInteractiveShell.log_output = True</code> seems to have no affect</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload