Gibt es eine Möglichkeit, die Protokollierungsfunktion von IPython mit Ausgabe und Eingabe zu versehen?IPython-Ausgabe protokollieren?
Dies ist, was eine Protokolldatei wie zur Zeit aussieht:
#!/usr/bin/env python
# 2012-08-06.py
# IPython automatic logging file
# 12:02
# =================================
print "test"
würde ich eine mehr anzeigen Linie haben wollen up:
#!/usr/bin/env python
# 2012-08-06.py
# IPython automatic logging file
# 12:02
# =================================
print "test"
# test
(die #
ist, weil ich davon aus, dass benötigt wird, zu verhindern, dass IPython logplay
Funktion zu brechen)
Ich nehme an, das ist möglich mit IPython-Notebooks, aber auf mindestens einer Maschine, ich brauche das für, ich bin Limit ed zu ipython 0.10.2.
EDIT: Ich würde gerne wissen, wie dies automatisch einzurichten, d. H. In der Konfigurationsdatei. Gerade jetzt meine Config sieht aus wie
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
aber c.TerminalInteractiveShell.log_output = True
scheint spezifiziert zu haben keinen Einfluss
Die Lösung scheint dies in einem Startskript zu tun, wie hier beschrieben: http://wiki.ipython.org/Cookbook/DatedLog (das war die Lösung in http://stackoverflow.com/questions/11836612/wo-wie-in-was-kontext-ist-ipythons-konfigurationsdatei ausgeführt? lq = 1) – keflavich