People who liked Rstudio also liked [this Python IDE]
October 31, 2014 12:23 PM   Subscribe

ISO Python IDE. Edit code on one side of the screen. Run code on other. That's it.

I'm new - so new - to programming, and have only been playing around in R since July. Trying to pick up Python, and I really, really miss Rstudio, the IDE I'd been using. So I went looking for a Python IDE, and while there are a lot of favorites out there, the out of the box learning curve on them seems to be much steeper. That's where you come in. Can you recommend me a Python IDE that acts like Rstudio, in the sense that you open it up and without having to tinker with any settings, you have a window in which you edit code and a window in which you can run that code (and, optionally, a window or sidebar that shows you your files/projects)?

This questions feels like it should be easy, but I have looked at this massive list of options on Wikipedia and this question on StackOverflow and all the discussion of feature sets are just way over my head right now. I just want to edit code and run code next to each other in a reasonably stable environment. That's it.
posted by deludingmyself to Computers & Internet (14 answers total) 8 users marked this as a favorite
Honestly, I usually just use a text editor like TextMate or Sublime Text plus a terminal window with an ipython session.

If an IDE is something you're set on, I've used Ninja and PyDev, and both were ok and should meet your "just work" requirement, although they didn't leave a big impression on me. I had trouble with Eric lagging even on relatively small source files. I spent a lot of time with Enthought's Canopy, which should work out of the box and also has a decent package manager. I liked it, but I've only used the academic license version and not the free version.
posted by dorque at 12:30 PM on October 31, 2014

I guess I should clarify that with Python, if really all you want is "edit and run" with no other bells and whistles, nearly any IDE should be able to just do that without too much/any fiddling, and there isn't a lot of additional value in having an IDE vs an editor and a terminal. (You'll also get a fair number of people who think using an IDE is cheating or going to hamstring your coding or whatever, which I accidentally succumbed to a bit -- sorry.)

Are there additional IDE-specific things you want? Like tab-completion of function names and so forth? Which ones have you tried and found the learning curve too steep? That could help narrow it down.
posted by dorque at 12:36 PM on October 31, 2014

I did that with IDLE today! (Am newish to Python but not to programming.) Just press F5 to run the file you're editing in the console window (ctrl-N brings up a new file editor if you want to start a brand new file). I'm sure it's possible to outgrow it, but it should be fine to get you started messing around with the language.
posted by rivenwanderer at 12:38 PM on October 31, 2014 [1 favorite]

So, my attempts to use IDLE have been thwarted by the fact that apparently it only can run one statement at a time (if I understand the error it's throwing correctly), and I don't want to have to paste each line in, execute it, and paste another, execute it, etc. Rstudio would just run the file in the editor until it hit an error. If that's doable in IDLE, I'm completely missing the boat on how to make that happen. But again: very new at this.
posted by deludingmyself at 12:50 PM on October 31, 2014

This isn't quite the same as RStudio (which is actually pretty bare-bones in the IDE spectrum), and not really oriented at an IDE-style multi-file project exactly. But I really recommend trying out IPython notebook for your interactive python editing / running / prototyping needs; for the kind of things one does in RStudio in my experience I think the IPython notebook structure is actually superior. It's also well integrated with the scipy stack if that's something you're interested in.
posted by advil at 12:52 PM on October 31, 2014 [3 favorites]

The IPython notebook interface is also nice and probably close to what you want, but not exactly. It's a Mathematica-style notebook interface, so you have a textbox for code, followed by the results of that code (possibly something graphical), followed by another textbox, etc. It's very simple to use; here's a non-functional example of what it might look like. If you have a script you want to run you can just paste the whole thing into a single box, or break it up to look at the intermediate outputs. It runs in the browser but locally on your machine, so no internet connection required.
posted by vogon_poet at 12:53 PM on October 31, 2014

You are looking for Spyder.

See also here.
posted by grog at 12:59 PM on October 31, 2014

By default, IDLE just shows you the interactive session (which is why it only takes one statement at a time). The New File option will give you an editor window alongside the interactive session. There you can put in your multi-statement script, and F5 will run it.
posted by dorque at 1:02 PM on October 31, 2014 [2 favorites]

Huh. IPython notebook is not what I thought I was looking for, but it does seem to have the level of simplicity I want, plus good design for tracing back what I've done as a individual learner (as opposed to file management for projects, which I think of as pretty different requirements). Plus figuring out how to install and launch it did not involve parsing through a dozen+ different options.

And, most importantly, there is a pulldown that says "user interface tour." Thank you, god. And Metafilter.

I'll still take recommendations for IDEs, but this is now sufficiently solved that I can get back to my actual work of solving this week's bioinformatics algorithms homework.
posted by deludingmyself at 1:05 PM on October 31, 2014 [1 favorite]

Most IDEs will do what you want. What you are looking for in the IDE is called a console window. They almost all have a command history functionality and let you arrange windows to your liking. My advice to a beginner is to also use an IDE with a debugger that can let you see what is in memory and step through code. That is probably the best learning tool there is.
posted by srboisvert at 1:48 PM on October 31, 2014

I'll still take recommendations for IDEs, but this is now sufficiently solved that I can get back to my actual work of solving this week's bioinformatics algorithms homework.

What the iPython notebook is not particularly good for is writing anything that isn't meant to live in that notebook forever more. A function in one notebook stays in that notebook unless you copy-and-paste it somewhere else (yes, you can export to a text file, but it's still a pain). So it's great for doing homework or roughing something out, but probably not so much if you're going to be writing code for research. (I sometimes use iPython for working with a small example or trying to build a model and then shift into a text file when I know what I actually want to be doing.)

I have a colleague who is a fan of PyCharm, which does have a console available like RStudio. The aforementioned Sublime has good tab-completion (maybe you have to install a package--I forget). I'm pretty sure it has "run everything in this file using Python". (Command-B probably.) I spend a couple of weeks recently using Sublime, but I'm mostly using Vim which is, frankly, the unnecessarily complicated solution. But I spend an awful lot of time working over ssh, and having the same thing available locally and over ssh is nice. (I haven't found the optimal Vim setup. The plugins I've tried that give you tab completion, especially across multiple files get sluggish given enough code, which was why I was trying out Sublime.)
posted by hoyland at 4:06 PM on October 31, 2014

PyCharm is freakin' awesome, and I do constantly use the console for testing out snippets, but probably overkill for what you're trying to do. If ever you need a full fledged IDE, though, definitely give it a try.
posted by wierdo at 7:36 PM on October 31, 2014 [1 favorite]

It sounds like IDLE was designed for you. Really. It's a bare-bones IDE with syntax highlighting, autocomplete, a pretty decent debugger, and some other IDE-type candy, that's also simple and lightweight.

As others have pointed out, it does have the slightly odd behavior of opening itself in interactive mode by default.

I would use it for a while, and make a list of the things it either doesn't do, or that irritate you, and then from there look at some of the more complex IDEs that exist. Or you may find that it does the job and you don't need to move on. (Which is the situation I found myself in. I don't do any heavy lifting in Python but for what I do, IDLE is fine.)
posted by Kadin2048 at 10:44 AM on November 1, 2014

I'm also a devoted RStudio user and Enthought Canopy's Express version (the free one) is what I finally settled on for python after a very similar search. I liked Pycharm too, but Canopy's package handling (heh) is more robust and easier to work with.
posted by dialetheia at 12:21 PM on November 1, 2014

« Older FPS games for weak constitutions   |   Breaking a lease in New Albany, Ohio- Help needed... Newer »
This thread is closed to new comments.