[Pythonmac-SIG] PyObjC tutorial without Xcode

Craig Marshall craig9 at gmail.com
Sat Jul 19 10:16:53 CEST 2008


Hi all again,

> Below my signature is a sample script demonstrating a really minimal use of
> pyobjc.  This is meant to be run from the command line, and uses the BTop2
> framework from Perfectly Scientific.  You can download that framework for
> free, but it won't do much if you don't have the hardware!

Thanks for sending the above dav, I think I'm more interested in
trying to get a very basic GUI up and running, which from the look of
it your script doesn't handle..

I tried another tactic. I went through all the example folders that
the xcode 3.1 installation put on my hard drive
(/Developer/Documentation/Python/PyObjC/tutorial/ specifically) and
found again the official pyobjc tutorial. My new tactic is to start
with the final piece of code there (step 12), build and run it and
then play with it until I know how it works.

The problem is, when I build it and run it (out of the box!), it
doesn't work (cue hair-pulling sounds). I open a terminal, tell it to
build (python setup.py py2app), then tell it to run (open
dist/CurrencyConverter.app), and it gives me a dialog box with an
error inside:

CurrencyConverter Error
An unexpected error has occured during excution of the main script
ImportError: No module named Foundation

Open Console or Terminate

So - I'm beginning to think either these are the useless errors that
dav talked about and that I need to somehow shoe-horn the useful
exception code into the py2app build instructions, or that it really
can't find the Foundation module. I would have thought py2app could
find and insert the bits and pieces it needs just from the import
statements, or do I have to declare that I want to use Foundation in
the setup.py somehow?

A third possibility is that I've somehow broken my setup - how else
could a tutorial that came with the latest xcode not work out of the
box?

I'd be very grateful if someone can point me in the direction of at
least a very small working pyobjc GUI app that works out of the box
with modern software ....

Craig


More information about the Pythonmac-SIG mailing list