[IPython-user] Log options at ipython startup
Gökhan Sever
gokhansever@gmail....
Wed Jan 13 15:49:25 CST 2010
On Wed, Jan 13, 2010 at 1:42 PM, Fernando Perez <fperez.net@gmail.com>wrote:
> On Tue, Jan 12, 2010 at 2:37 PM, Gökhan Sever <gokhansever@gmail.com>
> wrote:
> > Here is what I have in my ipy_user_conf.py file:
> >
> >
> > def main():
> >
> > try:
> > ldir = '/home/user/.ipython/'
> > filename = os.path.join(ldir, strftime('%Y-%m-%d')+".py")
> > notnew = os.path.exists(filename)
> > ip.IP.logger.logstart(logfname=filename, logmode='append')
> > if notnew:
> > ip.IP.logger.log_write("# =================================")
> > else:
> > ip.IP.logger.log_write("""#!/usr/bin/env python \n# %s.py \n#
> > IPython automatic logging file""" % strftime('%Y-%m-%d'))
> > ip.IP.logger.log_write("""# %s \n#
> > =================================""" % strftime('%H:%M'))
> > print " Logging to "+filename
> >
> > except RuntimeError:
> > print " Already logging to "+ip.IP.logger.logfname
> >
> >
> > I learnt this trick from Pierre Raybaut of PythonXY. There is a log file
> per
> > day and time-stamping per session. I am sure it could easily modified to
> log
> > everything in a file and with a time stamp if this is what you need.
>
> Contribution to the cookbook?
>
> http://ipython.scipy.org/moin/Cookbook
>
> Thanks :)
>
> f
>
I have 3 scipy originates username's but none lets me edit the cookbook :)
Could you grant me a write access? (GokhanSever)
--
Gökhan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20100113/20aaa8af/attachment.html
More information about the IPython-user
mailing list