[Pythonmac-SIG] help macpython on panther
Jack Jansen
Jack.Jansen at cwi.nl
Mon Dec 15 04:39:33 EST 2003
On 15 Dec 2003, at 2:34, r2b2 wrote:
>
> New to Mac and to programming.
> Bought a new mac G5 which came with Panther and macpython 2.3.
> I downloaded the Macpython addons and installed.
>
> The python IDE seems to be working fine. the small test programs i've
> run worked. Interactive mode works.
> But when I go to save it as an applet nothing happens when i double
> click on it to run it.
> my python preferences are set ; these were the defaults
>
> setting for file tye; python script
> interpreter: /usr/bin/pythonw
> run in terminal window is checked
This could be seen as a bug in the documentation. I just followed the
exact steps
you did (with the 'print "Hello World"' program), and indeed what
happens is what you
say: nothing.
The reason that nothing happens is logical, if you know the background
behind
applets and such, but I agree that it is rather unexpected if you're
new to Python
on the Mac:-)
Let me try to explain, maybe you (or other people on the list) can give
suggestions
as how to document this behavior.
First: applets are meant specifically for GUI programs that don't use
Terminal
I/O, such as the IDE itself, or Package Manager. This should be made
more clear in
the documentation. Any normal Python output from an applet appears to
get lost. (Sideline: it doesn't really get lost, it is sent to the
console. If you
open Applications->Utilities->Console you'll see the output of your
applet
there).
Second: the interaction between the IDE commands Save, Save as Applet,
Save Options... and Run with Commandline Python are obscure. And
actually some of the setting in Save Options are no really correct
either: the "File Creator: OSX PythonW interpreter" selection is silly,
and should have been replaced with "PythonLauncher". The good
news is that you can do this manually: select the "Other:" file creator,
and type "PytL" (without the quotes) into the text box.
Third: it seems that PythonLauncher somehow isn't the default
application for running Python scripts, as it should be. I need
to find out why this isn't so, I thought there where measures to make
this the case.
So, the workaround for running scripts with I/O from the command
line is to use the save options dialog, select "Other" file creator and
set the creator code to PytL. Next, save your script as a normal
script, not an applet. Now, double-clicking your script in the Finder
will bring up a Terminal window (provided you haven't changed the
preferences in PythonLauncher).
--
Jack Jansen <Jack.Jansen at cwi.nl> http://www.cwi.nl/~jack
If I can't dance I don't want to be part of your revolution -- Emma
Goldman
More information about the Pythonmac-SIG
mailing list