Maintain backwards compatibility with python < 2.3 by dynamically
[python/dscho.git] / Mac / OSXResources / app / Resources / English.lproj / Documentation / shell.html
blob56f564645a7fb26d0165af525ec577fd4f3c0140
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd">
3 <html lang="en">
4 <head>
5 <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
6 <title>Python and the Unix Shell</title>
7 <meta name="generator" content="BBEdit 6.5.3">
8 <link rel="SHORTCUT ICON" href="pythonsmall.gif">
9 <META NAME="AppleIcon" CONTENT="pythonsmall.gif">
10 </head>
11 <body>
12 <h1>Running Python scripts from the Unix Shell</h1>
13 <table>
14 <tr>
15 <td>
16 <img src="python.gif" width="128" height="128" align="top" alt="">
17 </td>
18 <td>
19 <p>MacPython 2.3 installs a perfectly normal Unix commandline
20 python interpreter in <tt>/usr/local/bin/python</tt>. As of Mac OS X 10.2, however,
21 <tt>/usr/local/bin</tt> is not on the search path of your shell. Moreover,
22 Apple's python 2.2, which lives in <tt>/usr/bin</tt> <em>is</em> on your
23 search path, so this can lead to confusion.</p>
25 <p>If you use <tt>tcsh</tt> you should add the following line
26 to the file <tt>.login</tt> in your home directory and restart Terminal:
27 <br>
28 <tt>setenv PATH /usr/local/bin:$PATH</tt>
29 </p>
31 <p>If you use <tt>bash</tt> or <tt>zsh</tt>
32 you should add the following line
33 to the file <tt>.profile</tt> in your home directory and restart Terminal:
34 <br>
35 <tt>export PATH=/usr/local/bin:$PATH</tt>
36 </p>
38 <h2>GUI scripts</h2>
40 <p>Due to the way MacOS handles windowing applications you need to run
41 <em>all</em> scripts that use the window manager (be it through
42 Carbon, Cocoa, Tkinter, wxPython, PyOpenGL or anything else) with the
43 <tt>pythonw</tt> interpreter, also installed in <tt>/usr/local/bin</tt>.</p>
45 <p>Running with <tt>python</tt> results in an inability to bring the
46 script to the front, or interacting with it. </p>
47 </td>
48 </tr>
49 </table>
50 <hr>
51 </body>
52 </html>