Python on a MacBook Pro (not my machine)

Cameron Simpson cs at zip.com.au
Sun Oct 27 23:56:09 EDT 2013


On 26Oct2013 12:07, John Ladasky <john_ladasky at sbcglobal.net> wrote:
> My side job as a Python tutor continues to grow.  In two weeks, I will start working with a high-school student who owns a MacBook Pro.  
> 
> I have had students with Linux systems (my preference) and Windows systems before, but not Macs.  On my first visit, I set up each student's computer with Python 3.x, and SciTE for editing.  I would like to do something similar for my Mac student, and I want to make sure that it goes smoothly.
> 
> My first question is whether Mac OS X ships with Python 2.x, and whether I need to be aware of any compatibility issues when I install 3.x.  (It's 2013, and my students are new to programming.  I refuse to hitch them to Python 2.)

MacOSX ships with Python 2.x. My Mountain Lion macbook here has
2.7.2 as /usr/bin/python.

I install MacPorts on my Macs (alternatives include Fink and HomeBrew,
and I belive you can install them side by side; Fink uses /sw,
MacPorts /opt/local and I haven't tried HomeBrew).

I have /opt/local/bin in my $PATH ahead of /usr/bin, so it finds the MacPorts
"python" (2.7.5) and "python3.2" (3.2.5) and "python3.3" (3.3.2).

> Second: it doesn't look like I will be able to obtain SciTE for this student.  SciTE is free for Windows and Linux.  Apparently, it's $42 for Mac OSX?  If I recall, SciTE is open-source, so I suppose that I could compile the source myself.  But since it is not my computer, and I'm being paid for my time, and I haven't done much with Macs (to say nothing of building from source code), I don't think that this is appropriate.

Building from source for most projects is much like Linux or any
other UNIX system.

  configure --prefix=/usr/local    # or --prefix=/usr/local/app-version, my personal preference
  make && make install && echo OK

You will need a compiler (your student needs XCode installed if
they haven't already; it is free). MacPorts needs XCode anyway, as
do the others.

> I know, we can use IDLE.  I continue to find IDLE clumsy.  Also, there are potential issues with event handling which arise when you use IDLE.  I am working with an adult professional who is developing a Telnet application, which refuses to cooperate with IDLE/Tk.  I had similar issues myself with wxPython applications I was writing.  While these issues may not affect a beginning student, these experiences have informed my choices.
> 
> So, what other free and lightweight editing options do I have for a Mac?  I have found a few (fairly old) discussions on comp.lang.python which suggest Eric (http://eric-ide.python-projects.org/) and Editra (http://editra.org/).  Opinions on these and other choices are appreciated.

Personally, I use terminals (iTerm2 on a Mac in preference to
MacOSX's terminal, with a shell pane beside the editor pane) and
vim with syntax highlighting. And a web browser open on a local
copy of the 2.x or 3.x HTML docs - I keep one of each on my desktop
for easy access.

I'm not an IDE person, so I can't speak to those (even IDLE).

Cheers,
-- 
Cameron Simpson <cs at zip.com.au>

You want to tempt the wrath of the whatever from high atop the thing?
- Toby Zeigler, _The_West_Wing_ - Election Night



More information about the Python-list mailing list