Not into Python? Prefer Ruby instead? Here are the most popular editors and IDEs for Rubyists.
So, you’ve decided to learn Python? Great! Python is a really interesting programming language, that has been described as a descendent of ABC that appeals to Unix/C developers. And you can’t go wrong with a language named after Monty Python!
So yes, you have many exciting things waiting for you.
There are now 'web-based' installers for Windows platforms; the installer will download the needed software components at installation time. There are redistributable zip files containing the Windows builds, making it easy to redistribute Python as part of another software package.
Download Python Code Writing Software Free For Windows 7
But one of the first things you’ll need to do is pick an editor you’ll use to write your Python program. Well, here comes the confusion. You’re faced with tons of editors out there, each with a community trying to get you attracted to using that editor. “Use vim!” “Use Emacs!” “Use Sublime Text!”
You recoil in fear… what if you make the wrong choice?
This feeling inspired me to interview Pythonists about their favorite Python editor. This will show which editors are used by the most Pythonists, and from there we can try to work out why. My hope is that it’ll serve as a guide for newcomers to Python, or even for those already working with Python.
I’ll start by discussing the most popular editors, then take a look at the advantages (and disadvantages) of the winner, before moving on to looking at how to install it onto your system.
The Survey
I spoke to 100 Pythonists, who brought up the following editors (presented here in order of popularity):
- Sublime Text
- Vim
- Emacs
- Notepad++
- TextWrangler
- IDLE
- Atom
- Aquamacs
- GNU Nano
- Kate
- gedit
Sublime Text was by far the most preferred editor, used by 45% of the interviewees. The charts below tell the tale:
From the figures above, we can see Sublime Text rules as the favorite Python editor from the sample I have interviewed. This seems to go hand in hand with Sublime Text’s slogan: The text editor you’ll fall in love with.
Python 3 Download For Windows
Sublime Text’s Advantages
So what makes Sublime Text so special?
Like others, I use Sublime for my Python work. I like the features mentioned in this post about Sublime Text. Briefly, these are:
Packages: Sublime Text comes with a fully-featured package manager that helps the programmer to discover, install, update, and remove packages for Sublime Text.
Macros: Instead of retyping simple strings of text, you can simply record macros and create a keyboard shortcut to output that text into your document.
Colors: In Sublime Text, you can quickly pick colors for the interface and text.
Other useful features for Sublime Text, as mentioned in this SitePoint Smackdown post, are as follows:
Comprehensive language support with TextMate-compatible grammar
“Goto Anything” quick navigation to locate files and code
A command palette to access all features
Extensive customization, great themes and numerous plugins
Sublime Text’s Shortcomings
However, Sublime Text still needs some improvements to become a better editor for Python.
Here are some ways Sublime Text could be improved to work better with Python:
In Sublime Text, some deep language specific integration features such as static analysis and refactoring, also available through plugins, are not that polished.
Dynamic analysis of code and autocomplete need to be enhanced.
Sublime Text could be made more friendly to new Python programmers. For example, if one needs to configure the application’s preferences, this is done by writing/editing lines of code. This is something a new programmer may feel uncomfortable attempting.
As a continuation to the previous point, Sublime Text needs to be simplified a bit, as it has a steep learning curve, and plugins need to be simplified, since they can be confusing.
While the app can be equipped with impressive features, these have to be installed separately, and some of them are not free.
Sublime Text is inaccessible via the terminal.
How to Set Up Sublime Text for Python
So, you want to give it a try? In this section, I’ll show you how to setup Sublime Text to work with Python. I will be demonstrating this on a Microsoft Windows 8.1 machine. If you want to do that on a MAC OS X machine, you can follow this tutorial, and on an Ubuntu machine, you can refer to this thread.
Let’s get started.
Installing Python
Download Python from here. I will download Python 3.4.2. This will be an msi
file. Thus, the file you will get downloaded is python-3.4.2.msi
. Run the installer, for which it will display the wizard shown in the figure below:
Navigate through the steps until you finish the setup wizard. You’ll notice that Python was installed in C:Python34
, if you kept the default location.
Installing Cygwin
The next step is to setup Cygwin, a tool for providing Windows with similar functionality to a Linux distribution. If you’re on a 32-bit Windows, download the setup file from here. If you are on a 64-bit Windows, download the setup file from here. After you download the appropriate setup file, run that file, for which you will get the following start page in the wizard:
Keep navigating through the installer until you reach the following step:
In this step, we’ll be installing three software packages: curl
, git
, and openssh
. For this, let’s use the Search
box. For example, for curl
, type the word in the search box, but, be careful, don’t hit the enter key, as this will continue the Cygwin installation. When you type curl
in the search box, you should get something like the following:
What we want to do now is install each of the packages above. Click on the +
sign. You will notice skip
, click on skip
, so you get the latest version number of the package, which we want to install. In this case, you should get something similar to the following:
Click the Next
button, and wait until the packages are downloaded. This might take some time to finish.
Do the same for the other two packages, git
and openssh
.
After you finish, you should get a Cygwin shortcut at your desktop, like this:
Through this terminal, you’ll be running your Python code, in addition to accessing the packages installed above. If you double click the icon shortcut, you should get something like the below image:
To make sure that the packages were installed, and get an idea of their locations, we will use the which
command, as follows:
I was able to install Python through Cygwin using the following step (notice ‘Python’ at the end):
If you happen to miss this step, or you want Cygwin to find and use the Python version you installed above, you can issue this command in the terminal:
Installing Sublime Text
Now, for the easiest part. To install Sublime Text, go to the Sublime Text homepage, download, and set it up. Very easy!
Test Your Installation
At this point of the tutorial, let’s test if our setup works, and we’re ready to use Sublime Text to work with Python.
Open Sublime Text, and type this line of code:
Choose File -> Save
. In the Save As
dialog box, choose where to save the file, name the file, and in Save as type:
, choose Python. For instance, this is what I chose:
Now, open the terminal (Cygwin icon shortcut), and navigate to where you saved your Python file. In my case, it was on the Desktop
. In my case, the file path would like like the following:
Finally, type the following command in the terminal to run the Python program:
In which case, you should get the following output:
You now have everything setup, and ready to delve through the Python world with Sublime Text! One of the first things you should do now is check out this collection of plugins for Python development with Sublime Text.
Conclusion
While Sublime Text has a commanding lead in numbers, that’s but one consideration. There are many popular editors, and it may not be right for every Pythonist. Nevertheless, it’s always good to know how the majority handle their projects, and there is something to be said for using a popular app or technology.
What is your favorite Python editor? How do you set it up for working productively?
Teletype for Atom
Great things happen when developers work together—from teaching and sharing knowledge to building better software. Teletype for Atom makes collaborating on code just as easy as it is to code alone, right from your editor.
Share your workspace and edit code together in real time. To start collaborating, open Teletype in Atom and install the package.
GitHub for Atom
A text editor is at the core of a developer’s toolbox, but it doesn't usually work alone. Work with Git and GitHub directly from Atom with the GitHub package.
Create new branches, stage and commit, push and pull, resolve merge conflicts, view pull requests and more—all from within your editor. The GitHub package is already bundled with Atom, so you're ready to go!
Everything you would expect
Cross-platform editing
Atom works across operating systems. Use it on OS X, Windows, or Linux.
Built-in package manager
Search for and install new packages or create your own right from Atom.
Smart autocompletion
Atom helps you write code faster with a smart and flexible autocomplete.
File system browser
Easily browse and open a single file, a whole project, or multiple projects in one window.
Multiple panes
Split your Atom interface into multiple panes to compare and edit code across files.
Find and replace
Find, preview, and replace text as you type in a file or across all your projects.
Make it your editor
Packages
Choose from thousands of open source packages that add new features and functionality to Atom, or build a package from scratch and publish it for everyone else to use.
Themes
Atom comes pre-installed with four UI and eight syntax themes in both dark and light colors. Can't find what you're looking for? Install themes created by the Atom community or create your own.
Customization
It's easy to customize and style Atom. Tweak the look and feel of your UI with CSS/Less, and add major features with HTML and JavaScript.
See how to set up Atom
Under the hood
Atom is a desktop application built with HTML, JavaScript, CSS, and Node.js integration. It runs on Electron, a framework for building cross platform apps using web technologies.
Open source
Atom is open source. Be part of the Atom community or help improve your favorite text editor.
Keep in touch
GitHub | github.com/atom |
@AtomEditor | |
Chat | Slack |
Forum | Discuss |
Stuff | Atom Gear |
RSS Feed | Packages & Themes |