This is simple, and it will save you time.
First, TextWrangler is a free text editor for Macs, and it makes writing code easier. Download it from this page.
Then you should make TextWrangler the default program for all .txt and .py files. Do that with each file type. Here’s how:
Repeat for each file type.
I downloaded: ActiveTcl 8.5.11 (April 2012) because the documentation for my Python download recommended it:
“Before using IDLE or other programs using the tkinter graphical user interface toolkit, visit http://www.python.org/download/mac/tcltk/ for current information about supported and recommended versions of Tcl/Tk for this version of Python and Mac OS X.”
This download was a DMG* file that must be installed after downloading. That was easy enough. But then there’s this:
ActiveTcl executables (wish, tclsh and tkcon) are installed in /usr/local/bin. If this directory is not in the user’s PATH environment variable, it can be added manually to the .profile or .bash_ profile file in the user’s home directory. For example:
First you’ll want to download the current production version of Python.
This is the one I installed (Mac users: Look for “Mac OS” on the list on the download page):
Mac OS X 32-bit i386/PPC Installer (2.7.2) for Mac OS X 10.3 through 10.6  (sig)
There might be a different one by the time you read this. Of course, Windows users will install a Windows version.