【发布时间】:2015-08-17 09:14:33
【问题描述】:
我有以下快捷方式配置,在 Jupiter notebook 的单元格中运行后可以使用:
%%javascript
IPython.keyboard_manager.command_shortcuts.add_shortcut('ctrl-q', {
help: 'Clear all output', // This text will show up on the help page (CTRL-M h or ESC h)
handler: function (event) { // Function that gets invoked
if (IPython.notebook.mode == 'command') {
IPython.notebook.clear_all_output();
return false;
}
return true;
}
});
如何设置 Jupiter notebook 在启动时自动进行初始化?
我尝试将相同的代码(不带%%javascript)添加到C:\Users\<username>\.ipython\profile_default\static\custom\custom.js,但没有成功。
我只有一个配置文件,使用ipython profile create、Python 3.3、Windows 7 创建。
提前致谢。
【问题讨论】:
-
请注意,对于 jupyter,
custom.js位于~/.jupyter/custom/custom.js
标签: ipython ipython-notebook startup jupyter-notebook jupyter