Macintosh Development

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Apr 15 01:02:19 EDT 2002


"Bryce C. Mason" wrote:
> 
> I am doing my development on a PC (activeware's distribution) and the final
> project will be running on a macintosh.  Umm...I am a little worried that
> there is not a command line interpreter in the Mac, at least one I have not
> seen.  Help.  How do I port my project to the mac?

MacPython has a facility for creating an "applet" from
a Python script. This is a small Macintosh application
that can be launched from the Finder. You can drop
files on the applet, and their pathnames will appear in
sys.argv.

Standard input and output is done through a text
window put up by the Python interpreter.

You will have to avoid any need for redirecting
stdin/out/err from outside the program, because there
is no way to do this on the Mac. There is also no
way of specifying dash-option command line
arguments.

(Actually, I believe that if you hold down the
Option key while launching the applet, there is an
option for entering a Unix-style command line
through a dialog box. It's an awfully clunky
way to use a Mac application, though.)

Hope that helps,

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list