1.1.1 How to run a Python script
Your best way to get started with Python on Mac OS X is through the PythonIDE integrated development environment, see section 1.2 and use the Help menu when the IDE is running.
If you want to run Python scripts from the Terminal window command line or from the Finder you first need an editor to create your script. Mac OS X comes with a number of standard Unix command line editors, vim and emacs among them. If you want a more Mac-like editor BBEdit or TextWrangler from Bare Bones Software (see http://www.barebones.com/products/bbedit/index.shtml) are good choices. AppleWorks or any other word processor that can save files in ASCII is also a possibility, including TextEdit which is included with OS X.
To run your script from the Terminal window you must make sure that /usr/local/bin is in your shell search path.
To run your script from the Finder you have two options:
- Drag it to PythonLauncher
- Select PythonLauncher as the default application to open your script (or any .py script) through the finder Info window and double-click it.
PythonLauncher has various preferences to control how your script is launched. Option-dragging allows you to change these for one invocation, or use its Preferences menu to change things globally.
See About this document... for information on suggesting changes.