Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking for a text editor for programming in Python, preferably one which is easy to learn for beginners.

share|improve this question

closed as primarily opinion-based by Seth, Braiam, Mahesh, mikewhatever, blade19899 Jan 13 '14 at 20:41

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

    
A similar question you should check out is - ubuntu.stackexchange.com/questions/4246/… – Nikhil Oct 1 '10 at 10:17
    
See also: text editors for PHP and text editors for Ruby on Rails. There will be a lot of overlap here. This should probably be a community wiki. – dv3500ea Nov 2 '10 at 16:38
    
Did you specifically want an editor for Python, or just a good text editor? You might want to clarify that, because there are plenty of good Python IDEs, and lots of good text editors that are not Python-specific. – InkBlend Mar 28 '13 at 19:01
    
Another similar question, what IDEs sare available for Ubuntu – Suhaib Mar 31 '13 at 17:38

31 Answers 31

up vote 70 down vote accepted

Geany alt text

Geany is a lightweight IDE that supports python.

Some features that I have found particularly useful include:

  • Syntax highlighting
  • Automatic indenting - especially useful for python
  • Code folding, allowing you to hide parts of your code
  • Inbuilt syntax checking and execution
  • Symbol browser
  • Embedded terminal
  • Find and replace with regexp support

alt text

share|improve this answer
    
It's too bad theming Geany is almost as easy as solving pi. – Chris K Dec 8 '14 at 0:11
    
Any time I resize the Geany window, I get weird graphical errors/glitches in the text. I have no idea why. – jocull Apr 26 at 15:55
    
It would be great to get some comparison to TextMate because Geany seems to be the leading editor there. – Masi May 30 at 18:35

Vim Install GVim

I think Vim is amazing!

Vim is a highly configurable text editor built to enable efficient text editing. It is an improved version of the vi editor distributed with most UNIX systems.

Although Vim was originally released for the Amiga, Vim has since been developed to be cross-platform, supporting many other platforms. It is the most popular editor amongst Linux Journal readers.

Vim is free and open source software and is released under a license which includes some charityware clauses, encouraging users who enjoy the software to consider donating to children in Uganda. The license is compatible with the GNU General Public License.

alt text

share|improve this answer
21  
Vim is extraordinarily powerful. But it has a nontrivial learning curve, since it's so different from all other editors. The time investment will pay off, but people should know that they'll need a few days/weeks to get proficient in vim. – Marius Gedminas Nov 3 '10 at 11:38
4  
Vim is the bomb. Learn to use this editor, it's worth it. – oadams Nov 18 '10 at 9:07
3  
Great article about vim: stevelosh.com/blog/2010/09/coming-home-to-vim – user3798 Nov 18 '10 at 22:28
4  
@DrKenobi: it should be pointed out that the default vim installed on ubuntu is a reduced version (vim-tiny), and that for a GUI version the user should install vim-gnome or vim-gtk, that seems to be identical. – enzotib May 22 '11 at 13:12
1  
It is vim.tiny if you want to execute it. – Martin Ueding Oct 11 '11 at 15:48

I really have to add Sublime Text 2 to the list because it's simply amazing. It's the best TextMate alternative for Linux.

It has way too many features to write the all here, but to name just a few:

  • a sidebar for projects or files and Chrome-style tabs as well as multi-pane editing which includes horizontal, vertical and even a quad pane mode
  • "Goto Anything": press Ctrl+P and type something - this will search in both filenames and lines of code across currently open files as well as recently close files. Start your search by using "#" to go to that word line, "@" for symbol or ":" for line
  • minimap which shows you an an overview of your files
  • macros, various find tools (find in files, find in open files, incremental find), easily switch between project, multiple selection, autocomplete and lots more.

enter image description here

share|improve this answer
    
Sublime 2 is Vim compatible as well - which makes it more awesome. – Adhip Gupta Oct 11 '11 at 16:08
    
There's a Sublime Text 3 out now, and it's even more awesome! – rvighne Mar 30 '14 at 22:36
    
Unfortunately, Sublime Text is an editor that doesn't work on armhf architecture. – henrywright Aug 30 '15 at 11:49
    
My favorite feature of this editor is multiple-cursors, and real-time regex highlighting. Its so powerful to see every highlight of a regular expression in a file, select every occurrence of that highlight and then bend the selections to my will with the command palette, text transforms, world snapped selection jumps, relative cursor goodness. Though I've become quite annoyed at certain details over time too, there build in for selecting next occurrence of a selection doesn't match the next variable highlighted (which is only really a problem if variables have single letter names.) – ThorSummoner Sep 23 '15 at 17:51

Gedit install gedit

Gedit is a simple but useful text editor that supports syntax highlighting for python. It doesn't have many features out of the box, but is very simple to use. It can be extended with plugins. There is a set of plugins that can be installed from the gedit-plugins package.

gedit

share|improve this answer
2  
Really need a package link for default software? Doesn't do any harm but it made me lol. – Oli Nov 2 '10 at 23:43
6  
I suppose it could be useful for people on Kubuntu :P – dv3500ea Nov 3 '10 at 21:00
    
Don't forget to disable the 'file browser' plugin. I'll make loading docs extra snappy. – Evan Plaice Feb 16 '11 at 9:37
    
@dv3500ea: They might use Kate though. – Martin Ueding Aug 11 '11 at 9:46
    
Does gEdit have "open project folder" functionality? – henrywright Aug 30 '15 at 11:50

For a simple but powerful text editor I like SciTE. It has a great many language options and is cross-platform. Notepad++ was developed from the SciTE codebase, so it's a good start point if you're migrating from Windows / Notepad++.

scite screenshot with language drop down

share|improve this answer

Why don't you use eclipse?.. There is an python extension for eclipse.

Features include:

  • Django integration
  • Code completion
  • Code completion with auto import
  • Syntax highlighting
  • Code analysis
  • Go to definition
  • Refactoring
  • Mark occurrences
  • Debugger
  • Remote debugger
  • Tokens browser
  • Interactive console
  • and many others:


    Check this url: http://pydev.org/manual_101_install.html

  • share|improve this answer
    1  
    +1 I was really impressed with PyDev. I would probably use it if I couldn't get all the features I wanted with Emacs. – vhallac Dec 29 '11 at 11:07
        
    +1 These days if you're using a text editor for any substantial dev you're doing it wrong. The list above is a great indication of the benefits of using a full featured IDE. – Alb Jan 14 '12 at 15:40
        
    +1, if you also get the Eclipse Software Center from the default repositories in Eclipse, you can install PyDev from there. – Nicholos Tyler Jan 18 '12 at 0:13
    4  
    It's too heavy :( – Akash Shende Feb 25 '14 at 18:41
    1  
    I don't use Eclipse because it's extremely slow. I'm not so surprised as I'm never satisfied with JVMs' performances, it makes me delete anything Java related to my computer (seriously). – MasterMastic Aug 3 '14 at 7:11

    My choice is Kate. Is a KDE application, so a bunch of dependencies will also be installed if you are using Gnome.

    kate Install kate

    alt text

    http://en.wikipedia.org/wiki/File:Kate3.png

    share|improve this answer
        
    I vote for Kate. A natural way for ordinary (not thinking in Lisp :-]) people (IMHO), looks nice, pretty configurable (including some exclusive features I like a lot). although I use Gnome, I couldn't find reasonable alternatives to these 2 KDE apps: Kate and Krusader. – Ivan Jan 15 '11 at 16:12
        
    By the way, @lovinglinux, a toolbar there on your screenshot looks pretty gnomish. How have you achieved that? – Ivan Jan 15 '11 at 16:14
        
    @Ivan, is the QTCurve widget style. – lovinglinux Jan 15 '11 at 16:26
    1  
    If you want Eclipse-like multi-file editing, enable the Project plugin and create a project file. Kate will then automatically list files checked in to version control, and you can switch to them quickly by pressing Ctrl-Alt-O. – z0r Jan 2 '14 at 6:55

    Vim

    one of the classic text-editors, cross-platform, and a fan favorite of programming gurus. A slight learning curve, but once you catch on, and see how powerful it can be you'll never turn back.

    enter image description here


    There's a bunch of plugins available that'll have you setup in a full-fledged Rails IDE in no time: CLICK HERE

    share|improve this answer
    2  
    +1 for vim/gVim here is another guide to make vim as RoR IDE biodegradablegeek.com/2007/12/… – Rojan Sep 7 '10 at 15:29

    Go with Emacs, it has a solid Python mode. You don't need anything too fancy anyway. Instead of using a class browser, it helps to use a web browser or to read through the manual for whatever modules you're using.

    share|improve this answer
        
    +1 emacs rules. Steep learning curve, most powerful editor. – psusi Mar 17 '11 at 13:31
        
    Don't get me wrong, I love emacs, and try to use it for everything. But it is probably the hardest editor to learn. The first time I ran it, I couldn't even quit from it, and had to kill it from another shell. :) – vhallac Dec 29 '11 at 11:05
    1  
    @vhallac: Emacs certainly has a steep learning curve, but when it comes to difficulty in learning the championship cup definitely goes to vi/vim! – haziz May 4 '12 at 17:13
        
    @vhallac That is so hilarious. I had the same experience, I killed it via htop. :D – henry Feb 1 '14 at 16:56

    Redcar

    screenshoot

    Found it advertised on StackOverflow. Open source, cross-platform, looks/feels/works like TextMate. It even supports TextMate bundles, and comes with TextMate themes! It has a project file browser, and a bunch of other features. Read the installation instructions and then:

    sudo gem install redcar
    redcar install
    

    NOTE: it's under development

    share|improve this answer
        
    Link is broken in the body. – Masi May 30 at 17:42

    Nano

    If you want to familiarize yourself with the Command Line interface (CLI) in the terminal, I would suggest Nano. It is a very flexible and further more it is already pre-installed in the GNOME terminal.

    To access Nano:

    1. Bring up the GNOME terminal.
    2. Type nano in the terminal.

      $ nano

    3. Voila, you are in nano!

    It is rather daunting at first but it is useful if you are a system administrator and it will useful in situation where the is no graphical interfaces.

    share|improve this answer
        
    Was looking for light one, this is best fit. – Err Hunter Sep 18 '14 at 3:30

    Scribes Install scribes

    screenshoot

    Scribes is designed to make you more productive Simple, slim and sleek, yet powerful.

    Features include:

    • Extensible via Python plugins
    • Remote editing (ftp, sftp, ssh, samba, webdav, webdavs)
    • Snippets! Watch the flash demo.
    • Automatic word completion
    • Automatic correction and replacement
    • Automatic pair character completion and smart insertion
    • Automatic indentation
    • Powerful text processing and manipulation functions
    • Bookmarks and smart navigation
    • Document Switcher
    • Syntax colors for over 30 languages
    • and much more...

    Install

    sudo apt-get install scribes

    Or The latest version of Scribes can be installed using the following official PPA: -

    sudo add-apt-repository ppa:mystilleef/scribes-daily
    sudo apt-get update && sudo apt-get install scribes
    
    share|improve this answer

    I use Gedit with Gmate plugin. It's lightweight and fast solution. I think it enables you to use much of the TextMate's features.

    Just download source and run install.sh script.

    share|improve this answer

    Try Geany. It has built in support for Ruby and has the features you want. It is designed to have the features of an IDE while remaining lightweight.

    Geany is a small and lightweight Integrated Development Environment. It was developed to provide a small and fast IDE, which has only a few dependencies from other packages. Another goal was to be as independent as possible from a special Desktop Environment like KDE or GNOME - Geany only requires the GTK2 runtime libraries.

    To install it, including the project functionality you want, install the geany and geany-plugins packages.

    share|improve this answer
        
    +1 On Geany - I use it for all my scripting needs: Ruby, Perl, Python, PHP, Java. Light weight with the features that need to be there to make me efficient. – Marco Ceppi Sep 7 '10 at 12:28
        
    Geany has no support for remote locations. You can't create or delete files from the file-pane. There is no tree in the file-browser, you can only view one directory at the same time. No code completition templates. It has more buttons than gEdit, yet does less. – Ralf Sep 7 '10 at 12:48
        
    When did @Andrew ask for any of these features you mention? Geany has all of the features that he asked for and all of the features that I like to have. There is a tree view in the 'Documents' tab of the side pane which groups open files under their folders. I use the inbuilt terminal for most of my file management anyway. It has code completion - I don't know what a code completion template is. Like in Gedit, features can be added via plugins. Just because it lacks some features you like, doesn't mean it is bad. – dv3500ea Sep 7 '10 at 13:09
        
    I'm just giving some possible disadvantages of Geany. And if choosing something else than what's already installed by default expect some advantages, right? – Ralf Sep 7 '10 at 13:16
        
    I agree that Gedit is a good editor and I used it for a long time but changed to Geany because it has more advanced features including: more find/replace options, code folding and the ability to compile/build/execute with a click of a button or a press of 1 key. There are more features but I don't want to list them all. – dv3500ea Sep 7 '10 at 13:27

    gEdit all the way.

    • It's one of the few editors that actually works with remote locations. No other editor I know supports ssh locations defined as Nautilus bookmarks.

    • It blends in to your desktop nicely. All these crossplatform editors are XUL or Java based and often have horrible font rendering.

    • It has a file pane at the left (press F9)

    • It has syntax support for all ruby files

    • It supports the most common keyboard shortcuts. The ones you are already expecting to work.

    • There are plugins out there for code-completition.

    • There are plugins out there for revision-control. (at least Bazaar, i'm not sure about git)

    • There is a console plugin. But I usually just open a terminal on another desktop, and have focus follow the mouse. You could also look into stuff like quake. (which ties a dropdown terminal to the ~ key, like in Quake)

    • You can connect short-cuts to custom shell scripts, that operate in the 'main' directory. Perfect for common rake tasks.

    PS. If you don't need or want a file pane, you should take a look at Scribes. It's a textmate clone. Pretty much. Very lean, but it does integrate nicely. Supports remote locations, code templates, syntax highlighting. It's only funny quirck is that it saves as you type and it does not have a proper file-pane.

    share|improve this answer
    1  
    Gedit, Geany, Bluefish and Scite are all cross platform. None of them are use XUL or swing. They all use GTK and so intergrate well with the GNOME desktop. – dv3500ea Sep 7 '10 at 13:18
        
    Integrate well is more than just GTK. It's also about gio and gvfs, for example. Recent documents integration. Accepting stuff like the fullscreen shortcut. Being able to open nautilus for a given folder in the treeview. And i was referring to the many 'specially for rails' editors, like RadRails, that are Java (eclipse), C++ (Netbeans) or Xul based. – Ralf Sep 7 '10 at 17:45
        
    check out gedit-mate for textmate-ish features in gedit. github.com/ivyl/gedit-mate – Derek Jan 3 '11 at 12:18
        
    nearly perfect but missing good support for git, and no known working code formatter on Gnome3 – prusswan Feb 16 '12 at 3:27

    I can suggest you Komodo Edit. You can find it here: http://www.activestate.com/komodo-edit

    share|improve this answer
        
    +1 I use Komodo Edit a lot. – Nathan Osman Jan 1 '13 at 19:20

    MonoDevelop

    Image of the MonoDevelop IDE

    It was originally written as an IDE for writing C# (which it is fantastic for) but extensions have been created to extend the editor for other languages.

    Extension languages include:

    • python
    • java
    • moonlight
    • boo
    • vala

    It's also rumored that a PHP module is being worked on.

    Personally, I have used it mostly for C# and some python development (I really wish the devs would get to work on the python autocomplete fefature).

    It also has the ability to integrate plugins for database management, source control, unit testing, etc...

    While not a very 'light weight' option, it's definitely worth using.

    share|improve this answer

    Vim for everything. It is the most versatile text editor known to man IMHO. If you want a GUI text editor, I would recommend Scite. Both are in the repos of practically every distro.

    share|improve this answer
        
    I second Vim as being a great minimal powertool. But why Scite? It's just gEdit with less features. No ssh support. No gnome integration. No custom shortcuts. – Ralf Sep 7 '10 at 12:42

    I would highly recommend SublimeText2. It is very fast and has support for keyboard shortcuts. You can install lot of plugins to add new functionalities.

    share|improve this answer
        
    sublime is the best of all – pahnin Jun 26 '12 at 16:30

    All the above are great editors. I recently found this new light IDE and it is cross-platform compatible as well.

    PyCharm

    It is package for all the scripting languages. It comes in other versions as well, PHP Storm5 and WebStorm

    The PHP Storm, contains support for all the languages. Also, the beauty of this editor is that, if you are a student. You can apply for this IDE for free and not just for yourself but for unlimited users for one-year. Also, like Visual Studio it has that intellisense feature, where you get the properties and methods in the drop down.

    I am really having a lot of fun using this editor.

    share|improve this answer

    Emacs is a great text editor (plus a lot of other functions) that will serve you well in the long term. It does have a somewhat steep learning curve, but I think you will be well rewarded. Install it with:

    sudo apt-get install emacs

    I would start with the builtin emacs tutorial. It should be easily accessible from the default "buffer" that opens. It will get you started and well on your way.

    share|improve this answer

    DrPython install drpython

    DrPython is a python specific IDE written in python and I believe you can even extend it in python. Features include:

    • Syntax highlighting
    • A class browser
    • Integrated python debugger

    alt text

    share|improve this answer

    I highly recommend PowerPad. The reasons? Well...

    • It's freeware.
    • It has syntax highlighting for C++, JavaScript, Python, etc.
    • It has auto-indent and line-numbering.
    • It can work with files over FTP.
    • It supports RegEx searching (requires downloadable script)
    • It runs natively on Linux
    • It has complete documentation.
    • It embeds the Python interpreter so you can write scripts to extend the program.
    • It comes with a script manager that can download scripts others have written.

    Screenshot:

    Disclaimer: I wrote it.

    share|improve this answer
        
    is it free/open source software? – omouse Nov 2 '10 at 20:21
    3  
    @omouse: It's free, but not open source. – Nathan Osman Nov 3 '10 at 21:42
    1  
    Free? libre or gratis? – Manish Sinha Nov 18 '10 at 8:26
    1  
    @Manish-Sinha: I always ask "Free as in Beer or Free as in Freedom?" – Martin Ueding Aug 11 '11 at 9:50
    1  
    ^means it is a freeware but not a freesoftware – Tachyons Jan 1 '13 at 13:21

    Don't hate me for what I gonna said: netbeans 6.9. (download the "ruby version" to avoid other unnesesary stuff to load..)
    yes, you gonna said: but it needs java!! but, if you have +512mb, just try it, and tell me later, it's just an option more :P

    share|improve this answer

    In the interest of offering another editor option for completeness - check out Eclipse with the Aptana plugin.

    Pros

    1. It's useful if you already have Eclipse installed and you want to work on Ruby.

    2. It has all the features you asked for and more (intellisense for example)

    3. Once you grok the Eclipse interface you can be productive in a wide variety of programming languages and technologies

    Cons

    1. Eclipse is resource hungry - not for low memory machines.

    2. The user interface has a learning curve if you are not familiar with Eclipse.

    share|improve this answer

    Bluefish Editor

    From the website:

    Bluefish is a powerful editor targeted towards programmers and webdesigners, with many options to write websites, scripts and programming code. Bluefish supports many programming and markup languages, and it focuses on editing dynamic and interactive websites.

    Also, Scribes (which looks a lot like Mac OS X's Textmate).

    share|improve this answer
        
    I second Scribes. Bluefish is a bit oldskool. Buttons for HTML tags and such. – Ralf Sep 7 '10 at 12:45

    I suggest using jedit. It is one of the few editors that let you display more than one file simultaneously which I find very useful. You can also simultaneously display different parts of the same file. The only other editor that does this is kate but it doesn't seem to work with the more recent versions of ubuntu.

    share|improve this answer

    Geany is fantastic. Add snippets. Or just for python you can use spe.

    sudo apt-get install spe

    share|improve this answer

    have a look at IDE for python page. you will find what fill your need!

    share|improve this answer

    I also suggest Gedit. Check out gedit-mate for a great "set of plugins, tools, color schemes and snippets that will improve your work."

    share|improve this answer

    Not the answer you're looking for? Browse other questions tagged or ask your own question.