From Jack.Jansen@cwi.nl Fri Mar 1 14:42:58 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Fri, 01 Mar 1996 15:42:58 +0100 Subject: [PYTHONMAC-SIG] Printing from Python? In-Reply-To: Message by guzdial@cc.gatech.edu (Mark Guzdial) , Thu, 29 Feb 1996 12:17:00 -0500 (EST) , Message-ID: <9603011442.AA04518=jack@schelvis.cwi.nl> GUSI, which is used in tk-python as Guido distributed supports the Printer Access Protocol. It may be possible to use that to talk to a printer. If someone has any success with this: please let me know. Also, you can use the standard Mac way of printing, by using QuickDraw. I haven't tried it, so it is possible that the Qd module misses some of the functionality that is needed for printing. And there is of course the possibility of letting BBEdit or something do your p[rinting for you by sending it AppleEvents, as someone else already pointed out. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From subra@apple.com Thu Mar 7 00:05:18 1996 From: subra@apple.com (Subra Mayilvahanan) Date: Wed, 6 Mar 1996 16:05:18 -0800 Subject: [PYTHONMAC-SIG] Re: HELP: extension module Message-ID: I figured out why I wasn't able to import my module. Its that ".slb" thing I missed in the filename! --subra ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From subra@apple.com Thu Mar 7 10:34:53 1996 From: subra@apple.com (Jack Jansen) Date: Thu, 07 Mar 1996 11:34:53 +0100 Subject: [PYTHONMAC-SIG] Forwarded message: extension module Message-ID: <9603071034.AA24352=jack@schelvis.cwi.nl> For reasons unknown to me this message bounced to the -request address (maybe because the subject starts with "HELP"?), so I'm forwarding it. ------- Forwarded Message To: pythonmac-sig@python.org From: subra@apple.com (Subra Mayilvahanan) Subject: HELP: extension module Hi I need some help with the python extension modules (Version 1.3). I want to create my own extension module as a shared library on a powermac. Here is what I did: * Wrote a tiny module with just one function (source is included at the end.) Source file name: "myfirstmodule.c", shared lib name: "myfirstmodule". * Copied the CW7 PythonCore project file, removed the sources from that and added my module source file (retained the run-time and shared lib glue stuff). * Built the shared lib successfully and copied it to the system extension folder. * Typed "import myfirstmodule" in "PythonPPC" std window. I am getting an error saying "no module named myfirstmodule". Any clues? - -- Subra - ---------------------------- 8< ------------- 8< ----------------------------- /* myfirstmodule */ #include "Python.h" static PyObject* gMyFirstModuleError; static PyObject* myfirstmodule_add(PyObject* self, PyObject* args) { int a1, a2; char result[1024]; if (!PyArg_ParseTuple(args, "ii", &a1, &a2)) { return NULL; /* invalid arguments */ } sprintf(result, "%d", a1 + a2); return Py_BuildValue("s", result); } static PyMethodDef gMyFirstModuleMethods[] = { {"add", myfirstmodule_add, 1}, {NULL, NULL} }; void initmyfirstmodule() { PyObject* m; PyObject* d; m = Py_InitModule("myfirstmodule", gMyFirstModuleMethods); d = PyModule_GetDict(m); gMyFirstModuleError = PyString_FromString("myfirstmodule.error"); PyDict_SetItemString(d, "error", gMyFirstModuleError); } - ---------------------------- 8< ----------------- 8< ------------------------- ------- End of Forwarded Message ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Jack.Jansen@cwi.nl Thu Mar 7 11:28:00 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Thu, 07 Mar 1996 12:28:00 +0100 Subject: [PYTHONMAC-SIG] Forwarded message: extension module In-Reply-To: Message by Jack Jansen , Thu, 07 Mar 1996 11:34:53 +0100 , <9603071034.AA24352=jack@schelvis.cwi.nl> Message-ID: <9603071128.AA24658=jack@schelvis.cwi.nl> > > Here is what I did: > * Wrote a tiny module with just one function (source is included at the end.) > Source file name: "myfirstmodule.c", shared lib name: > "myfirstmodule". The library name should end in .slb, as you already noted. > * Copied the CW7 PythonCore project file, removed the sources from that and > added my module source file (retained the run-time and shared lib glue stuff). This is probably not the best way to do it. There is a skeleton project file xxmodule.{mu} that is ready for use. One thing to keep in mind (it recently bit me): if your extension module contains C++ code anywhere you will have to supply a PEF init function that (at the very least) calls __sinit() to do C++ static initializers. The MetroWerks documentation has details. > * Built the shared lib successfully and copied it to the system extension > folder. It shouldn't go into the extension folder, you should put it somewhere along sys.path. "PlugIns" is the standard place. This whole process, by the way, is documented since a few months, check out . Besides this extension example it also has some stuff on using toolbox calls and appleevents from python. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Jack.Jansen@cwi.nl Thu Mar 7 15:01:04 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Thu, 07 Mar 1996 16:01:04 +0100 Subject: [PYTHONMAC-SIG] Announce: TkPython for 68k and PPC available Message-ID: <9603071501.AA25625=jack@schelvis.cwi.nl> I've built a PPC python with Tk as a dynamically loadable extension, available in . For sake of completeness, I've also put a 68K distribution there, some bugs with regard to funny working directory behaviour were fixed since Guido built his 68K TkPython distribution. These are complete self-contained distributions. They should be regarded as alpha-test software, even if you are not using the Tk stuff: the I/O system is based on the GUSI library, and I've only been using it for a few weeks so not everything may work as expected. Another warning is also in place here: these distributions use 'Pyth' as creator-code in stead of 'PYTH'. A script is included to automatically change your old python files, but if you decide to go back to 1.3 or 1.3.1 you'll have to modify the script to do the reverse operation. I'll leave you all to look at this stuff for a week or so before I advertise it to a larger audience. In that time I may replace the archives with newer versions if bug reports come in. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From gandreas@skypoint.com Thu Mar 21 13:27:03 1996 From: gandreas@skypoint.com (Glenn Andreas) Date: Thu, 21 Mar 1996 07:27:03 -0600 (CST) Subject: [PYTHONMAC-SIG] Compile under CW8? Message-ID: Has anybody gotten a stock 1.3 to compile under CW8? It use to work fine under CW7, but now compiling ceval.c hangs the compiler. Everything else works, but something in the main interp routine kills it (even if I just "check syntax"). I've tried turning on CASE_TOO_BIG, but this doesn't help either - it still dies somewhere in eval_code2. (commenting the whole routine out has it working fine, but that doesn't help much). Glenn Glenn Andreas Author of Macintosh games: gandreas@skypoint.com, gandreas@aol.com Theldrow 2.3 http://www.skypoint.com/members/gandreas Blobbo 1.0.1 ftp://ftp.skypoint.com/pub/members/g/gandreas <---- Available here! ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From guido@CNRI.Reston.VA.US Thu Mar 21 15:08:07 1996 From: guido@CNRI.Reston.VA.US (Guido van Rossum) Date: Thu, 21 Mar 1996 10:08:07 -0500 Subject: [PYTHONMAC-SIG] Compile under CW8? In-Reply-To: Your message of "Thu, 21 Mar 1996 07:27:03 CST." References: Message-ID: <199603211508.KAA03229@monty> > Has anybody gotten a stock 1.3 to compile under CW8? Although I'm working with an upgraded version, ceval.c hasn't changed much, and it compiles fine. Perhaps you should up the compiler's memory assignment a wee bit? --Guido van Rossum URL: ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Jack.Jansen@cwi.nl Thu Mar 21 15:19:55 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Thu, 21 Mar 1996 16:19:55 +0100 Subject: [PYTHONMAC-SIG] Compile under CW8? In-Reply-To: Message by gandreas@skypoint.com (Glenn Andreas) , Thu, 21 Mar 1996 07:27:03 -0600 (CST) , Message-ID: <9603211519.AA21318=jack@schelvis.cwi.nl> Recently, gandreas@skypoint.com (Glenn Andreas) said: > > Has anybody gotten a stock 1.3 to compile under CW8? It use to work fine > under CW7, but now compiling ceval.c hangs the compiler. Try lowering the optimization level. I had to do the same on my home machine (although it didn't hang the machine, it just aborted). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From gandreas@skypoint.com Fri Mar 22 00:12:46 1996 From: gandreas@skypoint.com (Glenn Andreas) Date: Thu, 21 Mar 1996 18:12:46 -0600 (CST) Subject: [PYTHONMAC-SIG] Compile under CW8? In-Reply-To: <9603211722.AA12394@msusrv.tfs.com> from "jps@TFS.COM" at Mar 21, 96 09:22:38 am Message-ID: > > gandreas@skypoint.c writes: > : Has anybody gotten a stock 1.3 to compile under CW8? It use to work fine > : under CW7, but now compiling ceval.c hangs the compiler. > > I've seen CW8 hang when compiling ceval.c on a 6100 with optimization on. > I can compile it just fine on a 6100 and a 9500 with optimization off. > > The hang seems new to this version of CW. > > -jeff stearns > Well, strange as it may seem, this was a bit of a false alarm. It does compile fine, but it takes several minutes! I was just so use to nothing taking more than five seconds that after thirty seconds I paniced (I'm sure there is an important lesson here). I spent several hours commenting out various chunks of the routine, and noticed that it would work, but it sometimes took a while (but far enough below my panic threshold to not cause me to kill it). And while I had all optimizations on, I'm not convinced that that is related, since I got the same behaviour if I only did "Check Syntax" (which I assumed would not generate code, much less optimize it, unless some of the optimizations are done in then). So, everything is OK, and I didn't just go temporarily insane. Back to thinking about SOM wrappers for OpenDoc... Glenn Glenn Andreas Author of Macintosh games: gandreas@skypoint.com, gandreas@aol.com Theldrow 2.3 http://www.skypoint.com/members/gandreas Blobbo 1.0.1 ftp://ftp.skypoint.com/pub/members/g/gandreas <---- Available here! ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Jack.Jansen@cwi.nl Tue Mar 26 12:31:01 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Tue, 26 Mar 1996 13:31:01 +0100 Subject: [PYTHONMAC-SIG] CGI scripting in python Message-ID: <9603261231.AA09566=jack@schelvis.cwi.nl> Has anyone looked at writing CGI scripts in Python, by any chance? -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From guzdial@cc.gatech.edu Tue Mar 26 14:21:57 1996 From: guzdial@cc.gatech.edu (Mark Guzdial) Date: Tue, 26 Mar 1996 09:21:57 -0500 (EST) Subject: [PYTHONMAC-SIG] Compile under CW8? Message-ID: BTW, can anyone post an archive of the Mac sources? I downloaded the distribution once, de-tarred it, and tried to pick out the pieces, but just got lost. A CW8-compilable archive would be wonderful. Thanks! Mark P.S. I do educational technology research, and my first Python-based tool goes into the classroom tomorrow! >Recently, gandreas@skypoint.com (Glenn Andreas) said: >> >> Has anybody gotten a stock 1.3 to compile under CW8? It use to work fine >> under CW7, but now compiling ceval.c hangs the compiler. > >Try lowering the optimization level. I had to do the same on my home >machine (although it didn't hang the machine, it just aborted). >-- >Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ >Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ >http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm > >================= >PYTHONMAC-SIG - SIG on Python for the Apple Macintosh > >send messages to: pythonmac-sig@python.org >administrivia to: pythonmac-sig-request@python.org >================= -------------------------- Mark Guzdial : Georgia Tech : College of Computing : Atlanta, GA 30332-0280 (404) 894-5618 : Fax (404) 894-0673 : guzdial@cc.gatech.edu http://www.cc.gatech.edu/gvu/people/Faculty/Mark.Guzdial.html ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Jack.Jansen@cwi.nl Tue Mar 26 14:50:47 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Tue, 26 Mar 1996 15:50:47 +0100 Subject: [PYTHONMAC-SIG] Compile under CW8? In-Reply-To: Message by guzdial@cc.gatech.edu (Mark Guzdial) , Tue, 26 Mar 1996 09:21:57 -0500 (EST) , Message-ID: <9603261450.AA10169=jack@schelvis.cwi.nl> Recently, guzdial@cc.gatech.edu (Mark Guzdial) said: > BTW, can anyone post an archive of the Mac sources? I downloaded the > distribution once, de-tarred it, and tried to pick out the pieces, but just > got lost. A CW8-compilable archive would be wonderful. Hmm. I could do this, but is there a point? The full source distribution contains everything you need. There were some minor problems with the "current" distribution (i.e. the 1.3 distribution as it sits on the servers right now), and there was no mac-specific readme file, but apart from that the unix distribution should work fine.... -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From jstrout@ucsd.edu Wed Mar 27 19:48:44 1996 From: jstrout@ucsd.edu (Joseph Strout) Date: Wed, 27 Mar 1996 11:48:44 -0800 (PST) Subject: [PYTHONMAC-SIG] Yes, but can it do... THIS? Message-ID: I encountered "Chipmunk Basic" for the Mac the other day. It's a freeware BASIC implementation which can do some pretty nifty stuff in its Mac version, such as sprites (shapes which arrange themselves in layers, move around without clobbering the background or each other, and provide for collision detection). I've been looking for a language to get some young brothers-in-law into programming, and sprites would be a big plus (gives a language "Pac-Man equivalence"). But BASIC is pretty nasty by modern standards; Python is much nicer. So. Any sprite libraries for Mac Python yet? Thanks, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Department of Neuroscience, UCSD | | jstrout@ucsd.edu http://www-acs.ucsd.edu/~jstrout/ | `------------------------------------------------------------------' ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From guzdial@cc.gatech.edu Fri Mar 29 19:28:47 1996 From: guzdial@cc.gatech.edu (Mark Guzdial) Date: Fri, 29 Mar 1996 14:28:47 -0500 (EST) Subject: [PYTHONMAC-SIG] Compile under CW8? Message-ID: >Hmm. I could do this, but is there a point? The full source >distribution contains everything you need. There were some minor >problems with the "current" distribution (i.e. the 1.3 distribution as >it sits on the servers right now), and there was no mac-specific >readme file, but apart from that the unix distribution should work fine.... I guess it's just a user-interface/audience-type thing. I'm not a UNIX user, generally speaking, nor am I skilled at CodeWarrior. So, when I tried to grab the 1.3 distribution, I found that I couldn't de-tar it on my Mac because the filenames were too long. So, I grabbed the file again on my UNIX account and de-tarred it there. Now, I had to figure out which pieces to grab. The readme talked about grabbing these directories, but not these others. Faced with moving things back to my Mac and unsure which pieces were which, I surrendered. I'd be very interested in exploring the source code to Python on my Mac, and since people obviously must have gone through these various manipulations in order to get it in CodeWarrior format, I'm simply asking if someone could upload that. If it's too much bother, no problems -- thanks! Mark -------------------------- Mark Guzdial : Georgia Tech : College of Computing : Atlanta, GA 30332-0280 (404) 894-5618 : Fax (404) 894-0673 : guzdial@cc.gatech.edu http://www.cc.gatech.edu/gvu/people/Faculty/Mark.Guzdial.html ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From Jack.Jansen@cwi.nl Sat Mar 30 16:34:04 1996 From: Jack.Jansen@cwi.nl (Jack Jansen) Date: Sat, 30 Mar 1996 17:34:04 +0100 Subject: [PYTHONMAC-SIG] Compile under CW8? In-Reply-To: Message by guzdial@cc.gatech.edu (Mark Guzdial) , Fri, 29 Mar 1996 14:28:47 -0500 (EST) , Message-ID: <9603301634.AA00976=jack@schelvis.cwi.nl> Ok, for the next release I'll make a source distribution available too. What do people want: a mean-and-lean Python-only distribution, one including everything else you need (stdwin, pbm/jpeg/etc libraries, gusi) or both? -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org ================= From demars@netcom.com Sat Mar 30 23:27:32 1996 From: demars@netcom.com (Dennis C. De Mars) Date: Sat, 30 Mar 1996 15:27:32 -0800 Subject: [PYTHONMAC-SIG] Compile under CW8? Message-ID: >Ok, for the next release I'll make a source distribution available >too. What do people want: a mean-and-lean Python-only distribution, >one including everything else you need (stdwin, pbm/jpeg/etc >libraries, gusi) or both? >-- >Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ >Jack.Jansen@cwi.nl | ++++ if you agree copy these lines to your sig ++++ >http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm > >================= >PYTHONMAC-SIG - SIG on Python for the Apple Macintosh > >send messages to: pythonmac-sig@python.org >administrivia to: pythonmac-sig-request@python.org >================= I think that would be great! Personally I'd like to have everything, ready to build with CW8. I recently made a build of the standard 1.3 distribution. (I did this because I wanted to play with the Numerical Python extensions, so I had to fold that source in to build for the Mac). I eventually got it to work, but there were some anomalies that might be due to something about the CW libraries and the way CW builds shared libraries that changed between when Python 1.3 was released and the standard distribution. F'rinstance, I had to comment out the __sinit routine in Python 1.3 since the CW8 linker seems to insist on generating its own and then complaining about the multiply-defined symbol. Also, I could not get the linker to stop pulling in the __start module from the library (even though I didn't fill in __start in the linker options) and since the standard __start has a call to "main," I had to put a dummy "main" routine in, which got put into PythonCore. Then, when I linked the Python app (which has the _real_ main routine) it complained about the extra main, but it was just a warning, and the correct main got linked in, so everything worked after that, but even so, I obviously was doing something not quite right! I had other problems before that, but I think those were mostly due to my not following the suggestion of where in the folder hierarchy to put the project files before building, and therefore having incorrect access paths set up initially. Also, some of the other 1.3 project files for building some of the optional Mac oriented modules seemed to be inconsistent or incomplete, referring to files that didn't seem to be present in the 1.3 distribution. Anyhow, if we could get a fresh source distribution with all of the necessary parts to do a build with CW8 I'd be very grateful (then I could do a grand unified build with all of the numerical stuff, Tk support, etc.) GUSI adds quite a bit to the size of the download, and I've probably got the most recent version anyway, so you might want to make a version available with URLs to any source that is publically available else. On the other hand, if the only version was with all the other stuff thrown in, I wouldn't mind downloading some redundant pieces (and of course the advantage of that is that the other pieces are being revised continuously, so one might not grab the correct version if having to go to different sites to collect it all -- having all source in one distribution assures that everything is consistent). - Dennis D. ================= PYTHONMAC-SIG - SIG on Python for the Apple Macintosh send messages to: pythonmac-sig@python.org administrivia to: pythonmac-sig-request@python.org =================