Ich habe die folgende Konfiguration für Abkürzungen, die in der Zelle von Jupiter Notebook nach dem Laufen einfach funktioniert es:Wie können Tastaturbefehle dauerhaft zum Jupyter (ipython) Notebook hinzugefügt werden?
%%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;
}
});
Wie kann ich ein Setup Jupiter Notebook diese Initialisierung automatisch beim Start zu machen?
Ich habe versucht, den gleichen Code (ohne %%javascript
) C:\Users\<username>\.ipython\profile_default\static\custom\custom.js
hinzuzufügen, aber es hat nicht funktioniert.
Ich habe nur ein Profil, erstellt mit ipython profile create
, Python 3.3, Windows 7.
Vielen Dank im Voraus.
beachten Sie, dass für jupyter 'custom.js' bei' ~/.jupyter/custom/custom.js' –