<div dir="ltr"><div><span style="font-size:12.8000001907349px">It wanted a resources argument, an empty dict seems to work.</span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px">ExecutePreprocessor().</span><span style="font-size:12.8000001907349px">preprocess(nb, {})</span><br></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div><div><span style="font-size:12.8000001907349px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Mar 18, 2015 at 10:51 AM, Thomas Kluyver <span dir="ltr"><<a href="mailto:takowl@gmail.com" target="_blank">takowl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span class=""><div class="gmail_extra"><div class="gmail_quote">On 18 March 2015 at 10:15, Ana Nelson <span dir="ltr"><<a href="mailto:ana@ananelson.com" target="_blank">ana@ananelson.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div></div><div>Currently calling it like this:<br><div><br></div><div><div>        subprocess.check_output([</div><div>            'ipython',</div><div>            'nbconvert',</div><div>            '--execute',</div><div>            '--to', 'notebook',</div><div>            '--output', nbPath,</div><div>            nbPath</div><div>            ])</div></div></div></blockquote></div><br></div></span><div class="gmail_extra">For the record, if you need to make it more efficient, it should be fairly simple to do the same thing in-process, rather than running a separate IPython process to do it. Something like:<br><br></div><div class="gmail_extra">nb = nbformat.read(nbPath, as_version=4)<br></div><div class="gmail_extra">ExecutePreprocessor().preprocess(nb)<br></div><div class="gmail_extra">nbformat.write(nb, nbPath)<br><br></div><div class="gmail_extra">(Untested)<span class=""><br><br>> By the way, I have just noticed that ipython3 creates v3 notebooks, while ipython2 creates v4. Is this by accident?<br><br></span></div><div class="gmail_extra">How did you get that? IPython 3 should create v4 notebooks, and IPython 2 should create v3 notebooks.<span class="HOEnZb"><font color="#888888"><br><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra">Thomas<br></div></font></span></div>
<br>_______________________________________________<br>
IPython-dev mailing list<br>
<a href="mailto:IPython-dev@scipy.org">IPython-dev@scipy.org</a><br>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a><br>
<br></blockquote></div><br></div>