[Idle-dev] use_subprocess issues...
Kurt B. Kaiser
kbk@shore.net
25 Sep 2002 12:35:51 -0400
>Tony Lownds <tony@lownds.com> writes:
> >[KBK]
> >It seems to me that sys.executable is coming up with the wrong value.
> >It is supposed to be a string containing the name of the interpreter
> >executable, not Idle. While it may be "python", from a practical
> >point of view it's "idle".
>
> Well, it is an interpreter executable! In fact it actually runs
> python's Py_Main (I said otherwise earlier). But Py_Main, for OSX,
> when running inside an applet, does not process command line
> arguments.
>
> >Isn't there a way to run Python from the command prompt in OS X?
> >That's the executable that should be called.
>
> Yes, sys.exec_prefix + 'bin/python' is reliable BUT unfortunately that
> will not include the magic .app directory in argv[0], so running
> Tkinter (or any other type of GUI) won't work. But it would work for
> non-GUI scripts.
I haven't done much with OS X beyond fiddling with its command prompt
at the local computer store. But it sure acts like xxxBSD. emacs -nw
works fine, for example. I didn't try Python, but IMHO any real Unix
should provide the Python interpreter at the command prompt :)
Does the Python2.2 that Apple is shipping with Jaguar include Tk?
According to Jack's MacPython page, it runs the interpreter from the
command line.
If I start Python from the Linux command line I can then start the
Tkinter test applet:
[kbk@float ~/proj/sandbox/idlefork]$ python
Python 2.3a0 (#3, May 8 2002, 23:37:01)
[GCC egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>> Tkinter._test
<function _test at 0x4041048c>
>>> Tkinter._test()
at which point the tk applet window appears on my desktop.
I would think that it would be useful to get that working on Jaguar
before proceeding.
Regards, KBK