Hacker News new | ask | show | jobs
by olefoo 4938 days ago
IPython notebook is actually one of the most interesting developments not just in the python world, but in computing generally. It's the first step towards the fully graphical shell on the internet that many of us have been looking for, whether or not we realize it.

Being able to weave together text|markdown, tabular data (in almost any format you want) and images ( whether from matplotlib, raw captures, or synthetic assemblies ) in one environment is very powerful.

I suspect that with some additional tools IPython notebook will become the integrators workbench par excellence, useful in many contexts.

4 comments

It sorely needs some better tutorials, demos. The official docs are dry and dwell on technical matters rather than giving you some sense of the potential. There isn't much else out there - especially if you aren't doing scientific or statistical work.

I'm sure the iPython Notebook could be useful in my day to day Python/Django usage but I haven't figured out how yet.

There's a great (but somewhat lengthy) video tutorial[1] from Pycon US'12 that covers a lot of IPython and the Notebook. Highly recommended; it's a live demo by the authors of the tools. Seriously, IPython is the coolest thing that happened to Python since Python, and anyone even slightly interested owes it to himself to play with IPython.

[1] http://www.youtube.com/watch?v=2G5YTlheCbw

Wow. Python has become something like Smalltalk, but with some architecture improvements. (Client/server through zeromq) This is to say, it's gone from programming environment to a multimedia glue that allows the integration of automation to everything. (Google DynaBook)
Thanks. Personally I'm allergic to video tutorials but I'm sure that will be great for others.
I'm interested in installing EPD, but it seems to want to install in my C:\Python27 directory (I'm on Windows here at work). Will this overwrite or otherwise interrupt my existing Python installation?
Hey, you should try the Anaconda Community Edition. It's a larger download, but that's because it comes with more packages(which may be good or bad, depending on your opinion) But it by default installs into C:/Anaconda, and it allows you to change the installation directory.

I work for Continuum, btw

As far as I can remember - yes, it will try to overwrite your Python dir, at least it did for me on my Windows machine (I backed up my original C:\Python27 before trying EPD, and then had to restore it, IIRC; there was also some mess with paths, but nothing incurable). I also tried installing EPD into its own directory, but Windows EPD package failed to run Notebook anyways (some issues with Tornado), and I was just too excited to try Notebook. Jumped to Ubuntu@EC2 and was running Notebook with EPD from it in 5 minutes.

Your mileage may vary, of course, so I'd say have a backup and give it a try - at least EPD didn't ruin anything for me. I'm pretty sure IPython Notebook on Windows machine is doable with some lib-hunting/building, since I managed to have fully functioning IPython Qt console installed and running perfectly on Win7 right now, and Notebook is just a couple additional requirements away from it.

The only libraries you should need to run the notebook are pyzmq and tornado, both of which you can download for Windows from Christoph Gohlke's page: http://www.lfd.uci.edu/~gohlke/pythonlibs/

That said, it's very easy to get it going on EC2, especially with Notebookcloud.

Sorry you got those issues with the notebook, this should not have happened. The notebook is certainly supported on windows in principle, the fact that it does not within EPD for you is a bug, I apologize for that.

With the latest EPD 7.3-2, ipython notebook --pylab inline works for me on windows 7 32 bits + chrome. Feel free to contact me privately (see my HN account) if you want more help on how to get this fixed.

Ryan, you should be able to select where it will install itself. It will override your existing python installation if you install it in the same location as your original, so don't do that.
I second this recommendation. Its an awesome demo. I used ipython from before, but barely scratched the surface. Now I use IPython to finish up assignments where the code documents itself, and with extra tex/images to fill in where required. I even 'cheat' sometimes on Project Euler by running problems in parallel using ipython. ;)
that is amazing. I assumed ipython was just another interactive shell - I will be using notebooks to collate my thoughts forever now! (indeed, it sounds like I could now do most of my development off a chromebook and a cloud server.)

edit: for clarification, I saw this comment, and three hours later I'm back to reply.

If there's one complaint to make about IPython, it's that the authors seem to be positioning IPython as a scientific/mathematical tool, even though it is so much more. Most of its docs assume you will be using IPython for its pylab and matplotlib features, instead of as a general-purpose Python shell. This is not surprising considering its roots, but still.

That said, I thought it was quite straightforward to setup and use the IPython Notebook.

We do make sure that it works without the rest of the Scipy stack, so it's useful for people outside the scientific world. But most of the core developers have a scientific background, and that's where we see the most interesting challenges.
In addition to the other links in this thread, Fernando's PyCon.ca keynote's has a great introduction to the power of IPython and how it's revolutionizing the scientific (and soon the general developer) communities. https://www.youtube.com/watch?v=F4rFuIb1Ie4
This is the best video I found, it has a demo at 20:00 which was recorded November 2012.
For anyone else who doesn't know what it is, this seems useful:

http://www.youtube.com/watch?v=HaS4NXxL5Qc#t=2m55s

I hate to dump on this but IMHO what the world has been waiting for is not a Mathematica clone in Python. Neither do I think it would be a step in the right direction to funnel Python development through the browser.

There are those who will find it useful but others will find that there are better desktop tools for these purposes. Individual developers are free to pick and choose.

Fortunately, neither this announcement not the Ipython roadmap emphasises development of the web-based notebook.

Executable documents are powerful tools for teaching and learning. Focus in this area will pay off all across the Python community.
Executable documents are powerful tools for teaching and learning.

These already exist, though, and the ecosystem already has a lot of support and momentum behind it: javascript within the browser.

Would you explain what some of the benefits are in comparison to this? I'm an outsider so I don't have a very firm understanding of what the implications are.

I'm very optimistic about iPython as the solution for "executable documents", much so over Javascript by itself (despite all of Bret Victor's amazing efforts).

There is a development branch of iPython by Brian Granger that emits JSON when you display a python object in the notebook. You can easily create handlers that display any Python object using javascript. That means D3.js or whatever HTML5/WebGL app you can throw in there becomes the front-end to a very powerful numerical computation back-end. Check out this demonstration I help code, http://www.flickr.com/photos/47156828@N06/8183294725

Javascript isn't quite what people mean by 'executable documents' - this is about an interface which mixes visible code blocks and results with rich text.

You could certainly base something like that around Javascript, and it would have certain advantages. But the Python world has a lot invested in scientific computing - Numpy, Scipy, and dozens of packages built on top of them. It's also got good integration with other languages, from FORTRAN to R. This sort of scientific computing is where we think the notebook really shines.

As other replies have already eluded, this isn't really comparable to JavaScript. Also good luck crunching huge datasets on clusters from within your browser with a pure JavaSCript implementation.
Python has a tons of scientific libraries and scientific who know how to use them.
And for doing harm. (re macro viruses for MS Office).
What do you think the world is waiting for, and what are these better desktop tools?
Most of my programming these days is actually done in IPython notebook. Having an instant feedback is invaluable. I put my code in plain old .py files only once it needs to be imported.

I'm even wondering: if there was a way for notebooks to import each other, would I still bother with modules?

You can import notebooks in other notebooks if you turn on the option to autosave your ipynb files as .py files too.

1. In ipython_notebook_config.py, set the following:

# Save .py for each notebook for import elsewhere

c.NotebookManager.save_script = True

2. Restart your notebook server. 3. Save any notebooks you'd like to import under module friendly names. (They wind up in the same dir as the ipynb files.) 4. In your interactive notebook, import your_other_notebook.

This works well when all your notebooks are in the same folder, which is the default. I haven't given much thought to how you might create packages this way, but perhaps with a few code changes you could?

We don't really envisage the notebook as a tool for creating modules and packages. It's not a replacement for a traditional editor or IDE; indeed you could use it alongside one.

We might even pair it with a web-based editor, like ACE, so you can comfortably write modules on the same server.

To be fair, this graphical shell functionality has been part of Mathematica for at least the past 7-8 years. In fact, I would argue that within Mathematica, one can work with a much larger number of formats and data sources.
I think its important that this is coming to the FOSS world though. I agree that Mathematica/MATLAB are brilliant in this regard, but you (or your employer) has to shell out the big bucks for them, so if you want to collaborate with others who aren't on your platform you're almost certainly out of luck.