访问IPython的个人资料历史记录(history.sqlite) [英] Access IPython's profile history (history.sqlite)

查看:144
本文介绍了访问IPython的个人资料历史记录(history.sqlite)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我重新启动IPython时,我可以通过按向上和向下键来访问上次会话的输入。我发现特定于配置文件的历史记录保存在〜/ .config / ipython / profile_profilename / history.sqlite 中。

When I restart IPython, I can access the input from my last session by pressing the up- and down-keys. I found that the history specific to a profile is saved in ~/.config/ipython/profile_profilename/history.sqlite.

有没有办法以与%history命令相同的简单方式访问此历史记录?

Is there a way to access this history in the same easy fashion as the %history command?

IPython参考在此描述了该功能: http://ipython.org/ipython-doc/dev/interactive/reference。 html #readline-based-features

这家伙有同样的问题,但他们找不到直接解决方案: http://python.6.n6.nabble.com/Logging-in-new-IPython-td1665151.html

The IPython reference describes the feature here: http://ipython.org/ipython-doc/dev/interactive/reference.html#readline-based-features
This guy has the same question, but they don't find a 'direct' solution: http://python.6.n6.nabble.com/Logging-in-new-IPython-td1665151.html

推荐答案

我假设您的意思是从外部IPython访问历史记录的工具,可能来自命令行?

I'm assuming you mean a tool to access your history from the outside IPython, perhaps from the command line?

执行此操作的API已经存在 - 请参阅类 IPython.c ore.history.HistoryAccessor 源代码)。有示例脚本(更新链接)展示如何使用它从数据库转储会话。但是我们还没有就此做出申请。如果您对此感兴趣,可以参与其中 - 请参阅我们的供参与者启动的潜在项目列表

The API to do it is already there - see the class IPython.core.history.HistoryAccessor (source code). There's an example script (updated link) showing how you can use it to dump a session from the database. But we haven't yet made an application around that. If you're interested in it, you could work on that - see our list of potential projects for contributors to start.

这篇关于访问IPython的个人资料历史记录(history.sqlite)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆