[IPython-dev] running/getting output into a new programmatically-generated notebook

Antonino Ingargiola tritemio at gmail.com
Mon Mar 23 19:13:03 EDT 2015


On Mon, Mar 23, 2015 at 3:38 PM, Thomas Kluyver <takowl at gmail.com> wrote:

> On 23 March 2015 at 15:12, Antonino Ingargiola <tritemio at gmail.com> wrote:
>
>> Sorry for jumping in, for completeness sake (and future reference), how
>> do we change the timeout in same thread when using ExecutePreprocessor()?
>>
>
> You can pass in timeout= as a keyword argument when creating it, or set it
> as an attribute on the preprocessor instance.
>
> E.g.
>
> nb = nbformat.read(nbPath, as_version=4)
> ep = ExecutePreprocessor(timeout=None)   # Option 1
> ep.timeout = 60  # Option 2
> ep.preprocess(nb, {'metadata': {'path': nbPath}})
> nbformat.write(nb, nbPath)
>
> Thomas
>

Great thanks! I'm going to use it to replace runipy in a script that batch
execute all the notebooks involved for a paper.

Antonio
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20150323/f6760b10/attachment.html>


More information about the IPython-dev mailing list