Python on a MacBook Pro (not my machine)


J

John Ladasky

Hi folks,

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.)

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.

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? Ihave 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.

Thanks!
 
Ad

Advertisements

C

Cameron Simpson

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,
 
J

Jim Gibson

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.

I use BBEdit (paid) and MacVim (free) for Mac editing. Bare Bones
Software has a free version of BBEdit called TextWrangler that a lot of
people use.

<http://www.barebones.com/products/bbedit/>
<http://www.barebones.com/products/textwrangler/>
<http://code.google.com/p/macvim/>
 
R

rusi

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.

Have you considered emacs?
Yeah it requires some setup to run for python. But then its a lifetime investment.

[About mac Ive no idea. As far as I know some of the current hot emacs projects are being developed by people on macs -- so it surely runs but how smoothly I wont venture]
 
R

Rick Dooling

Just upgraded to Mavericks, the new OS X, Python is:

Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(On Mountain Lion, it was 2.7.2. You can install Python 3 using Home Brew or even the packages from Python.org and run them on the same machine. Just change the shebang at the to of the script.

I recommend MacVim for editing

http://code.google.com/p/macvim/
 
R

rusi

Hi folks,
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.
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.

Just stumbled upon this
https://github.com/gabrielelanaro/emacs-for-python

Not that I would recommend it if you are not already an emacs user
 
Ad

Advertisements

J

John Ladasky

I just wanted to say thank you to everyone who posted here with recommendations for programming-friendly text editors. I will follow up on this afterI have resolved a more fundamental issue with my new student -- his Python3.3.2 interpreter segfaults and crashes on the second command! I'll starta new thread to deal with that problem.
 
C

Cameron Simpson

I just wanted to say thank you to everyone who posted here with recommendations for programming-friendly text editors. I will follow up on this after I have resolved a more fundamental issue with my new student -- his Python 3.3.2 interpreter segfaults and crashes on the second command! I'll start a new thread to deal with that problem.

I think there was some discussion of this bug with Mavericks very
recently on the list. Possibly fixed in more recent builds.

Cheers,
--
Cameron Simpson <[email protected]>

Uhlmann's Razor: When stupidity is a sufficient explanation, there is no need
to have recourse to any other.
- Michael M. Uhlmann, assistant attorney general
for legislation in the Ford Administration
 
Ad

Advertisements

J

Jake Angulo

I use a Macbook air for programming - yes it has Python 2.x in it.

For code editing i use a combination of:
1) Wing IDE 101
(from their website: "is free scaled down Python IDE designed for teaching
introductory programming classes")
2) Sublime Text
3) Good old Vi

You could try those
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top