Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

A way to freeze code cells in the notebook #2750

Closed
janschulz opened this Issue Jan 5, 2013 · 6 comments

Comments

Projects
None yet
3 participants
Contributor

janschulz commented Jan 5, 2013

It would be nice if you could just add a %%off to a cell and it would not be run when you execute that cell (even via shift+enter).

This would be helpfull for debugging output that you want to keep in the notebook but don't want to run in the normal case.

Owner

Carreau commented Jan 5, 2013

This wouldn't work as the cell would be cleaned even before %%off beeing analysed.
Also there is a strong decoupling frontend/kernel a magic is on kernel side which has no knowledge of frontend.

You should be able to copy past trackback in MD cell between triple back-ticks and still have the syntactic coloration.

You should also be able to use %%capture to rerun the cell and capture the sterr/stdout in variables.

Owner

takluyver commented Jan 5, 2013

The basic idea makes sense, but it's really a frontend issue - you want a way to freeze a code cell. I've retitled the issue to reflect that.

Contributor

janschulz commented Jan 6, 2013

Actually I don't want to freeze a cell: i just want a fast way to disable a cell which only contains "debugging" code. I wouldn't even mind if the cell output is cleared. Funnily, %%off works, kind of: it simple returns an error instead of running the cell, which is almost what I want :-)

Owner

Carreau commented Jan 6, 2013

Toggle between 'code' and 'raw' cell ? (C-m, r)

or If False : indent the rest ?

Owner

takluyver commented Jan 6, 2013

Or does Codemirror have a 'comment this out' shortcut?

If not, it's very easy to add your own 'do nothing' cell magic.

@janschulz janschulz referenced this issue in minrk/ipython_extensions Aug 2, 2013

Merged

Inactive magic and doc updates to writeandexecute magic #13

Contributor

janschulz commented Aug 4, 2013

My case is satisfied with teh extension in minrks repository. So closing.

@janschulz janschulz closed this Aug 4, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment