Building Python 2.2.2 with aqua Tk support on MacOS X 10.2 -- instructions

Graham Dumpleton grahamd at dscpl.com.au
Fri Nov 8 22:11:17 EST 2002


"Russell E. Owen" <owen at nospam.invalid> wrote in message news:<aqf13o$224g$1 at nntp6.u.washington.edu>...
> Instructions for building Python 2.2.2 with aqua Tk support (plus 
> readlines and XML parsing) are available at 
> <http://www.astro.washington.edu/owen/>. Thanks to the many people 
> (credited in the document) who helped me figure out how to do it.
> 
> There are still a few minor glitches, but no show stoppers. I may update 
> the file over time if any answers come in for the glitches. The 
> procedure should be simpler for building Python 2.3, when that comes out.
> 
> -- Russell

One very minor issue. When giving instructions on how to create a pythonw
shell script, you say to put in it:

  #!/bin/sh
  exec /Applications/Python.app/Contents/MacOS/python $@

You might want to use:

  #!/bin/sh
  exec /Applications/Python.app/Contents/MacOS/python "$@"

If you don't have double quotes around $@, if you have an argument to the
script which has a space in it, that argument will get separated into more
than one argument when passed to the actual python executable.

Ie., with script as you originally suggest it should be:

bash-2.05a$ pythonw test.py "a b"
original argc=4
original argv[0] = "/Applications/Python.app/Contents/MacOS/python"
original argv[1] = "test.py"
original argv[2] = "a"
original argv[3] = "b"
modified argc=4
modified argv[0] = "/Applications/Python.app/Contents/MacOS/python"
modified argv[1] = "test.py"
modified argv[2] = "a"
modified argv[3] = "b"

and with quotes:

bash-2.05a$ pythonw test.py "a b"
original argc=3
original argv[0] = "/Applications/Python.app/Contents/MacOS/python"
original argv[1] = "test.py"
original argv[2] = "a b"
modified argc=3
modified argv[0] = "/Applications/Python.app/Contents/MacOS/python"
modified argv[1] = "test.py"
modified argv[2] = "a b"



More information about the Python-list mailing list