开发者

How to configure ipy_user_conf.py to get IPython to start logging right away?

开发者 https://www.devze.com 2023-01-17 16:41 出处:网络
64-bit Vista, Python 2.6, IPython 0.10 I want to try logging everything I do, so I set o.log = 1 in my ipy_user_conf.py .

64-bit Vista, Python 2.6, IPython 0.10

I want to try logging everything I do, so I set

o.log = 1

in my ipy_user_conf.py .

But logging doesn't start. It will if I enter "logstart" at th开发者_如何学编程e prompt. But what's the problem with 'o.log = 1'?


Where does your ipy_user_conf.py reside? If you are editing the Python26\Lib\site-packages\IPython\UserConfig file, chances are it doesn't even get loaded in the first place.

The right file is in %USERPROFILE%\_ipython, editing that should do the trick.

Also, I'd suggest using

o.autoexec.append('%logstart <option>')

that way, you can configure logging using the regular magic command.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号