Trusting Notebooks To prevent untrusted code from executing on users’
behalf when notebooks open, we store a signature of each trusted
notebook. The notebook server verifies this signature when a notebook
is opened. If no matching signature is found, Javascript and HTML
output will not be displayed until they are regenerated by
re-executing the cells.
Any notebook that you have fully executed yourself will be considered
trusted, and its HTML and Javascript output will be displayed on load.
If you need to see HTML or Javascript output without re-executing, and
you are sure the notebook is not malicious, you can tell Jupyter to
trust it at the command-line with:
$ jupyter trust mynotebook.ipynb
See Security in notebook documents for more details about the trust mechanism.
1) Select all cells (or cells that you need) in your read-only notebook. You can select all cells by clicking on the first cell and then shift+clicking the last cell.
2) Copy all cells using CTRL+C (COMMAND+C if you are using MAC)
3) Create a new jupyter notebook page
4) CLICK IN THE MARGIN OF THE NEW CELL (***to close it for editing***), then...
5) Click CTRL+V (COMMAND+V if you are using MAC)
6) Save your new notebook
围绕这个问题的一个技巧是:
希望这个黑客能帮上忙
这里有一个更专业的答案,它提供了一个服务器端解决方案,可以从命令行使用,也可以编程使用。
https://jupyter-notebook.readthedocs.io/en/latest/notebook.html#introduction
我同意上面的第一个答案,但您必须再包含一个步骤(下面的步骤4),以便所有复制的单元格都不会粘贴到单个单元格中。
默认情况下,Jupyter会将光标插入第一个单元格,第一个单元格将打开光标进行编辑。
若要避免将所有内容粘贴到打开进行编辑的单元格中,必须关闭该单元格进行编辑。
相关问题 更多 >
编程相关推荐