example Tk_Console.py (was Re: [Pythonmac-SIG] Python embedded in Cocoa)
Peter Funk
pf@artcom-gmbh.de
Sun, 1 Apr 2001 22:50:30 +0200 (MEST)
Hi,
Jack Jansen:
> It shouldn't be necessary to write any C code, I think. You can catch
> sys.stdout in Python and redirect it. You can look at IDE (included
> with MacPython, in :Mac:Tools:IDE) or Idle (included with all Pythons,
> in :Tools:Idle) for example code.
I would like to point out, that Ka-Ping Yee <ping@lfw.org> has written
a small selfcontained utility called 'Console.py', which is only
round about 800 lines of Python code:
http://www.lfw.org/python/Console.py
This might be easier to read than having to do a search for
the example code in Idle or the Mac IDE.
I must admit, that I've never tried this Tk based Console on the Mac,
but the IO redirection code seems to be all in there.
Hope this helps, Peter
--
Peter Funk, Oldenburger Str.86, D-27777 Ganderkesee, Germany, Fax:+49 4222950260
office: +49 421 20419-0 (ArtCom GmbH, Grazer Str.8, D-28359 Bremen, Germany)