[IPython-User] Launching notebooks, working directories, etc
Tue Apr 10 10:27:08 CDT 2012
I've just hacked together a script for *nix/mac (attached) which, when passed a .ipynb file as an argument, changes into the directory for the .ipynb file, checks for a running ipython notebook server and either launches a new one or simply opens a webbrowser to point at the existing one. This works by logging the stderr of the ipython notebooks to a file in that working directory which can then be searched for appropriate http addresses.
For Mac OS X, this is particularly useful if you drop it into an automator action which you associate with .ipynb extensions. To do this,create an automator 'application' and put a 'Run Shell Script' action into it. Select pass input 'as arguments' and set the shell to '/bin/bash'. Then put something like the following into the shell script action:
/path/to/ipynblaunch.py $* &
Where the path enhancement is only necessary if ipython isn't in your default OSX path. If you save this application as, say, 'IPython Launcher.app' somewhere, you can associate it to .ipynb files.
An obvious problem with this approach is that you can't easily kill the notebook servers that get launched without looking for them using ps, but if you don't mind lingering processes that don't do anything when not in use, then it shouldn't matter.
What is the roadmap for directory/file system/notebook server management as IPython develops? Most applications can handle directories and know how to 'quit' from within the UI. Is that in the plans or something more dramatic? I assume my hacked up approach will only be necessary in the near future...
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 844 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/ipython-user/attachments/20120410/6fcfeb9d/attachment.bin
More information about the IPython-User