This is one way to choose the behavior of your cells
Create a custom class whose method eval does what you want with the input and instanciate it
class LazyCell(object): def eval(self, args, *kwds): return "ignored cell" lazy_cell = LazyCell()
You can now use it in any cell
%lazy_cell This cell will be ignored... and I can do whatever I want in it
And the output will simply be the result of eval....
ignored cell
![]() | 2 | No.2 Revision |
This is one way to choose the behavior of your cells
Create a custom class whose method eval does what you want with the input and instanciate it
class LazyCell(object):
def eval(self, args, *kwds):
*args, **kwds):
return "ignored cell"
lazy_cell = LazyCell()
LazyCell()
You can now use it in any cell
%lazy_cell
This cell will be ignored... and I can do whatever I want in it
it
And the output will simply be the result of eval....
ignored cell