[IPython-User] Logging and ipython_config.py

federico vaggi vaggi.federico@gmail....
Sat Sep 10 09:43:51 CDT 2011


Hi everyone,

first of all - thanks for all the huge improvements made in iPython
.11 - the qt console looks amazing and works perfectly.

I have a few questions about the automatic configuration and how to
set up logging automatically.

In my default folder, I have the following extra lines:

# Start logging to the given file in append mode.
filename = strftime('%Y-%m-%d')+".py"
filepath = os.path.join(c.TerminalIPythonApp.ipython_dir,'profile_default',filename)

file_handle = open(filepath,'a')
file_handle.write('########################################################\n')
out_str = '# Started Logging At: '+ strftime('%H-%M\n')
file_handle.write(out_str)
file_handle.write('########################################################\n')
file_handle.close()

c.TerminalInteractiveShell.logappend = filename

If I start iPython in a normal terminal window, I get this:

federicov@Fede-Laptop-Ubuntu:~/.ipython/profile_default$ ipython
Activating auto-logging. Current session state plus future input saved.
Filename       : 2011-09-10.py
Mode           : append
Output logging : False
Raw input log  : False
Timestamping   : False
State          : active
Enthought Python Distribution -- www.enthought.com

and logging works perfectly.

However, if I start iPython with this command:

ipython qtconsole --colors=linux --pylab=inline  --profile=default

I get:

Python 2.7.2 |EPD 7.1-2 (64-bit)| (default, Jul  3 2011, 15:17:51)
Type "copyright", "credits" or "license" for more information.

IPython 0.11 -- An enhanced Interactive Python.
?         -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help      -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.
%guiref   -> A brief reference about the graphical user interface.

and logging doesn't start at all.  Any particularly obvious
configuration I am missing?  Do the settings in the default file not
apply to ipython in a qt console?

Thanks a lot!

Federico


More information about the IPython-User mailing list