[IPython-User] How to execute ipython notebook with cell-level magics from the command line?
Wed Nov 14 04:42:30 CST 2012
Le 14 nov. 2012 à 09:48, Christoph Deil a écrit :
> is it possible to execute an ipython notebook with cell-level magics from the command line?
> I have a bunch of ipython notebooks that contain e.g.
> %load_ext cythonmagic
> and I'd like to be able to run them from the command line for automatic testing.
> I tried converting the ipynb file to a py file and then running it through
> ipython -i myscript.py
File with .py extension will be treated as plain python file. You have to rename them with .ipy extension for IPython to do its magic.
Still, Cell magic are not yet supported in ipy script.
see this issue https://github.com/ipython/ipython/issues/2539
Following gist might be a good starting point, or even do what you want.
> but that already gives a syntax error for simple magics and I guess it's impossible to incorporate cell-level magics in regular python files somehow?
> IPython-User mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-User