Is there something like RStudio for Python?
PythonIdePython Problem Overview
In RStudio, you can run parts of code in the code editing window, and the results appear in the console.
You can also do cool stuff like selecting whether you want everything up to the cursor to run, or everything after the cursor, or just the part that you selected, and so on. And there are hot keys for all that stuff.
It's like a step above the interactive shell in Python -- there you can use readline to go back to previous individual lines, but it doesn't have any "concept" of what a function is, a section of code, etc.
Is there a tool like that for Python? Or, do you have some sort of similar workaround that you use, say, in vim?
Python Solutions
Solution 1 - Python
IPython Notebooks are awesome. Here's another, newer browser-based tool I've recently discovered: Rodeo. My impression is that it seems to better support an RStudio-like workflow.
Solution 2 - Python
spyder or install python(x,y). it is great.
If you are new to Python, you can install the free Anaconda distribution (http://continuum.io/downloads.html), which will install Spyder for you, as well as Python 2.7 and IPython. Spyder is very similar to RStudio.
Solution 3 - Python
Jupyter Notebook (previously known as IPython notebook) is a really cool project for interactive data manipulation in Python (and other languages, including R). It basically allows you to interactively code and document what you're doing in one interface and later on save it as a:
- notebook (.ipynb)
- script (a .py file including only the source code)
- static html (and therefore pdf as well)
You can even share your notebooks online with others using the nbviewer service, where people publish whole books. Furthermore, GitHub renders your .ipynb files. You can publish your Jupyter Notebooks as reproducible research articles on Authorea. For collaborative editing by multiple users, check out Google Colab built on top of Jupyter.
The default Jupyter Notebook version starts a web application locally (or you deploy it to a server) and you use it from your browser. As Ryan also mentioned in his answer, Rodeo is an interface more similar to RStudio built on top of the Jupyter kernel.
JupyterLab is a newer take on the UI allowing for more flexibility in how you edit your notebooks, control interactive widgets and even run commands in terminal emulators.
There's also a Qt console for IPython, a similar project with inline plots, which is a desktop application.
Jupyter is a normal Python package and can be installed using pip install jupyter
. To get all the scientific libraries running on your computer, however, it might be easier to try the official Jupyter Docker containers. For example, assuming your notebooks are in ~/code/jupyter, you can run the container as:
docker run -it --rm -p 8888:8888 -v ~/code/jupyter:/home/jovyan/work jupyter/datascience-notebook
Solution 4 - Python
Check out Rodeo from Yhat if you're looking for something like RStudio for Python.
Rodeo has:
-
text editor (uses Atom under the hood)
-
Vim / Emacs mode
-
an IPython console
-
autocomplete
-
docstrings
-
ability to see plots, dataframes, variables
Solution 5 - Python
You might want to look into JupyterLab (the next generation of Jupyter Notbooks): https://github.com/jupyter/jupyterlab.
JupyterLab aims to create a more desktop-like experience on the Web.
Update: As of March 2018 JupyterLab is in beta. "The beta releases are suitable for general usage. For JupyterLab extension developers, the extension APIs will continue to evolve until the 1.0 release. Eventually, JupyterLab will replace the classic Jupyter Notebook after JupyterLab reaches 1.0."
To run Jupyter Lab as a Desktop Application, see christopherroach.com/articles/jupyterlab-desktop-app (Thanks to PatrickT).
Here's a quick preview:
You can arrange a notebook next to a graphical console atop a terminal that is monitoring the system, while keeping the file manager on the left:
For more details see: https://blog.jupyter.org/2016/07/14/jupyter-lab-alpha/ and here: http://www.techatbloomberg.com/blog/inside-the-collaboration-that-built-the-open-source-jupyterlab-project/.
Solution 6 - Python
Pycharm is a really decent IDE. From what I have seen so far it is the most similar to Rstudio. Another nice piece is that it allows you to install new Python libraries in a fashion similar to Rstudio (which otherwise can be a nightmare). There is now a free 'community' edition.
Solution 7 - Python
I think it is worth while to mention that RStudio v1.1.359 Preview is released. It has terminal feature that can be used for Python.
Download is available here
Documentation is available here
Solution 8 - Python
spyder is you need!
https://code.google.com/p/spyderlib/
Spyder (previously known as Pydee) is a powerful interactive development environment for the Python language with advanced editing, interactive testing, debugging and introspection features
Solution 9 - Python
For a nicer interactive shell for Python, have a look at DreamPie. It's not really an IDE though (as RStudio seems to be?)
Solution 10 - Python
Wing IDE, and probably also other Python IDEs like PyCharm and PyDev have features like this. In Wing you can either select and execute code in the integrated Python Shell or if you're debugging something you can interact with the paused debug program in a shell (called the Debug Probe). There is also special support for matplotlib, in case you're using that, so that you can work with plots interactively.