this post was submitted on
38 points (73% like it)
60 up votes 22 down votes
all 142 comments

[–]sirmc 128 points129 points ago

Vim.

[–]hongminheeSider Wand 18 points19 points ago

[–]sylvain_soliman 3 points4 points ago*

I now use vim with:

[–]ijuggle534 7 points8 points ago

Seconded. python.vim

[–]notg3orgePythonista 2 points3 points ago

There is also python mode

[–]meepmorp 0 points1 point ago

Thanks, bookmarked.

[–][deleted] 2 points3 points ago

Looks interesting. I'll give it a download. Thanks!

[–]green0eggs 8 points9 points ago

Give an hour over to learning Vim, you'll easily get it back in productivity. Not obvious at first but stick with it.

(Thirded)

[–]Araneidae 2 points3 points ago

Thirded. The learning curve is a bit steep and it does need a bit of configuration. I suggest you print this out (the reference sheet, not the tutorial) and put it by your keyboard.

If I can persuade you to leave tab characters behind you'll want the following in your ~/.vimrc (or whatever the Windows equivalent is):

set list listchars=tab:»¯,trail:°  # Show tabs and trailing whitespace
set expandtab    # Insert tabs as whitespace
set softtabstop=4   # Default indentation

You probably also want this one

set smarttab

[–]the_merk 3 points4 points ago*

vim. i do bioinformatics. if i leave something running, i can ssh in from my phone, check its status and if i see that i had a typo or bug, i can go in and edit the file to fix it because doing everything requires virtually just the keyboard and no silly button combinations.

edit: by "just the keyboard," i meant single strokes.

[–]hapagolucky 2 points3 points ago

Not to mention. Once vi keys are in your muscle memory, you'll be that much faster at doing command line manipulations in *nix shells or hacking away in the python interpreter (especially ipython).

[–]the_merk 1 point2 points ago

wait until you start using vi mode on the shell. you'll confuse the hell out of people as you whisk around the line doing magicks.

[–]meepmorp 0 points1 point ago

Yeah, I can't use the shell without vi mode anymore.

[–]83A 1 point2 points ago

i used this config script. works great.

http://sontek.net/turning-vim-into-a-modern-python-ide

[–]oxseyn 1 point2 points ago

Can upvote enough. And if you don't grok vi, read this: https://gist.github.com/1178878

[–]wesllyxxx 58 points59 points ago

I use Sublime Text 2

[–]mcilrain 16 points17 points ago*

I'm not a Sublime Text 2 user, I'll have to give it a look.

EDIT: I'm yet another Sublime Text 2 user.

[–]kryptn 6 points7 points ago

I too use ST2.

[–]MintyPhoenix 2 points3 points ago

I like ST2 with Sublime Linter (and Terminal but that's more agnostic).

[–][deleted] 1 point2 points ago

SublimeLinter + CodeInteliigence is what sold me on ST2.

[–]hackop 1 point2 points ago

I'm looking into both of these plugins/add-ons for ST2. I may be using it wrong (likely) but if I do something like "import ", does ST2 support auto-complete on the modules and provide a list of available imports? It seems like it only auto-completes items already previously used in the source file.

Similarly, if I import os, then type "os." will it auto-complete all the module pieces even if I haven't used them yet?

[–]MintyPhoenix 0 points1 point ago

With the Code Intel plugin that kennymeyers posted then yes, it will.

[–]hackop 0 points1 point ago

Damn. That means I'm doing something wrong somewhere. That behavior is not happening.

[–]MintyPhoenix -1 points0 points ago

Did you install it via the Package Manager? Presuming that CodeIntel is installed properly, do note that it does take a few seconds at least to index while you're using it for the first time(s). When it's doing this, you should be able to see this information in the status bar (at least, I could, and I have today's update from the ST2 dev channel).

[–]rdkllhighperformance telco server stuff 3 points4 points ago

another sublime text 2 user here

[–]anacrolixc/python fanatic 11 points12 points ago

[–]vanwarantion 1 point2 points ago

Geany is my favorite so far. I also use it for C++, php and note taking.

[–]paulgp 70 points71 points ago

Emacs

[–]brool 4 points5 points ago

Yeah, python-mode in Emacs is really decent. Nice navigation, easy execution and debugging, and it even has nice touches like highlighting the current line when you're in the debugger.

[–]AeroNotix 2 points3 points ago

Yupp, emacs+=1

Ropemacs, Autocomplete and Yasnippet are all almost indispensable add-ons for Python emacs'ing.

[–]BluePeppers 4 points5 points ago

(+ emacs 1)

FTFY

[–]skeeto 3 points4 points ago

(1+ emacs)

FTFY

[–]BluePeppers 0 points1 point ago

I briefly looked for an inc function (clojure is my prefered lisp). Thanks :)

[–]AeroNotix 0 points1 point ago

And what a beautiful lisp it is.

[–]Megatron_McLargeHuge 2 points3 points ago

Does anyone have ipython well integrated with emacs? The documentation out there is inconsistent and I could never get all the modules working together at any given time. Autocomplete, go-to-definition, and show-docstring all work less reliably than I'd like.

[–]_Mark_ 0 points1 point ago

Having pylint on F1 in python-mode is nice (though I keep meaning to sit down and try pyflakes + flymake for "no click" syntax checking...)

The other win of emacs is that you not only can you have have a python-subprocess buffer to dynamically throw code at... you can use PyMacs to write emacs extensions in Python instead of elisp. (After all, you can only use elisp code in emacs, you can use python code everywhere, so you'll eventually be better at python than elisp - or you started out that way :-)

[–]pinchyfingers -1 points0 points ago

Only correct answer.

[–]mordaunt0 1 point2 points ago

begun the flamewar has

[–]MrPinkle 17 points18 points ago

Real programmers use a magnetized needle and a steady hand.

[–]esotera 7 points8 points ago

Gedit with the terminal & python plugins, and lots of other useful ones. I'm currently writing my own lightweight text editor in wxPython, which I'll probably end up using more often.

[–]philes 5 points6 points ago

Spyder is pretty nice.

[–]the_merk 0 points1 point ago

the lack of vi keybindings kills it for me.

[–]Keith 10 points11 points ago

Dunno why more people don't use/know about ActiveState's Komodo Edit. I really like it.

[–]okmkzimport antigravity 2 points3 points ago

It's a great editor all around.

[–]bigbigG 6 points7 points ago

I use Eric, and I love it. Visual step through debugging FTW. Some discussion here.

[–][deleted] 5 points6 points ago

I use Pyscripter. Autocomplete and highlighting are nice (at least, when Autocomplete isn't being over zealous and changing 'i' to 'id').

[–]AeroNotix 0 points1 point ago

The main reason I got rid of it. You can't use single character variable names.

Try putting a variable with a capital P. OMG. So annoying, switched to emacs.

[–]kezabelleDjango, mostly. 2 points3 points ago

Maybe it's really, really keen for variables to follow pep8?

[–]AeroNotix 0 points1 point ago

I was thinking of that, but no, I think there needs to be a setting for how many characters you have to type before the autocomplete kicks in, you know, like how nearly ALL other editors have?

Other than that though, PyScripter is pretty much the best editor I found on Windows. I even went as far to set it up in Wine on my Arch install just to have access to it.

[–][deleted] ago

[deleted]

[–]AeroNotix 0 points1 point ago

You can switch it off, not change how many characters you need to type before it'll activate.

[–]redditthinksHobbyist 1 point2 points ago

You can switch it off in the options.

[–]bheesham 9 points10 points ago

I've used Notepad++ before. Then I switched over to Eclipse with PyDev. I may switch over to something a bit lighter though, like Sublime Text 2.

[–]hackop 1 point2 points ago

I use NP++ but it doesn't have (or I haven't found) python auto-complete. I also wish I could manage large projects with it more easily.

[–]remyroy 6 points7 points ago

There is no standard. People use what they have tried and liked over the years.

Get an editor that understands encodings, that can show you white spaces and that has syntax coloring. Most of the other features are overrated anyway.

[–][deleted] 1 point2 points ago

Do you have any specific suggestions? Really, anything with a decent auto-complete would probably be fine by me. The only other editor I've used is CodeBlocks for C, and I thought it was pretty OK.

[–]luckystarrpass # procrastinate 1 point2 points ago

Vim + pythoncomplete + supertab + syntastic

Additionally set a few variables in your vimrc.

[–]remyroy 1 point2 points ago

I like Sublime Text 2, but there are many other good editors too.

[–]anonymous_hero 15 points16 points ago

PyCharm, from JetBrains, dammit. Why do people insist on using inferior tools? PyCharm is obviously the best thing out there for working with Python.

[–]noreallyimthepope 5 points6 points ago*

Edit: See exchange below. This is likely related to environment.

—————

Except the moment I start using ÆØÅ, its debugger craps itself. That's kind of a problem since they are necessary in my language (and no, I'm not going to use 80s style meta-ligatures like AE).

Added bonus: They completely disregard the ticket I've opened on it around August/September. They've even done a full release since and still have not fixed it.

[–]vanwarantion 6 points7 points ago

# -*- coding: utf-8 -*-     is your friend.

[–]noreallyimthepope 3 points4 points ago

Bloody hell, that's it.

I tested it with both UTF-8 and ISO-8859-1 in 1.5 and made an error report. When 2.0 came out, I only tested the latter.

… and now that I test again with ISO-8859-1 instead, it works. Bloody fucking hell. Must have been my environment (I'm running it on another user now than usually), since I haven't updated since 2.0 release.

Well, the good news are that I can start using it again...

[–]anonymous_hero 4 points5 points ago

Really now? I sometimes use Ä and Ö in .py files, but the only "problem" I've noticed is that then I need to declare the file's encoding in the beginning.

The debugger sure works fine even with those characters in there.

[–]hglmanguy who writes python 3 points4 points ago

Agreed, as a full IDE it is the best i have tried. There are those who will swear by light weight ones, but really its about productivity and making programming easier.

[–]masklinn 2 points3 points ago

Setting up a project bothers me for the small stuff (pair of files, utility libraries) and emacs + python-mode + bicycle is quite good. But yeah, for bigger projects with tens of classes and hundreds of functions&methods pycharm is invaluable.

[–]anonymous_hero 2 points3 points ago

Yeah setting up a "project" for some little thing is bothersome. Maybe there's a reason, but I can't see why everything has to happen in terms of "projects".

But yes, when doing Real Work, nothing beats PyCharm.

[–]masklinn 1 point2 points ago

Maybe there's a reason, but I can't see why everything has to happen in terms of "projects".

PyCharm needs things like the scope of its static analysis and has a bunch of project-specific configuration possible, that's what the project is (and is for) in terms of PyCharm/IntelliJ.

[–]anonymous_hero 1 point2 points ago

I know the idea, but it's just that why couldn't either IDE handle everything in terms of directories?

You open a directory and start editing files in it. That's your "project" right there.

If the directory (or any subdir) contains a file that ends in .py, it's probably a Python source file. A directory called "src" is likely to contain source code. *.java are prooobably Java source files.

Same thing with HTML, CSS, whatever. If there's a file called "pom.xml", it means the project is bloated and "enterprisey", and so on. You get the idea.

The IDE could just keep track of settings "attached" to any full directory path that was opened at some point, and re-load the settings when the same path is opened again.

Or maybe there's something I don't know of, that forces them to make everything a "project".

[–]kylotan 0 points1 point ago

I know the idea, but it's just that why couldn't either IDE handle everything in terms of directories? You open a directory and start editing files in it. That's your "project" right there.

That is pretty much how it works. It then just calls that directory a project, and puts all its project-stuff in a subdirectory of that.

[–]anonymous_hero 0 points1 point ago

That is pretty much how it works. It then just calls that directory a project, and puts all its project-stuff in a subdirectory of that.

Well now that you mention it, I did find a menu item called "Open Directory..", and it did behave like that. So.. problem solved, I guess. But this must be a new thing.

Before, we had to go through a project wizard whenever we wanted to edit any source files.

[–]bobx11 1 point2 points ago

Drag a folder into the PyCharm app icon - it will just open the folder. sound of wind chimes

[–]codewarrior0(shape=(16,16,128), dtype='uint8') 2 points3 points ago

Nobody mentioned PyCharm's type inference and static analysis? Those are the two big features that set it apart from any "plain text editor".

[–]anonymous_hero 1 point2 points ago

Not to mention how it helps with refactoring and navigating around your codebase. Invaluable.

[–]bobx11 1 point2 points ago

Yesssssss template autocomplete rules my world.

[–]emergent_reasons 0 points1 point ago

I love PyCharm but I've never used it on a notebook. I did use RubyMine on a notebook and it ate up the battery like nothing else, even with power saving mode on. Does anyone know if PyCharm does any better than RubyMine?

Because of the RubyMine issue, I ended up using Sublime Text 2 which is also excellent, but I miss the work that JetBrains does behind the scenes.

[–]noreallyimthepope 2 points3 points ago

It isn't my impression that they have been stingy with your processor cycles.

[–]anonymous_hero 0 points1 point ago

I miss the work that JetBrains does behind the scenes.

I guess stuff like that takes a lot of CPU (and by extension, power).

[–]meepmorp 0 points1 point ago

Ive heard similar complaints about IntelliJ, mostly related to disk access for the autocomplete stuff. Were you using a spinning disk or an ssd?

[–]emergent_reasons 0 points1 point ago

spinning disk. Forgot to mention it was their static (I believe) build for linux. May be related to that as well.

[–]tombatron 1 point2 points ago

PyCharm is great especially for those of us coming from the .NET world and are used to having our "hand held" by the IDE.

[–]HalfRations 0 points1 point ago

I was excited until I read "30 day free trial for windows!" at which point I closed the website and moved on.

[–]codewarrior0(shape=(16,16,128), dtype='uint8') 1 point2 points ago

Because all software should be free, and programmers don't have to eat because they already have plenty of bytes.

[–]HalfRations 0 points1 point ago

I think given the spirit of python the IDE should be free. There are plenty of IDEs that do multiple languages including python and I can justify paying for one of those.

[–]pnpbios 0 points1 point ago

You get what you pay for. Vim is cool and all until you need to re-factor across an entire project. You aren't just paying for copy paste and syntax hi-lighting, you are paying for auto complete, refactoring, and other enterprisey stuff.

[–]__juju__ 3 points4 points ago

i use vim for python, and all the rest...

[–]unluckyfool 4 points5 points ago

I'm quite fond of Kate.

[–]RalphMacchio 3 points4 points ago

Here is a comparison of the programming features of dozens of text editors. When I was choosing an editor, I tested several free ones (and a few trial version of paid ones) and chose the text editor that I preferred. I work with OS X and Linux, but do the actual coding of my major projects on OS X. I ended up choosing TextWrangler. I really enjoy working with it for a variety of uses.

[–]kuramanga 6 points7 points ago

Emacs

[–]stummj 4 points5 points ago

Vim.

But, I think that one of the most important "features" of a programming language as simple as Python is its independence of some text editor. This is why there are a lot of different editors in comments and that is wonderful! People can be very productive with vim, emacs, gedit, kate, eric, idle, komodo, pycharm, eclipse, textmate, notepad++, etc.

[–]PalermoJohn 1 point2 points ago

Today I realized why the editor is called IDLE. Slowpoke...

[–]stummj 1 point2 points ago

While typing Eric in the comment above, the Idle editor naturally appeared in my mind. :-)

[–]rogcg 2 points3 points ago

pydev

[–]backpack 2 points3 points ago

SciTE

[–]Gerjj 1 point2 points ago

PyScripter's pretty awesome

[–][deleted] ago

[deleted]

[–]roger_ 1 point2 points ago

Disappointed that this isn't more popular.

[–]alic3 2 points3 points ago

The best one I have come across is jedit.

[–]willvarfar 1 point2 points ago

You have to edit the python settings so spaces-based soft tabs indentation etc; other than that, and especially with its rectangular selection, git-supporting project viewer plugin and the jdiff plugin etc, it rules :)

I've been a happy jedit user for 12 years now.

[–]LeonBo 2 points3 points ago

Vim / sublime 2

[–]DavidBurnward 0 points1 point ago

Butterflies

[–]SoupdupGent 2 points3 points ago

I use eclipse with the pydev environment at work, but that's mostly because I'm swapping between Python and C and CVS.

[–]jsnk 0 points1 point ago

I am not trying to hijack the thread, but I also began learning Python today to work with SciPy. I also had a similar question in mind.

I used to code a lot with Ruby on TextMate. Does anyone know if TextMate is good with Python as well?

[–]ijuggle534 7 points8 points ago

If your main interest is with SciPy, have you tried Spyder? If you're on windows you can try Python(x,y) which comes with a full python environment as well as Spyder.

Spyder is nice with matplotlib and the variable inspector; especially if you're coming form a Matlab background.

[–]gangleflops 4 points5 points ago

I use TextMate all the time for Python: I don't actually use any add-ons apart from the stock Python mode, and can't say I feel I'm missing anything.

I've tried all sort before (vim - still my default editor in the terminal, emacs, komodo, wing, ...), but the simplicity of TextMate, plus its suitability to other languages I tend to work on at the same time (HTML, CSS, JavaScript) means I always come back to it.

[–]stiggz 1 point2 points ago

vi for unix / mac, notepad++ for windows- although i tend to export to windows whenever possible to use notepad++ instead of vi, a bit easier when you can use the mouse

[–]the_merk -1 points0 points ago

why vi over vim?

[–]stiggz 0 points1 point ago

I dunno, just started with vi in school so the commands are a bit more intuitive to me. vim and vi are very closely related, most people never need the extra functionality of vim

[–]burito 0 points1 point ago

vim user here, but I can hazard a guess that stiggz chooses vi -- for proliferation reasons.

vi is everywhere, where as vim is only almost everywhere, and for many OS's requires installation. I've never seen an OS that didn't have vi by default.

Well, there is that one vendor, but that's another flame war.

[–]the_merk 1 point2 points ago

yeah, i know that vi is everywhere. particularly with linux though, vim is a few keystrokes away and has some pretty fantastic benefits (it is improved..). even if it does require a simple install for mac, is there nothing compelling enough to install it? unless working with a lot of barebones systems instead of on his own box.

[–]burito 0 points1 point ago

I've been required to work on servers that I do not have admin for, and the admin refuses to install anything. vi is always there.

[–]the_merk 1 point2 points ago

not sure why your other comment was downvoted. that's a pretty solid reason to use vi. i was only asking because it sounded more like "what's your preferred day-to-day editor," in which case it's what you use on your own machine or when working on your won projects.

[–]burito 1 point2 points ago

Probably because I invoked MS... even though I invoked it in the name of not starting a flame war :-)

[–]razzmataz 0 points1 point ago

I use a mix of vim and Komodo edit, used to use emacs alot, and dabbled with sam for a while.

[–]cool_geek 0 points1 point ago

Spyder and Pycharm

[–]servercobra 0 points1 point ago

Kate/KDevelop. Simple and doesn't get in my way. And has a terminal at the bottom.

[–]FermiAnyon 0 points1 point ago

I like gedit or kate and I just ALT+TAB between that and my terminal window where I execute.

I also really love the python shell. It's a super quick and dirty way of getting something simple working. Then you can copy your history to a text editor and crop out the parts that don't contribute to your solution.

I'm going to have to try out a lot of these other suggestions :)

[–]skintigh 1 point2 points ago

I am apparently the only person on Reddit who uses notepad++. Maybe I should check out some of the others, but I have to say I prefer it over emacs.

[–]sibsibsibweb developer 0 points1 point ago

right now, sublime with sublimelinter and some other stuff added on.

[–]aclark 1 point2 points ago

Vi

[–][deleted] 0 points1 point ago

In my office, 1x PyDev 1x PyCharm 8x Emacs.

[–]TomP 1 point2 points ago

Vim

[–]deadwisdom 0 points1 point ago

TextMate. Why has this not been said yet? Weird sample bias going on around here, because I know for a fact that it's intensely popular.

[–]_Mark_ 1 point2 points ago

You mean the sample bias that even most glorious app ever, if it's MacOS only, just isn't going to be that popular overall? :-)

Alternatively, any editor thread is mostly going to bring out emacs and vi people, with occasional singleton responses from other users - because it's kind of distinctive among the vi and emacs communities that an editor actually is something you should be opinionated about - for everyone else it's Just A Thing...

[–]14dominoDjango Ninja 0 points1 point ago

Pretty much every Mac coder I know uses Textmate, and for some reason everyone in the startup community thinks it's cool to use a Mac or something for development, even though Linux computers are closer to their deploy environments and about 1000 bucks cheaper. Then again, I'm also using a Mac for coding. :P

[–]deadwisdom 0 points1 point ago

I was talking to some folks, also in the startup community actually, and mentioned exactly what you said. They countered that with all the configuration and shit that you have to deal with building your software, the last thing you want to have to deal with is your operating system.

[–]14dominoDjango Ninja 0 points1 point ago

I'm in the startup community myself and we all have macs. Definitely good hardware and OS, but sometimes things require extra steps even with configuration (see for example configuring MySQLdb for Python -- you need the Python from python.org, and if your MySQL architecture doesn't match up, you have to do some 'lipo' to make the package not throw an import error -- we've seen similar things for some other packages as well). It would be nice to have the development environments match up exactly.

[–]deadwisdom 0 points1 point ago

This is quite true. I have the advantage of being able to use SQLite instead of MySQL while developing. I do wish Apple would support us a bit better by having good resources for posix development like they do for objective-c dev.

[–]rchaudharyPythonWeekly.com 0 points1 point ago

You can also check What’s your favorite Python editor? poll which was done recently.

[–]btanaka 0 points1 point ago

Vim / PyCharm

[–]idle_guru 1 point2 points ago

I use IdleX for my Python development. It fixes several problems with the standard IDLE distribution.

[–]dacjamesfrom reddit import knowledge 0 points1 point ago

I use Notepad++ mostly, vim when I'm on a terminal. Lately I've been trying out Ninja IDE as a free alternative to PyCharm or WingIDE.

[–]DavidBurnward -1 points0 points ago

The Gauntlett, My own text editor written entirely in python, no syntax highlighting yet

[–]PrintStar 2 points3 points ago

Sounds pretty cool! Tell us more about it!

[–]__juju__ -1 points0 points ago

i use vim for python, and all the rest...

[–]r4nf -1 points0 points ago

I recently switched to Mac and am still trying to find the perfect editor. Recently I've grown fond of Coda, which seems to be clean, easy to use, and packing a bunch of useful features.

[–]meloveyoulongtime 0 points1 point ago

Try pycharm

[–]r4nf 0 points1 point ago

I really like the looks of this. I'll definitely take it for a trial run!

[–]Ozob 1 point2 points ago

[–]r4nf 0 points1 point ago

I've tried it, but Vim is not for me. In the past I was a happy emacs user, but I've come to learn that I simply prefer more "GUI-oriented" applications (and I know this is an unpopular opinion), even if they do to some extent inhibit productivity — and overall it's more important to me that I feel good in an environment than that I put out lines of code faster.

[–]Ozob 1 point2 points ago

it's more important to me that I feel good in an environment

I agree, this is easily the most important thing. I love vim, but it's not for everyone. Good luck with Coda or whatever you settle on.