<div dir="ltr">Here:<div><br></div><div><a href="http://nbviewer.ipython.org/gist/fperez/9716279">http://nbviewer.ipython.org/gist/fperez/9716279</a><br></div><div><br></div><div>Cheers,</div><div><br></div><div>f</div></div>

<div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Mar 22, 2014 at 1:11 AM, Zoltán Vörös <span dir="ltr"><<a href="mailto:zvoros@gmail.com" target="_blank">zvoros@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 bgcolor="#FFFFFF" text="#000000">
    <font size="+1">But LaTeX has nothing to do with the problem. The
      question was, given an empty notebook, how does one *generate* the
      following:<br>
      <br>
      In [1]: plot(sin(1*x))<br>
      <br>
    </font><font size="+1"><font size="+1">In [2]: plot(sin(2*x))<br>
        <br>
      </font></font><font size="+1"><font size="+1"><font size="+1">In
          [3]: plot(sin(3*x))<br>
          .<br>
          .<br>
          .<br>
        </font></font></font><br>
    <font size="+1"><font size="+1"><font size="+1"><font size="+1">In
            [200]: plot(sin(200*x))<br>
            <br>
            The 200 plots have to be in separate cells, so that their
            order can be changed afterwards, e.g. I want to have an
            IPython notebook as we understand it, but I would like to
            generate its content (executable code) dynamically. Metaprogramming,
            if you wish.<span class="HOEnZb"><font color="#888888"><br>
            <br>
            Zoltán<br>
            <br>
          </font></span></font><br>
        </font>
      </font></font><div><div class="h5">
    <div>On 22/03/14 00:28, Paul Hobson wrote:<br>
    </div>
    <blockquote type="cite">
      <div dir="ltr">At this point, I have to wonder if it makes more
        sense to just write a small utility to build a LaTeX document
        for yourself.
        <div>-paul</div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Fri, Mar 21, 2014 at 12:30 PM,
          Zoltán Vörös <span dir="ltr"><<a href="mailto:zvoros@gmail.com" target="_blank">zvoros@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 bgcolor="#FFFFFF" text="#000000"> <font size="+1">Hi
                Araron,<br>
                <br>
                Thanks for the suggestion! But the main problem was not
                how to run the notebook, but how to generate the code in
                the first place. Basically, I would like to have a
                notebook that writes itself. Once it's written, it can
                be run in many ways, as you pointed out.<br>
                <br>
                Cheers,<br>
                Zoltán<br>
                <br>
              </font>
              <div>
                <div>
                  <div>On 21/03/14 20:13, Aaron O'Leary wrote:<br>
                  </div>
                  <blockquote type="cite">
                    <blockquote type="cite">
                      <pre>Once you've generated the notebook, you could use runipy to run it without
having to go through the noteboko UI: <a href="https://github.com/paulgb/runipy/" target="_blank">https://github.com/paulgb/runipy/</a>
</pre>
                    </blockquote>
                    <pre>Or, if you're using IPython 2.0 you can do 

    ipython -c "%run your_notebook.ipynb"

from the command line. This is the same as opening it and clicking "run
all cells".

aaron
_______________________________________________
IPython-dev mailing list
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a>
</pre>
                  </blockquote>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            IPython-dev mailing list<br>
            <a href="mailto:IPython-dev@scipy.org" target="_blank">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>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_______________________________________________
IPython-dev mailing list
<a href="mailto:IPython-dev@scipy.org" target="_blank">IPython-dev@scipy.org</a>
<a href="http://mail.scipy.org/mailman/listinfo/ipython-dev" target="_blank">http://mail.scipy.org/mailman/listinfo/ipython-dev</a>
</pre>
    </blockquote>
    <br>
  </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><br clear="all"><div><br></div>-- <br>Fernando Perez (@fperez_org; <a href="http://fperez.org" target="_blank">http://fperez.org</a>)<br>fperez.net-at-gmail: mailing lists only (I ignore this when swamped!)<br>

fernando.perez-at-berkeley: contact me here for any direct mail<br>
</div>