As I went searching for an RStudio equivalent for Python I discovered IPython notebook, which I shortly described in this Stack Overflow answer:
IPython has a really cool sub-project called IPython notebook. It basically allows you to interactively code and document what you’re doing in one interface and later on export it as a notebook or script or print it as static html (and therefore pdf as well).
It starts a web application locally and you use it from your browser.
There’s also a Qt console for IPython, a similar project with inline plots, which is a desktop application.
Admire my first attempt at playing with the notebook: