简体   繁体   English

防止ipython笔记本中的单元格编辑

[英]prevent cell edits in ipython notebook

I would like to run a public ipython notebook server to serve up a notebook which has non-editable code cells which can be run by the user. 我想运行一个公共ipython笔记本服务器来提供一个笔记本,它具有可由用户运行的不可编辑的代码单元。

Why, you ask? 你为什么问? Because I don't want arbitrary python run on my server, but I do want users to be able to interface with the python scripts via raw_input(). 因为我不希望在我的服务器上运行任意python,但我确实希望用户能够通过raw_input()与python脚本进行交互。 (this means I can't use a static html nbview or reveal.js slideshow). (这意味着我不能使用静态html nbview或reveal.js幻灯片)。

Thoughts? 思考?

As far as I know only IPython 1.0 supports raw_input() . 据我所知,只有IPython 1.0支持raw_input()。 and its very obvious because Ipython is like interactive command shell , you give commands and it replies. 而且非常明显因为Ipython就像交互式命令shell,你给出命令并回复它。 and for greater flexibility in Ipython notebook it can be divided even into totally irrelevant cells which can run separately.So it cant respond according to inputs its just command-reply mechanism . 并且为了在Ipython笔记本中获得更大的灵活性,它甚至可以分成完全不相关的单元,这些单元可以单独运行。因此它无法根据输入响应它只是命令 - 应答机制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM