<div dir="ltr">Matthias, <div><br></div><div>That's perfect and exactly the sort of thing I was looking for. I looked around the IPython API but didn't quite get to the code snippet you showed.</div><div><br></div><div>Thanks!</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 11:06 AM, Wes Turner <span dir="ltr"><<a href="mailto:wes.turner@gmail.com" target="_blank">wes.turner@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"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Fri, Dec 5, 2014 at 2:57 AM, Matthias BUSSONNIER <span dir="ltr"><<a href="mailto:bussonniermatthias@gmail.com" target="_blank">bussonniermatthias@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Hi Andrew.<br>
<br>
Base on a Fernando example would the following python snippet suit you ?<br>
<br>
import IPython.nbformat as nbf<br>
nb = nbf.v4.new_notebook()<br>
text = "This is an auto-generated notebook"<br>
nb['cells'] = [ nbf.v4.new_markdown_cell(text)]<br>
nb['cells'].append(nbf.v4.new_code_cell('#'+text))<br>
fname = 'test.ipynb'<br>
<br>
with open(fname, 'w') as f:<br>
    nbf.write(nb, f, 4)</blockquote><div><br></div></span><div>1. This could be a useful commandline option.</div><div><br></div><div>2. You could accomplish the same with a <a href="https://github.com/audreyr/cookiecutter" target="_blank">https://github.com/audreyr/cookiecutter</a> jinja2 project template.</div><div><br></div><div>    * There could be variations on such a template e.g. with default headings for:</div><div>      * <a href="https://en.wikipedia.org/wiki/Scientific_method#Elements_of_the_scientific_method" target="_blank">https://en.wikipedia.org/wiki/Scientific_method#Elements_of_the_scientific_method</a></div><div>      * { Abstract, Question, Hypothesis, Experiment, Observations/Data, Analysis, Conclusion, ... }</div></div></div></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>