Can we programmatically have the notebook "forget" all prior code snippets 
as well so we effectively have a "clean" environment for a new section?

On Wednesday, 20 December 2017 05:33:30 UTC-5, Fernando Perez wrote:
>
> On Mon, Dec 18, 2017 at 10:48 PM, Roland Weber <[email protected] 
> <javascript:>> wrote:
>
>> Restart the kernel before each section. That will clear all state in 
>> memory, and reset the execution count
>>
>
> You can also force that number to be any value with:
>
> ip = get_ipython()
> ip.history_manager.enabled = False  # needed to avoid duplicate line # 
> error messages
> ip.execution_count = 0  # your number here
>
> and it will start counting at that number from then on.  OP could put that 
> in a little utility/magic that resets it to 1, and then drop those cells 
> from the book output with a tag.
>
> Visual example:
>
> [image: Inline image 1]
>
> cheers,
>
> f
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jupyter/9bfd0c07-0fc6-4dc2-8574-426c8f76c040%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to