Python by Swaroop C H - HTML preview

PLEASE NOTE: This is an HTML preview only and some elements such as links or page numbers may be incorrect.
Download the book in PDF, ePub, Kindle for a complete version.

Choosing an Editor

Before we move on to writing Python programs in source files, we need an editor to write the source files. The choice of an editor is crucial indeed. You have to choose an editor as you would choose a car you would buy. A good editor will help you write Python programs easily, making your journey more comfortable and helps you reach your destination (achieve your goal) in a much faster and safer way. One of the very basic requirements is syntax highlighting where all the different parts of your Python program are colorized so that you can see your program and visualize its running.

If you are using Windows, then I suggest that you use IDLE. IDLE does syntax highlighting and a lot more such as allowing you to run your programs within IDLE among other things. A special note: don't use Notepad - it is a bad choice because it does not do syntax highlighting and also importantly it does not support indentation of the text which is very important in our case as we will see later. Good editors such as IDLE (and also VIM) will automatically help you do this.

If you are using Linux/FreeBSD, then you have a lot of choices for an editor. If you are an experienced programmer, then you must be already using VIM or Emacs. Needless to say, these are two of the most powerful editors and you will be benefitted by using them to write your Python programs. I personally use VIM for most of my programs. If you are a beginner programmer, then you can use Kate which is one of my favorites. In case you are willing to take the time to learn VIM or Emacs, then I highly recommend that you do learn to use either of them as it will be very useful for you in the long run.

If you still want to explore other choices of an editor, see the comprehensive list of Python editors [http://www.python.org/cgi-bin/moinmoin/PythonEditors] and make your choice. You can also choose an IDE (Integrated Development Environment) for Python. See the comprehensive list of IDEs that support Python [http://www.python.org/cgi-bin/moinmoin/IntegratedDevelopmentEnvironments] for more details. Once you start writing large Python programs, IDEs can be very useful indeed.

I repeat once again, please choose a proper editor - it can make writing Python programs more fun and easy.