The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

This topic is READ ONLY
Mystique (3) [Avatar] Offline
#1
Hello,

I was going to work on this myself and after I'm succesful.. with my two kids (girl 13, boy smilie.

We all have older iBooks running Leopard. They have python on them already..

Python 2.5.1 (r251:54863, Jan 13 2009, 10:26:13)
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin

minimally.. do you know which packages we need?

Like do we need the python 2.5 dmg? It looks like we need the other packages to some degree, but not being a programmer, or a python person; I'm trying to do these exercises before I get my kids going on them, and would like it to work. smilie

I know things are different on the mac.. like this is how you run IDLE:

(which is not explained in the book.. )

python -m idlelib.idle

Thanks in advance for any help.
warren.sande (211) [Avatar] Offline
#2
Re: OSX Leopard Questions..
There is a list of the packages (and links to download them) on the Installation Instructions page: http://www.manning.com/sande/Installation_Instructions.html#mac

To summarize, you need:
- Pygame,
- Numeric (required by Pygame)
- PythonCard
- wxPython (required by PythonCard)
- EasyGui (for Chapter 6)

And, optionally, SPE, a nice, cross-platform Python editor.

As for running IDLE in MacOS, I don't have access to a Mac, so wasn't able to test it. I'm surprised that IDLE doesn't have an icon in the Applications folder. But those are the kinds of things we want to know about, so we can put additional instructions and help on the web page. Please let me know how it goes and if you have any other questions.

By the way, we did have a couple reviewers test all the sample programs on MacOS, so they should all work.

Regards,
Warren Sande
Mystique (3) [Avatar] Offline
#3
Re: OSX Leopard Questions..
So after downloading the packages it seems it installs another copy of python in /usr/local/bin.

here is also what I found out,

* Pygame: that seems to have installed correctly via mac installer

* Numeric: also seems to have went well via mac installer

* PythonCard: this is where I found 2.5.1-macosx, wxPython (again) and it had a different install procedure.. [ great install page: http://pythoncard.sourceforge.net/macosx_tiger_installation.html - nothing for leopard; but works all the same ]

* wxPython: already installed on pythoncard page..

* EasyGui: found a newer version (0.87 vs the 0.83) not sure if there is a difference.. but no installer so b/c of the great install page on PythonCard I found where I need to copy the easygui.py [ /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/ ]

As for idle.. after installing the package, "things" exist in /usr/local/bin (so /usr/local/bin/idle and /usr/local/bin/python). Going through random examples I had to make sure that I was using /usr/local/bin/python if calling the script on the command line, and idle as well.

There is now a MacPython 2.5 folder in Applications which has an icon for IDLE.

smilie

Not sure if this will help or confuse anyone..

But the PythonCard page was very helpful and gave the much needed installation folder which is different than the PC.

As in these two pieces of information found under the Mac Install directions are not correct.

Download EasyGUI, and unzip it in Hard Disk/Python25/Lib/site-packages/
* this should be /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/


(optional) To install SPE, run the SPE Mac installer. Or, unzip this file (SPE source code) into the Hard Disk/Python25/Lib/site-packages folder.
* again this is the path that was correct for me..
/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/

Thank you for taking the time to do the work on this book, as I have never formally learned a language other than C (many years ago); I am hoping that going through this book with my kids will help me and them.

smilie
warren.sande (211) [Avatar] Offline
#4
Re: OSX Leopard Questions..
Thanks for that. It is very helpful.

Have fun with the book! And don't hesitate to post again if you have any other questions or comments as you go along.


Warren Sande
jonnwu (1) [Avatar] Offline
#5
Re: OSX Leopard Questions..
Hi Warren,

I think your web support person needs to update the Mac installation instructions. This very helpful thread, with the proper install directory was posted in March, 2009. It's now 4 months later and the website has not been updated.

Cheers,

Jonn

PS: I've ordered your book and am pre-installing everything in anticipation of jumping right in with the kids. After googling your book, book reviews, and the topic in general, I can't believe how many "homebrew geeks" there are like us, who grew up with Vic, C64's, Apple //'s... now with "tweens" who might be a bit more computer-curious than just playing a console game... yet no great books to indulge them!
jhon.ball (1) [Avatar] Offline
#6
I can't find python interactive on my computer when I downloaded python. In the instructions there isn't a link to download interactive. Where can I get interactive mode?
warren.sande (211) [Avatar] Offline
#7
Re: OSX Leopard Questions..
When you start IDLE, it is by default in Interactive mode. Just like the screen shots on pages 2 and 3.

To start IDLE, look in the Start Menu (if you're using Windows) and you'll see 'Python 2.5'. One of the items there is 'IDLE (Python GUI)' When you start that, you will get a window titled "Python Shell" Then you can just type Python commands at the '>>>' prompt.

I have seen IDLE on some systems start in editing mode instead of interactive mode. If IDLE opens with a blank text editor window (titled "Untitled"), you are in editing mode. To switch back to interactive mode, in the Run menu, pick "Python Shell".

You can choose the way IDLE starts up. In the Options menu, pick "Configure IDLE". Theere should be a tab called "General", and the first thing in that tab is "Startup Preferences". There it lets you choose to startup in Edit mode or the Shell (interactive mode).

Hope this helps.

Regards,
Warren Sande
jaziey (1) [Avatar] Offline
#8
Re: OSX Leopard Questions..
I have installed python2.6 and pygame-1.9.1release-py2.6-macosx10.5.zip 10.3MB on my new mac book pro OS X. I can run simple python programs just fine. Do I need anything else to start using pygame? I can not load the numeric installer from your site because it says that I need python2.5. Where can I get the numeric installer, pythonCard, EasyGui, etc.. that is compatible with python 2.6.

Thanks
Kathi Wood