如何配置 ipy_user_conf.py 让 IPython 立即开始记录?

发布于 2024-09-24 20:45:36 字数 185 浏览 0 评论 0原文

64位Vista, Python 2.6, IPython 0.10

我想尝试记录我所做的一切,所以我

设置o.log = 1

在 ipy_user_conf.py 中

。但日志记录没有开始。如果我在以下位置输入“logstart”就会这样 迅速的。但是“o.log = 1”有什么问题呢?

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 the
prompt. But what's the problem with 'o.log = 1'?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梅窗月明清似水 2024-10-01 20:45:36

您的 ipy_user_conf.py 驻留在哪里?如果您正在编辑 Python26\Lib\site-packages\IPython\UserConfig 文件,很可能它甚至没有被加载
首先。

正确的文件位于 %USERPROFILE%\_ipython 中,编辑该文件应该可以解决问题。

另外,我建议使用

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

这种方式,您可以使用常规 magic 命令配置日志记录。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文