From jimmy@CS.cofc.EDU Thu Feb 1 00:31:33 2001 From: jimmy@CS.cofc.EDU (James B. Wilkinson) Date: Wed, 31 Jan 2001 19:31:33 -0500 Subject: [Pythonmac-SIG] Solved: problem with socket library in 2.0? In-Reply-To: References: Message-ID: I found the answer in the socket HowTo, which I didn't know about until I saw one of my students reading it this afternoon. I was using '127.0.0.1' as the address of the server socket, thereby rendering it invisible to other machines. This is new in 2.0. Is this another one of those cases where the behavior in 1.5.2 was convenient but incorrect? Sorry for the bother. >Last year I wrote a rudimentary client/server pair using >dgramsockets. I used it in my networking class as a demo. Today I >installed Macpython 2.0 on my Mac, and that seems to have broken the >server. Things just hang as if the packet from the client is not >being delivered. If I drag the server onto the 1.5.2 interpreter, it >still works fine with the same client. > >Can anybody else confirm this? > >Thanks > >#Datagram server >from socket import * >import struct >HOST = '127.0.0.1' HOST = gethostname() #fixes the problem >PORT = 50007 > -- ------------------------------------------------------------- Jimmy Wilkinson | Perfesser of Computer Science jimmy@cs.CofC.edu | The College of Charleston (843) 953-8160 | Charleston SC 29424 If there is one word to describe me, that word would have to be "profectionist". Any form of incompitence is an athema to me. From joanca@typerware.com Thu Feb 1 16:12:51 2001 From: joanca@typerware.com (JoanCarles Casas=?ISO-8859-1?B?7Q==?=n) Date: Thu, 01 Feb 2001 18:12:51 +0200 Subject: [Pythonmac-SIG] Writing In-Reply-To: Message-ID: On 1/2/01 00:12, "mark brady" wrote: > I am attempting to write text to a file. I've opened the file (I think) > using macfs StandardPutFile. Here are my questions: Does this > actually open a file? What method can the FSSpec file use to actually > write? write() doesn't seem to work. Try this: import macfs def writestuff(stuff): f, ok =3D macfs.StandardPutFile("Save text as:", ".txt") if ok: filedata =3D open(f.as_pathname(), "w") filedata.write(stuff) filedata.close() writestuff("The stuff you want to write") [:] jc, tw=AE From jack@oratrix.nl Thu Feb 1 17:37:00 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 01 Feb 2001 18:37:00 +0100 Subject: [Pythonmac-SIG] Writing In-Reply-To: Message by mark brady , Wed, 31 Jan 2001 14:12:16 -0800 , Message-ID: <20010201173705.DFF23FF2F6@oratrix.oratrix.nl> Recently, mark brady said: > I am attempting to write text to a file. I've opened the file (I think) > using macfs StandardPutFile. Here are my questions: Does this > actually open a file? What method can the FSSpec file use to actually > write? write() doesn't seem to work. The FSSpec is only the name of the file, not the open file. Moreover, it's in a funny MacOS-specific form, and to open the file it's easiest to have the full pathname. Something like this: file = open(fsspec.as_pathname(), "w") # or "wb" if you want to write # binary data The file object has the expected read/write/seek methods. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jbmoody@oakland.edu Thu Feb 1 20:54:47 2001 From: jbmoody@oakland.edu (Jon Moody) Date: Thu, 1 Feb 2001 15:54:47 -0500 Subject: [Pythonmac-SIG] findertools.copy() Message-ID: <20010201155447.B1587@oakland.edu> The module documentation says that findertools.copy(src,destdir) returns an Alias object pointing to the new file, but what I'm getting instead looks like an ObjectSpecifier object (File('filename')). Is there an Alias object buried somewhere in there? How does one retrieve the raw Alias data from this thing? From jack@oratrix.nl Fri Feb 2 08:54:28 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 02 Feb 2001 09:54:28 +0100 Subject: [Pythonmac-SIG] Solved: problem with socket library in 2.0? In-Reply-To: Message by "James B. Wilkinson" , Wed, 31 Jan 2001 19:31:33 -0500 , Message-ID: <20010202085429.5E384373C95@snelboot.oratrix.nl> > I found the answer in the socket HowTo, which I didn't know about > until I saw one of my students reading it this afternoon. I was using > '127.0.0.1' as the address of the server socket, thereby rendering it > invisible to other machines. > > This is new in 2.0. Is this another one of those cases where the > behavior in 1.5.2 was convenient but incorrect? The old behaviour was probably because Python 1.5.2 used GUSI 1 for socket I/O, which was implemented with MacTCP, which didn't understand about multiple network addresses per machine, so a listen() ignored the source IP address. Python 2 uses GUSI 2 which is implemented with Open Transport, which does know about multihoming, so the source IP address is suddenly important. Note that the normal way to do a listen(), on both 1.5.2 and 2.0, is not to pass any source IP address at all, in which case the listen() will happen on all IP addresses of the machine automatically. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From brady@mmm.com Sat Feb 3 00:22:27 2001 From: brady@mmm.com (mark brady) Date: Fri, 02 Feb 2001 16:22:27 -0800 Subject: [Pythonmac-SIG] Canvas PhotoImage Message-ID: I find some strange things happening with PhotoImages. The line of code below should display a PhotoImage item on a canvas but it doesn't. imageItem = myFrame.draw.create_image( sizex, sizey, image=tkIm ) where myFrame is a frame, draw is a canvas, and tkIm is a PhotoImage. A similar line works elsewhere when the frame is created. Just to be sure everything else was OK with my context I tried creating an oval item on the canvas at the same point in my program that the above line appears, using the same frame, canvas, etc. That appeared just fine. So there seems to be some difference in behavior between ovals and PhotoImages. Has anyone else tried this? -Mark From tjlahey@sympatico.ca Sat Feb 3 05:23:15 2001 From: tjlahey@sympatico.ca (Tim Lahey) Date: Sat, 3 Feb 2001 00:23:15 -0500 Subject: [Pythonmac-SIG] Numeric on OS X Message-ID: <20010203052315.YBZT27416.tomts5-srv.bellnexxia.net@localhost> I'm trying to get Numeric to run on OS X (and Multipack for that = matter). I've managed to get it to compile but when I run it I get the = following: Python 2.0 (#10, 11/12/00, 02:11:28)=20 [GCC Apple DevKit-based CPP 5.0] on Darwin1.2 Type "copyright", "credits" or "license" for more information. >>> from Numeric import * dyld: python multiple definitions of symbol _PyArray_API /usr/local/lib/python2.0/site-packages/Numeric/multiarray.so definition = of _PyArray_API /usr/local/lib/python2.0/site-packages/Numeric/umath.so definition of = _PyArray_API Any suggestions on fixing this problem ? Thanks, Tim Lahey= From jimmy@CS.cofc.EDU Sun Feb 4 00:51:36 2001 From: jimmy@CS.cofc.EDU (James B. Wilkinson) Date: Sat, 3 Feb 2001 19:51:36 -0500 Subject: [Pythonmac-SIG] Solved: problem with socket library in 2.0? In-Reply-To: <20010202085429.5E384373C95@snelboot.oratrix.nl> References: <20010202085429.5E384373C95@snelboot.oratrix.nl> Message-ID: > > I found the answer in the socket HowTo, which I didn't know about >> until I saw one of my students reading it this afternoon. I was using >> '127.0.0.1' as the address of the server socket, thereby rendering it >> invisible to other machines. >> >> This is new in 2.0. Is this another one of those cases where the >> behavior in 1.5.2 was convenient but incorrect? > >The old behaviour was probably because Python 1.5.2 used GUSI 1 for socket >I/O, which was implemented with MacTCP, which didn't understand about multiple >network addresses per machine, so a listen() ignored the source IP address. > >Python 2 uses GUSI 2 which is implemented with Open Transport, which does know >about multihoming, so the source IP address is suddenly important. > >Note that the normal way to do a listen(), on both 1.5.2 and 2.0, is not to >pass any source IP address at all, in which case the listen() will happen on >all IP addresses of the machine automatically. >-- >Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ >Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ >www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm Do you mean to use '' instead of gethostname() in the bind() call? Yes, that works. I had a student tell me that it no longer works in version 2.0. Should have known not to believe him. In checking all this out, I noticed an apparent change in behavior in the example at http://www.python.org/doc/current/lib/socket-example.html On closer inspection it seemed not to be a change at all, just a clearer report of what happened. I guess that's also because of GUSI2. Here's the code. #Stream Server from socket import * HOST = '' PORT = 50007 s = socket(AF_INET, SOCK_STREAM) s.bind((HOST, PORT)) s.listen(1) conn, addr = s.accept() print 'Connected by', addr while 1: data = conn.recv(1024) if not data: break conn.send(data) conn.close() If I run the server in 1.5.2 and hit it with the client in the same example, I get the 'Connected by' message, and then Python terminates. In 2.0 it complains as follows before terminating: "socket.error: (57, 'Socket is not connected')". Now I understand what's going on here, I think. The call to conn.recv(1024) is a *blocking* call, and in this simple program, the only way out of the loop is for the client to quit and close its end of the socket. GUSI1 seems to do the same thing, but, without the error message, it looked like a nonblocking call which terminated the loop on the second pass by returning 0 bytes of data. If I'm right about that, then the "if not data: break" line is superfluous. Just now I commented it out, expecting the program to behave just as it did before. Well, surprise. In 2.0 that's the case, but in 1.5.2 it does just exactly the same as in 2.0, same error message and all. Wait, not *exactly* the same. In 2.0 the error is associated with the conn.recv() call; in 1.5.2, it's associated with the conn.send() call. So the truth seems to be that the conn.recv() always blocked (a sleep(5) in front of the close() in the client proves that). However, in 1.5.2 once the connection is broken, it returns with 0 bytes of data, whereas in 2.0 it gives an error. If I run the server on Windows and hit it with the client, I never get the error. It acts like 1.5.2 on the Mac. *Unless* I comment out the "if not data: break" line. In that case the server simply hangs. That's exactly the same thing I get running the server on Linux, but the Linux box has Python 1.5. So I build 2.0 on the Linux box, and it's the same. By this time I'm very confused, but it seems safe to say that, in this respect, 2.0 does not behave the same on Macs as it does on Linux and Windows. -- ------------------------------------------------------------- Jimmy Wilkinson | Perfesser of Computer Science jimmy@cs.CofC.edu | The College of Charleston (843) 953-8160 | Charleston SC 29424 If there is one word to describe me, that word would have to be "profectionist". Any form of incompitence is an athema to me. From and_j_rob@yahoo.com Mon Feb 5 07:18:13 2001 From: and_j_rob@yahoo.com (Andrew Robbins) Date: Sun, 4 Feb 2001 23:18:13 -0800 (PST) Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX Message-ID: <20010205071813.28800.qmail@web3602.mail.yahoo.com> I've been using Python for the Mac for awhile now, and I'm wondering If, and when there are plans to add support for OSX's GUI. It seems like you'd just need to make a python module in ObjC or Java. I'm really interested, and I have the beta, so I'd help if need be. My programming skills are pretty bad, even tho i convince myself that I'm a programmer sometimes. I read more than i write, but if theres anything I can do, or if you need a tester, I'm your man... The point of this was to see how OSX's GUI/Frameworks support was comming along... Andrew Robbins __________________________________________________ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ From jack@oratrix.nl Mon Feb 5 09:33:28 2001 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 05 Feb 2001 10:33:28 +0100 Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX In-Reply-To: Message by Andrew Robbins , Sun, 4 Feb 2001 23:18:13 -0800 (PST) , <20010205071813.28800.qmail@web3602.mail.yahoo.com> Message-ID: <20010205093328.D0330373C95@snelboot.oratrix.nl> MacOSX support is probably going to happen along two lines. First of all I'm busy with getting MacPython to run under Carbon, which is now 99% done (I hope to release a MacPython 2.1 alfa later this week or early next week). I would expect this to be the basis for MacPython for the next year or so, for as long as MacOS9 machines are still predominant. Eventually I expect the standard MacPython to be based on the Unix Python, with the MacOS extension modules thrown in. Some people are already working on getting the extensions to work, with reasonable success (if I understand correctly). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From sdm7g@virginia.edu Mon Feb 5 19:16:27 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Mon, 5 Feb 2001 14:16:27 -0500 (EST) Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX In-Reply-To: <20010205093328.D0330373C95@snelboot.oratrix.nl> Message-ID: On Sun, 4 Feb 2001, Andrew Robbins wrote: > I've been using Python for the Mac for awhile now, and > I'm wondering If, and when there are plans to add > support for OSX's GUI. It seems like you'd just need > to make a python module in ObjC or Java. I'm really > interested, and I have the beta, so I'd help if need > be. My programming skills are pretty bad, even tho i > convince myself that I'm a programmer sometimes. I > read more than i write, but if theres anything I can > do, or if you need a tester, I'm your man... The point > of this was to see how OSX's GUI/Frameworks support > was comming along... There is a Python<->Objective-C bridge http://sourceforge.net/projects/pyobjc/ that will build for 2.0 with a little bit of patching and poking, or for 2.1 alpha almost out of the box. ( You might have to define CXX as c++ in the pyobjc Makefile, now that Python-2.1's Setup files have changed. Otherwise, by default it tries g++ ) PyObjC allows access to Cocoa (Foundation & AppKit) classes (and in fact any objective-c classes that can be built into a dynamically loadable bundle ) from Python. Problems: There are some known bugs that haven't been fixed in the cvs version on SourceForge because SourceForge has been broken for new projects for the last month. ( The support forums have been full of messages from folks who can't update their projects via ssh or cvs. ) The pyobjc mailing list hosted there does work though, so you can ask about bugs or look up known problems in the mailing list archive. ( And there's at least one known bug that I haven't found a patch for yet: delegates don't work thru the python-objective-c bridge yet -- these is a proxy object sitting between the python object and the objc object that isn't responding to the delegate protocol correctly. ) There are bugs in the OSX public beta. One that I've run into causes python/Cocoa programs to work when run from gdb, or when run using the full pathname on the command line, but not work when invoked another way. There some missing functionality: you can access all the objective-c classes, but there are some non-class support functions and constants that haven't been wrapped yet. It's pretty much undocumented. If SourceForge gets fixed (now that the staff should be back from LinuxWorld Expo) I'll put up some annotated examples. Till then, you can ask on the mailing list. There's lots of stuff nobody has quite figure out how to do yet -- like how to interface Python to InterfaceBuilder. On Mon, 5 Feb 2001, Jack Jansen wrote: > Eventually I expect the standard MacPython to be based on the Unix Python, > with the MacOS extension modules thrown in. Some people are already working on > getting the extensions to work, with reasonable success (if I understand > correctly). I've also managed to build a Carbonlib for python, which included most of the "classic" MacPython toolbox libs. I've been trying to get Python2.1 macosx-ready, and I want to sync up with Jack's latest work, so right now, I'm between working versions. BTW: Jack, Following the instructions on http://www.cwi.nl/~jack/macpython.html, I still can't get access to your CVS of Python/Mac: cvs -d:pserver:ropython@pythoncvs.oratrix.nl:/hosts/mm/ login (Logging in to ropython@pythoncvs.oratrix.nl) CVS password: geheim cvs [login aborted]: authorization failed: server pythoncvs.oratrix.nl rejected access -- Steve Majewski From sdm7g@virginia.edu Mon Feb 5 19:46:32 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Mon, 5 Feb 2001 14:46:32 -0500 (EST) Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX In-Reply-To: Message-ID: Also: You can use Jython on OSX. Jython should have the same access to Cocoa classes that Java does. -- Steve Majewski From and_j_rob@yahoo.com Tue Feb 6 00:49:27 2001 From: and_j_rob@yahoo.com (Andrew Robbins) Date: Mon, 5 Feb 2001 16:49:27 -0800 (PST) Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX In-Reply-To: <20010205093328.D0330373C95@snelboot.oratrix.nl> Message-ID: <20010206004927.16434.qmail@web3601.mail.yahoo.com> --- Jack Jansen wrote: > MacOSX support is probably going to happen along two > lines. First of all I'm > busy with getting MacPython to run under Carbon, > which is now 99% done (I hope > to release a MacPython 2.1 alfa later this week or > early next week). I would > expect this to be the basis for MacPython for the > next year or so, for as long > as MacOS9 machines are still predominant. > > Eventually I expect the standard MacPython to be > based on the Unix Python, > with the MacOS extension modules thrown in. Some > people are already working on > getting the extensions to work, with reasonable > success (if I understand > correctly). > -- > Jack Jansen | ++++ stop the execution of > Mumia Abu-Jamal ++++ > Jack.Jansen@oratrix.com | ++++ if you agree copy > these lines to your sig ++++ > www.oratrix.nl/~jack | see > http://www.xs4all.nl/~tank/spg-l/sigaction.htm > > __________________________________________________ Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ From jack@oratrix.nl Tue Feb 6 09:16:04 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 06 Feb 2001 10:16:04 +0100 Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX In-Reply-To: Message by "Steven D. Majewski" , Mon, 5 Feb 2001 14:16:27 -0500 (EST) , Message-ID: <20010206091605.4FA88373C95@snelboot.oratrix.nl> > BTW: Jack, > Following the instructions on http://www.cwi.nl/~jack/macpython.html, > I still can't get access to your CVS of Python/Mac: > > cvs -d:pserver:ropython@pythoncvs.oratrix.nl:/hosts/mm/ login > (Logging in to ropython@pythoncvs.oratrix.nl) > CVS password: geheim > cvs [login aborted]: authorization failed: server pythoncvs.oratrix.nl > rejected access That's because you didn't read the page carefully enough:-) The path to use is /hosts/mm/CVSREMOTE, not /hosts/mm. I just tried it, and for me it works (i.e. let me know again if it doesn't for you). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From dma@andrew.cmu.edu Tue Feb 6 12:33:37 2001 From: dma@andrew.cmu.edu (David Andersen) Date: Tue, 06 Feb 2001 07:33:37 -0500 Subject: [Pythonmac-SIG] tkinter vs background In-Reply-To: <20010205071813.28800.qmail@web3602.mail.yahoo.com> Message-ID: <2192274342.981444817@DAWSON.PC.CC.CMU.EDU> I'm having various problems that appear to be a result of tkinter not playing well with others. Without getting into the gory details of my problem(s), here is a simple way to demonstrate the behavior I'm referring to. *) Run Guido's "hello.py" tkinter demo *) Move the "Hello World" window so as to obscure something in the background. *) Move the "Hello World" window away, leaving a part of the background in need of repainting. *) Wait for the repaint - I'm routinely seeing delays as long as 30-60 seconds. I don't understand this - naturally looking at this in the debugger screws everything up, but it does appear that HandleMacEvents in tclMacNotify is being called, and calling WaitNextEvent - what else is needed? From sdm7g@virginia.edu Tue Feb 6 14:22:27 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Tue, 6 Feb 2001 09:22:27 -0500 (EST) Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX In-Reply-To: <20010206091605.4FA88373C95@snelboot.oratrix.nl> Message-ID: On Tue, 6 Feb 2001, Jack Jansen wrote: > > BTW: Jack, > > Following the instructions on http://www.cwi.nl/~jack/macpython.html, > > I still can't get access to your CVS of Python/Mac: > > > > cvs -d:pserver:ropython@pythoncvs.oratrix.nl:/hosts/mm/ login > > (Logging in to ropython@pythoncvs.oratrix.nl) > > CVS password: geheim > > cvs [login aborted]: authorization failed: server pythoncvs.oratrix.nl > > rejected access > > That's because you didn't read the page carefully enough:-) > > The path to use is /hosts/mm/CVSREMOTE, not /hosts/mm. I just tried it, and > for me it works (i.e. let me know again if it doesn't for you). Thanks, Jack. It works. And I cut and pasted the address from the web browser to make *sure* I got it right! ( I should have looked to see that what I pasted was actually what I'd cut. I've run into this with MSIE before: what gets hilited on the screen doesn't seem to always correlate with what gets stuffed into the pasteboard. ) -- Steve M. From sburr@home.com Tue Feb 6 18:10:19 2001 From: sburr@home.com (Steven Burr) Date: Tue, 6 Feb 2001 11:10:19 -0700 Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX Message-ID: <20010206181028.BMYT5459.mail2.rdc1.az.home.com@localhost> On Monday, February 5, 2001, at 12:46 PM, Steven D. Majewski wrote: > Also: You can use Jython on OSX. Jython should have the same access=20 > to Cocoa classes that Java does. =20 Do you (or does anyone else on the list) have suggestions on installing = jython on Mac OSX PB? Using Terminal, I tried different variations of = the installation instructions from http://www.jython.org/install.html, = but kept getting the following error message: Exception in thread "main" java.lang.NoClassDefFoundError: = jython-20/class I've been writing python scripts in emacs or jEdit (a java application = that works well on OSX) and then running them from the command line, but = I would love to have an IDE for OSX. From sdm7g@virginia.edu Tue Feb 6 18:51:32 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Tue, 6 Feb 2001 13:51:32 -0500 (EST) Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX In-Reply-To: <20010206181028.BMYT5459.mail2.rdc1.az.home.com@localhost> Message-ID: On Tue, 6 Feb 2001, Steven Burr wrote: > Do you (or does anyone else on the list) have suggestions on > installing jython on Mac OSX PB? Using Terminal, I tried different > variations of the installation instructions from > http://www.jython.org/install.html, but kept getting the following > error message: > > Exception in thread "main" java.lang.NoClassDefFoundError: jython-20/class > I got an error (and I think it was *that* one) trying to install the beta, but jython-20 final installed with no problems for me, and it seems to work fine. (But I haven't tested it much -- I've been busy with CPython porting.) -- Steve Majewski From n.hinson@mail.uhs.utexas.edu Tue Feb 6 21:08:36 2001 From: n.hinson@mail.uhs.utexas.edu (Nathen Hinson) Date: Tue, 6 Feb 2001 15:08:36 -0600 Subject: [Pythonmac-SIG] BuildApplication in MacPython 2.0 Message-ID: To the list subscribers When running the BuildApplication program that is included in = the MacPython 2.0 distribution I receive a 'terminated' window with the = following output=20 Traceback (most recent call last):=0D File "Macintosh = HD:SWdev:Jack:Python:Mac:scripts:BuildApplication.py", line 147, in ?=0D = File "Macintosh HD:SWdev:Jack:Python:Mac:scripts:BuildApplication.py", = line 51, in main=0D File "Macintosh = HD:SWdev:Jack:Python:Mac:scripts:BuildApplication.py", line 73, in = buildapplication=0DValueError: unpack sequence of wrong size=0D Is this a known issue ? or is something wrong locally with my config ? = Any help would be greatly appreciated. Sincerely Nathen Hinson UHS - ITS= From sdm7g@virginia.edu Tue Feb 6 21:41:41 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Tue, 6 Feb 2001 16:41:41 -0500 (EST) Subject: [Pythonmac-SIG] MacPython CVS [was: Curiouser and curiouser...] In-Reply-To: <20010206091605.4FA88373C95@snelboot.oratrix.nl> Message-ID: Jack, I get part of the way thru checkout and I get this error message. Do you have any idea what's wrong ? -- Steve M. . . . U python/Mac/Distributions/src.exclude U python/Mac/Distributions/src.include CVSPRIVATE server: Updating python/Mac/Distributions/(vise) U python/Mac/Distributions/(vise)/Python 2.0.vct CVSPRIVATE server: Updating python/Mac/GUSI-mods CVSPRIVATE server: Updating python/Mac/GUSI-mods/into-include CVSPRIVATE server: Updating python/Mac/GUSI-mods/into-src CVSPRIVATE server: Updating python/Mac/IDE scripts U python/Mac/IDE scripts/ Hold option to open a script cvs [checkout aborted]: cannot rename file .new. Hold op to Hold option to open a script: Invalid argument From jack@oratrix.nl Tue Feb 6 22:14:57 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 06 Feb 2001 23:14:57 +0100 Subject: [Pythonmac-SIG] BuildApplication in MacPython 2.0 In-Reply-To: Message by Nathen Hinson , Tue, 6 Feb 2001 15:08:36 -0600 , Message-ID: <20010206221502.EE9BB11D109@oratrix.oratrix.nl> Recently, Nathen Hinson said: > To the list subscribers > > When running the BuildApplication program that is included in = > the MacPython 2.0 distribution I receive a 'terminated' window with the = > following output=20 > Traceback (most recent call last):=0D File "Macintosh = > HD:SWdev:Jack:Python:Mac:scripts:BuildApplication.py", line 147, in ?=0D = > File "Macintosh HD:SWdev:Jack:Python:Mac:scripts:BuildApplication.py", = > line 51, in main=0D File "Macintosh = > HD:SWdev:Jack:Python:Mac:scripts:BuildApplication.py", line 73, in = > buildapplication=0DValueError: unpack sequence of wrong size=0D > > Is this a known issue ? or is something wrong locally with my config ? = > Any help would be greatly appreciated. Well, it's known to me:-) the interact() function in BuildApplication.py was quickly fixed to get rid of 68k support, but this was done incorrectly. The first two lines of that function should read if PPC_ONLY: return 'pwpc', 1 -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From n.hinson@mail.uhs.utexas.edu Wed Feb 7 19:39:20 2001 From: n.hinson@mail.uhs.utexas.edu (Nathen Hinson) Date: Wed, 7 Feb 2001 13:39:20 -0600 Subject: [Pythonmac-SIG] Build Application.py issues Message-ID: To the list subscribers Thanks very much to Jack who had the answer to my last issue, = and I have gotten further along, however after finding the unused modules the = build application stops with an Attribute error on the following line: lib =3D cfmfile.CfrgResource(path) this is line 124 from macgen_bin.py. I could not find a function with = this name anywhere in the cfmfile.py. Again, have I done something = incorrectly ? Thank-you in advance Nathen Hinson UHS - ITS= From jack@oratrix.nl Thu Feb 8 13:02:19 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 08 Feb 2001 14:02:19 +0100 Subject: [Pythonmac-SIG] Build Application.py issues In-Reply-To: Message by Nathen Hinson , Wed, 7 Feb 2001 13:39:20 -0600 , Message-ID: <20010208130224.B4834FF2FD@oratrix.oratrix.nl> Recently, Nathen Hinson said: > To the list subscribers > > Thanks very much to Jack who had the answer to my last issue, = > and I > have gotten further along, however after finding the unused modules the = > build > application stops with an Attribute error on the following line: > > lib =3D cfmfile.CfrgResource(path) > > this is line 124 from macgen_bin.py. I could not find a function with = > this name anywhere in the cfmfile.py. Again, have I done something = > incorrectly ? Thank-you in advance Oops, it appears there's two cfmfile.py files in the MacPython distribution: one in :Mac:lib and one in :Mac:scripts. The one in the Lib folder is the correct one. If you have added the scripts folder to your search path it could be that you're getting the wrong one. I'll get rid of te other cfmfile.py for the next distribution. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From azeldis@plumbdesign.com Thu Feb 8 14:42:58 2001 From: azeldis@plumbdesign.com (Andrew Zeldis) Date: Thu, 8 Feb 2001 09:42:58 -0500 Subject: [Pythonmac-SIG] Curiouser and curiouser... About OSX References: Message-ID: <004e01c091dd$6e5cf680$9f804b3f@plumbdesign.com> > On Tue, 6 Feb 2001, Steven Burr wrote: > > > Do you (or does anyone else on the list) have suggestions on > > installing jython on Mac OSX PB? Using Terminal, I tried different > > variations of the installation instructions from > > http://www.jython.org/install.html, but kept getting the following > > error message: > > > > Exception in thread "main" java.lang.NoClassDefFoundError: jython-20/class You're typing "java jython-20.class" instead of "java jython-20". Be aware, tab-completion and java don't mix. I just did this yesterday, and it just made me think - one more stupid thing about java - a thought I don't think I've ever had about python. Once installed, it works great! From jarfish@media.mit.edu Mon Feb 12 17:19:28 2001 From: jarfish@media.mit.edu (Jared Schiffman) Date: Mon, 12 Feb 2001 12:19:28 -0500 Subject: [Pythonmac-SIG] embedding link errors Message-ID: <3A881B20.80893876@media.mit.edu> I'm trying to embed Python in my C/C++ application, using CodeWarrior 6.0. When I compile just C files, it all works fine. When I use a C++ file or just activate the C++ compiler, I get the following link error: Link Error : undefined 'PyMac_Initialize()' (code) And yes, I've included the PythonCore library. Any help on this topic would be thoroughly appreciated. thanks, Jared Schiffman ________________________________ aesethetics + computation group mit media lab From jack@oratrix.nl Tue Feb 13 14:22:06 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 13 Feb 2001 15:22:06 +0100 Subject: [Pythonmac-SIG] embedding link errors In-Reply-To: Message by Jared Schiffman , Mon, 12 Feb 2001 12:19:28 -0500 , <3A881B20.80893876@media.mit.edu> Message-ID: <20010213142206.5AB25371690@snelboot.oratrix.nl> > I'm trying to embed Python in my C/C++ application, > using CodeWarrior 6.0. > > When I compile just C files, it all works fine. When > I use a C++ file or just activate the C++ compiler, > I get the following link error: > > Link Error : undefined 'PyMac_Initialize()' (code) Have you included macglue.h? As Python is in C you need extern "C" { } brackets around the declaration if you want to use it from C++. macglue.h has those brackets. At least: I assume you're using MacPython 2.0, it could be that they were still missing from 1.5.2. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jarfish@media.mit.edu Tue Feb 13 22:09:27 2001 From: jarfish@media.mit.edu (Jared Schiffman) Date: Tue, 13 Feb 2001 17:09:27 -0500 Subject: [Pythonmac-SIG] project with embedded python Message-ID: <3A89B098.23C3FBC@media.mit.edu> I'm trying to embed Python in a full fledge C++ Mac application. Even without calling Python code, just including the PythonCore makes things crash. If anyone has a CodeWarrior project which uses regular Mac libraries and includes PythonCore (or a static Python lib), I would thoroughly appreciate seeing it. thanks, Jared Schiffman ________________________________ aesthetics + computation group mit media lab From tom@othermedia.com Wed Feb 14 09:44:56 2001 From: tom@othermedia.com (tom smith) Date: Wed, 14 Feb 2001 09:44:56 +0000 Subject: [Pythonmac-SIG] MacOX python In-Reply-To: <3A89B098.23C3FBC@media.mit.edu> Message-ID: about a week ago Jack said that OSX python might be ready in a week.... I've been counting the days off.... how's it going? tom From jack@oratrix.nl Wed Feb 14 11:18:04 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 14 Feb 2001 12:18:04 +0100 Subject: [Pythonmac-SIG] MacOX python In-Reply-To: Message by tom smith , Wed, 14 Feb 2001 11:13:54 +0000 , Message-ID: <20010214111804.E7582371690@snelboot.oratrix.nl> > on 2/14/01 10:51 AM, Jack Jansen at jack@oratrix.nl wrote: > > > And actually I like it so much that I think I'll keep it all to myself. Or > > maybe charge big bucks for it. > > Good idea (I'd get my company to pay small bucks for it), but for now where > the Public Beta? NONONONONONONONO!!!!! It was a joke!!! I'll be putting together an alfa distribution either later this week or early next week, time permitting. It will probably be Carbon-only (I think that's MacOS 8.6 or later, but I'm not sure), but the next distribution will give a choice of Carbon/Classic. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From tom@othermedia.com Wed Feb 14 11:37:05 2001 From: tom@othermedia.com (tom smith) Date: Wed, 14 Feb 2001 11:37:05 +0000 Subject: [Pythonmac-SIG] MacOX python In-Reply-To: <20010214111804.E7582371690@snelboot.oratrix.nl> Message-ID: > NONONONONONONONO!!!!! > > It was a joke!!! Oh good. I've nothing against people making money but I also appreciate and enjoy the open-source thing. > I'll be putting together an alfa distribution either later this week or early > next week, time permitting. It will probably be Carbon-only (I think that's > MacOS 8.6 or later, but I'm not sure), but the next distribution will give a > choice of Carbon/Classic. Incidentally, ( I shoulda guessed this ) but I upgraded to 9.1 and MacOSX Classic stopped running. So could I run MacOSXPython without Classic? Sorry for the dumb question. tom From jack@oratrix.nl Wed Feb 14 11:56:45 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 14 Feb 2001 12:56:45 +0100 Subject: [Pythonmac-SIG] MacOX python In-Reply-To: Message by tom smith , Wed, 14 Feb 2001 11:37:05 +0000 , Message-ID: <20010214115645.B4A97371690@snelboot.oratrix.nl> > Incidentally, ( I shoulda guessed this ) but I upgraded to 9.1 and MacOSX > Classic stopped running. I knew about this, that's why I didn't upgrade to 9.1 yet. > So could I run MacOSXPython without Classic? Yes, no problem. That's the whole point of the exercise. Actually, now that you have a non-functional classic box you're a real good guineapig: if anything depends on classic you're sure to notice it:-) -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From etienne@alias.it Wed Feb 14 17:25:06 2001 From: etienne@alias.it (Etienne Antoniutti Di Muro) Date: Wed, 14 Feb 2001 18:25:06 +0100 Subject: [Pythonmac-SIG] project with embedded python References: Message-ID: <3A8ABF71.C331D823@alias.it> Jared, > > Subject: [Pythonmac-SIG] project with embedded python > Date: Tue, 13 Feb 2001 17:09:27 -0500 > From: Jared Schiffman > To: pythonmac-sig@python.org > > I'm trying to embed Python in a full fledge > C++ Mac application. Even without calling Python > code, just including the PythonCore makes things > crash. Python 2.0 or previous?? I'm using Python 1.5.2 and works fine. > > If anyone has a CodeWarrior project which uses > regular Mac libraries and includes PythonCore > (or a static Python lib), I would thoroughly > appreciate seeing it. > I included in my project the following folders: :Include :Mac:Include of the Pythoin1.5.2 distribution and I linked the PythonCore against the CW prj. As I can remember (it happened more than a year ago) I build the Python Core on my own (a pretty damned job) with those folders. Later I used the same PythonCore with different include folders, and crashed. I had to rebuild the PythonCore with the upgraded include folders to get the project compiled,linked ......and running. Think this is quite obvious. hope this can help regards etienne -- it's time to leave this town it's time to steal away let's go get lost anywhere in the U.S.A. (RHCP) From erik@letterror.com Fri Feb 16 10:58:18 2001 From: erik@letterror.com (Erik van Blokland) Date: Fri, 16 Feb 2001 11:58:18 +0100 Subject: [Pythonmac-SIG] Numbers, strings Message-ID: <20010216115909-r01010600-29f4c383@192.168.128.7> Hi, This question is probably only half python-related. Is there a way to find out in Python what the local settings for numbers are in python? the values specified in MacOS control panel 'Numbers'. Background: I'm working on a python application that works alongside Filemaker Pro, floating point values are converted back and forth, works fine as long as everyone agrees on the Numbers format. The users of this app can have the 1,000.00 or 1.000,00 settings (or any other). The python app needs to find out how to interpret the imported values, and export them again. I can guess, but it's better to rely on system info. MacOS 9.0.4, python 1.5.2 Erik -- www.letterror.com Type & Typography From jack@oratrix.nl Fri Feb 16 11:32:41 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 16 Feb 2001 12:32:41 +0100 Subject: [Pythonmac-SIG] Numbers, strings In-Reply-To: Message by Erik van Blokland , Fri, 16 Feb 2001 11:58:18 +0100 , <20010216115909-r01010600-29f4c383@192.168.128.7> Message-ID: <20010216113241.90C97371690@snelboot.oratrix.nl> The conversion routines and such are in the Text Utilities manager. I think you should be able to call these through calldll. If you try this and it works: it would also be a much better example of calldll than what we have now (changing LMGetMenuFlash), so I wouldn't mind a donation of example code... If you don't want to do it this way you may be able to parse the "itl" resources, but I've never looked at this. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From loredo@spacenet.tn.cornell.edu Fri Feb 16 19:04:54 2001 From: loredo@spacenet.tn.cornell.edu (Tom Loredo) Date: Fri, 16 Feb 2001 14:04:54 -0500 (EST) Subject: [Pythonmac-SIG] Distributing modules, extensions & packages Message-ID: <200102161904.OAA10149@laplace.tn.cornell.edu> Hi folks- How should one best go about distributing modules, extensions, and packages for MacPython? Will distutils work with MacPython? If so, where will intalled files be placed? (I would guess in site-packages.) Is there any facility for handling extensions distributed as source code (e.g., scripting of the CodeWarrior IDE)? Since distutils is designed to work from a command line, I suspect it would be awkward to use with MacPython. Is simply distributing Python source and extension binaries in a folder with directions on where to place them the preferred distribution method for MacPython? I ask because I have some numerical extensions that may be of some general interest, and I also appear to have the ZODB and DocumentTemplate parts of Zope working with MacPython2.0 (but not very well tested yet). Thanks, Tom Loredo From jack@oratrix.nl Fri Feb 16 21:14:20 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 16 Feb 2001 22:14:20 +0100 Subject: [Pythonmac-SIG] Distributing modules, extensions & packages In-Reply-To: Message by Tom Loredo , Fri, 16 Feb 2001 14:04:54 -0500 (EST) , <200102161904.OAA10149@laplace.tn.cornell.edu> Message-ID: <20010216211425.CB079FF2FB@oratrix.oratrix.nl> Recently, Tom Loredo said: > > Hi folks- > > How should one best go about distributing modules, extensions, and > packages for MacPython? Will distutils work with MacPython? If so, > where will intalled files be placed? (I would guess in > site-packages.) Is there any facility for handling extensions > distributed as source code (e.g., scripting of the CodeWarrior IDE)? > Since distutils is designed to work from a command line, I suspect it > would be awkward to use with MacPython. Is simply distributing Python > source and extension binaries in a folder with directions on where to > place them the preferred distribution method for MacPython? The short answer: Distutils, Yes, site-packages, yes, yes, no, no. The long answer: distutils works and is fully supported from MacPython2.1, for which an alpha will be available shortly. The command-line problem has been solved with the new EasyDialogs.GetArgv() which works very nice with the distutils style of commandline arg processing (and reasonable with other packages). The one thing that I haven't had time to test yet is the bdist stuff. If that works well on the Mac I may take Numeric, img and PIL out of the standard distribution, or at the very least make it a lot easier to replace them with more recent versions when they become available (by putting them in the site-python folder). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From loredo@spacenet.tn.cornell.edu Fri Feb 16 21:59:29 2001 From: loredo@spacenet.tn.cornell.edu (Tom Loredo) Date: Fri, 16 Feb 2001 16:59:29 -0500 (EST) Subject: [Pythonmac-SIG] Distributing modules, extensions & packages Message-ID: <200102162159.QAA10271@laplace.tn.cornell.edu> Jack- > The short answer: Distutils, Yes, site-packages, yes, yes, no, no. Thanks a lot for the quick and informative response. > The long answer: distutils works and is fully supported from > MacPython2.1, for which an alpha will be available shortly. I currently use 2.0; I have also built some of the extensions for 1.5.2. I know many people are still using 1.5.2. What would be the appropriate distribution method for 1.5.2 and 2.0? Thanks, Tom From jack@oratrix.nl Fri Feb 16 21:51:35 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 16 Feb 2001 22:51:35 +0100 Subject: [Pythonmac-SIG] Distributing modules, extensions & packages In-Reply-To: Message by Tom Loredo , Fri, 16 Feb 2001 16:59:29 -0500 (EST) , <200102162159.QAA10271@laplace.tn.cornell.edu> Message-ID: <20010216215140.AE544FF2FB@oratrix.oratrix.nl> Recently, Tom Loredo said: > I currently use 2.0; I have also built some of the extensions for > 1.5.2. I know many people are still using 1.5.2. What would be the > appropriate distribution method for 1.5.2 and 2.0? Hmm, difficult to say. You could try porting the new EasyDialogs and the mkcwproject module to 1.5.2. Otherwise a stuffit archive with sources and a CW projectfile is probably best. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From tom@othermedia.com Sat Feb 17 13:35:01 2001 From: tom@othermedia.com (tom smith) Date: Sat, 17 Feb 2001 13:35:01 +0000 Subject: [Pythonmac-SIG] Numbers, strings In-Reply-To: <20010216115909-r01010600-29f4c383@192.168.128.7> Message-ID: on 2/16/01 10:58 AM, Erik van Blokland at erik@letterror.com wrote: > Background: I'm working on a python application that works alongside Filemaker > Pro Hang on a mo'. Are you talking to FileMaker via AppleEvents or ODBC? It's just that I'd be very interested if it was ODBC. From jack@oratrix.nl Sat Feb 17 22:28:25 2001 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 17 Feb 2001 23:28:25 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a2 available Message-ID: <20010217222830.0E009FF2FB@oratrix.oratrix.nl> Folks, the first alfa for MacPython 2.1 is available. This is the first in what will probably be a series of about 3 or 4 alfas for this release, hopefully in quick succession. The reason for this is Carbon support, which allows MacPython to run natively on MacOSX. I'm planning to announce the alfas only here on pythonmac-sig, but feel free to forward the information to other people you think could help debugging this. So, the good news is that this release supports Carbon, which is available on MacOS9 and MacOSX, and can be downloaded from the Apple site for MacOS 8.1 and onwards (you want CarbonLib 1.0.4, that's good enough for MacPython). The bad news is that this alfa is Carbon-only, the next one will include an optional Classic PPC interpreter again. Please try this version and report your findings here to pythonmac-sig, including the full version info of your OS and MacPython (needed because I expect to release alfas often). Things that are known not to work for this release: - Tkinter is missing - PIL and Numeric probably won't work - Setting both "delay console window" and "keep console open" can let you end up without a menubar. - Once in a while you get a spurious KeyboardInterrupt from nowhere. Things that are known not to work on OSX for this release: - The ConfigurePython script (run after the installer) fails, but this isn't too much of a problem. - Applets only work if they're in the Python folder. Does anyone know where shared libraries should be put on OSX to be found by all applications? - EditPythonPrefs crashes. If anyone wants to investigate: please. - The console window doesn't automatically scroll to the bottom until input is requested. Download it from http://www.cwi.nl/ftp/jack/python/mac/MacPython21a2carbon.bin and give it a try, -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | ++++ see http://www.xs4all.nl/~tank/ ++++ From jbmoody@oakland.edu Sat Feb 17 23:53:22 2001 From: jbmoody@oakland.edu (Jon Moody) Date: Sat, 17 Feb 2001 18:53:22 -0500 Subject: [Pythonmac-SIG] writing binary files with MacPython Message-ID: <20010217185322.A23931@oakland.edu> I'm using MacPython 2.0 under Mac OS 8.5.1 and I'm having trouble with creating binary files of short ints using MacPython. As a small example: >>> from array import array >>> a = array('h', [2678, 2689, 2699]) >>> open('tmp', 'w').write(a.tostring()) Then if I open this file using another Mac app (like RSI's Transform or IPLab), the file contains the numbers: 3446, 3457, 3467 The problem is not consistent; depending on what numbers are written to the file, sometimes they're correct, sometimes they're not when the file is opened by the external app. And the same thing happens if I write Numeric arrays to a binary file. What am I doing wrong? --- Jon From cwebster@nevada.edu Sun Feb 18 01:04:21 2001 From: cwebster@nevada.edu (Corran Webster) Date: Sat, 17 Feb 2001 17:04:21 -0800 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: <20010217222830.0E009FF2FB@oratrix.oratrix.nl> References: <20010217222830.0E009FF2FB@oratrix.oratrix.nl> Message-ID: At 11:28 PM +0100 17/2/01, Jack Jansen wrote: >Please try this version and report your findings here to >pythonmac-sig, including the full version info of your OS and >MacPython (needed because I expect to release alfas often). I just downloaded the 2.1 alpha, but can't get it to run at all - when I try t start any of the Python applications (IDE, Interpreter, whathever), I get am error dialog saying that the application could not be opened because "»CarbonLib«" could not be found. I'm running OS 9.1 on a Blue G3, with CarbonLib 1.1.1, which is properly installed and running, as far as I can tell. I'm not using the OS X Beta at all. Regards, Corran From w_keller@gmx.de Sun Feb 18 12:00:21 2001 From: w_keller@gmx.de (Wolfgang Keller) Date: Sun, 18 Feb 2001 13:00:21 +0100 Subject: [Pythonmac-SIG] Any chance for garbage collection in MacPython anytime soon? In-Reply-To: <20010217222830.0E009FF2FB@oratrix.oratrix.nl> References: <20010217222830.0E009FF2FB@oratrix.oratrix.nl> Message-ID: As I understand, Python 2 now includes "full" garbage collection, but MacPython (again, as I understand) does not yet include this. Is there any chance to see this implemented for MacPython anytime soon? Thanks in advance, best regards, Wolfgang From jwblist@olympus.net Mon Feb 19 05:14:30 2001 From: jwblist@olympus.net (John W Baxter) Date: Sun, 18 Feb 2001 21:14:30 -0800 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: References: <20010217222830.0E009FF2FB@oratrix.oratrix.nl> Message-ID: At 17:04 -0800 2/17/01, Corran Webster wrote: >At 11:28 PM +0100 17/2/01, Jack Jansen wrote: >>Please try this version and report your findings here to >>pythonmac-sig, including the full version info of your OS and >>MacPython (needed because I expect to release alfas often). > >I just downloaded the 2.1 alpha, but can't get it to run at all - >when I try t start any of the Python applications (IDE, Interpreter, >whathever), I get am error dialog saying that the application could >not be opened because "=BBCarbonLib=AB" could not be found. > >I'm running OS 9.1 on a Blue G3, with CarbonLib 1.1.1, which is >properly installed and running, as far as I can tell. I'm not using >the OS X Beta at all. The current CarbonLib (for at least the next few hours) is 1.2. It cleans up some of the problems in the CarbonLib which came with 9.1. [1.2 came out the same day as the 9.1 updater, but wasn't included.] Since Jack says CarbonLib 1.0.4 is new enough, getting 1.2 likely won't help= =2E --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jwblist@olympus.net Mon Feb 19 06:17:32 2001 From: jwblist@olympus.net (John W Baxter) Date: Sun, 18 Feb 2001 22:17:32 -0800 Subject: [Pythonmac-SIG] MacPython 2.1a2 available Message-ID: At 17:04 -0800 2/17/01, Corran Webster wrote: >At 11:28 PM +0100 17/2/01, Jack Jansen wrote: >>Please try this version and report your findings here to >>pythonmac-sig, including the full version info of your OS and >>MacPython (needed because I expect to release alfas often). > >I just downloaded the 2.1 alpha, but can't get it to run at all - >when I try t start any of the Python applications (IDE, Interpreter, >whathever), I get am error dialog saying that the application could >not be opened because "=BBCarbonLib=AB" could not be found. > >I'm running OS 9.1 on a Blue G3, with CarbonLib 1.1.1, which is >properly installed and running, as far as I can tell. I'm not using >the OS X Beta at all. I'm getting the same error (except that the wording is =BBCarbonLib=AB could not start up). Mac OS 9.1 with CarbonLib 1.2. 8100/80. Something was absorbing most available cycles after the installer claimed to have finished. I think we've done this before. The error starting up the Interpreter was after the forced restart and resultant cleanup. (Going away for long time would probably have avoided the forced restart.) --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jack@oratrix.nl Mon Feb 19 09:23:11 2001 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 19 Feb 2001 10:23:11 +0100 Subject: [Pythonmac-SIG] writing binary files with MacPython In-Reply-To: Message by Jon Moody , Sat, 17 Feb 2001 18:53:22 -0500 , <20010217185322.A23931@oakland.edu> Message-ID: <20010219092319.46F57371690@snelboot.oratrix.nl> > I'm using MacPython 2.0 under Mac OS 8.5.1 and I'm having trouble with > creating binary files of short ints using MacPython. As a small > example: > > >>> from array import array > >>> a = array('h', [2678, 2689, 2699]) > >>> open('tmp', 'w').write(a.tostring()) If you open a binary file you should specify 'wb' as the flag (or 'rb' for reading). On Unix this isn't important, but on Mac and Windows it is. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jack@oratrix.nl Mon Feb 19 09:27:37 2001 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 19 Feb 2001 10:27:37 +0100 Subject: [Pythonmac-SIG] Any chance for garbage collection in MacPython anytime soon? In-Reply-To: Message by Wolfgang Keller , Sun, 18 Feb 2001 13:00:21 +0100 , Message-ID: <20010219092739.ABE25371690@snelboot.oratrix.nl> > As I understand, Python 2 now includes "full" garbage collection, but > MacPython (again, as I understand) does not yet include this. > > Is there any chance to see this implemented for MacPython anytime soon? The problem is that this is a compile-time option, so enabling this would enable it for everyone, always. At the time of 2.0 it was still an "opt in" feature for standard Python, i.e. the code was there but it wasn't enabled by default. I haven't checked for 2.1 yet. I tend to view opt-in features as still somewhat experimental, so whether I include them depends on whether I want them myself (because if I want them myself I can be reasonably sure they've had at least some testing before the distribution). If more people think that the garbage collection mods are really worth it I'll see if I can enable them. Let me know. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jack@oratrix.nl Mon Feb 19 09:35:06 2001 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 19 Feb 2001 10:35:06 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: Message by John W Baxter , Sun, 18 Feb 2001 22:17:32 -0800 , Message-ID: <20010219093506.69869371690@snelboot.oratrix.nl> Hmm, so it seems CarbonLib's are not all equal. What we apparently have so far is MacOS 9.0.4, CarbonLib 1.0.4: Works (Jack) MacOS 9.1, CarbonLib 1.1.1: CarbonLib could not be found (Corran) MacOS 9.1, CarbonLib 1.2: CarbonLib could not start up (John) If people have situations to add to this list, or different results for t= hese = combinations, please let us know. I can't convert to 9.1 on my main machi= nes = (because 9.1 and OSX don't mix) but I may have another machine I can put = 9.1 = on. But I don't really want to put the whole CodeWarrior suite, etc on th= ere = as well... > Something was absorbing most available cycles after the installer claim= ed > to have finished. I think we've done this before. Note that this is a different (and well-known) problem: the installer has= to = tell the finder to look at the 2000 files it just dumped on the disk. = According to Mindvision you shoulnd't abort this process, and if you do y= ou = should do a rebuild desktop. This may also clear the other problems you'v= e had. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++= Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig = ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.= htm = From sdm7g@virginia.edu Mon Feb 19 16:57:17 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Mon, 19 Feb 2001 11:57:17 -0500 (EST) Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: <20010217222830.0E009FF2FB@oratrix.oratrix.nl> Message-ID: On OSX PB with MacPython your first alfa of MacPython 2.1a2: EasyDialogs.test() crashes from both the python interpreter and the IDE. On starting the IDE, I get the message: XXX killed unknown (crashed?) Python window. in the output window. If I try to call Win.NewCWindow( ... ) the window briefly appears and disappears, with that same message repeated again in the output window. (If I do the same from Python interpreter, the window doesn't disappear) There are a bunch of cosmetic glicthes in the IDE: text doesn't fit in buttons, outline around default button doesn't quite match the button, et.al. But, I'm quite amazed that you got this far Jack -- great start! ( Are you using CW6 for this ? I haven't upgraded mine, but if it's really working well under OSX I may do so. Does their debugger work under OSX ? They don't support mach-o output yet, do they? ) I'm sure I'll poke around on it some more. I saw some instructions a while back on one of the OSX lists on how to coerce gdb to work for CFM apps. If I can find that and get it to work, I'll try to get you some more useful info. -- Steve From brady@mmm.com Mon Feb 19 19:02:27 2001 From: brady@mmm.com (mark brady) Date: Mon, 19 Feb 2001 11:02:27 -0800 Subject: [Pythonmac-SIG] Cursors Message-ID: I am trying to change my cursor to something besides an arrow using Tkinter. Supposedly, there is a cursor option for all widgets. However, none of the options values are being accepted. I have tried the values listed in the Unix cursorfont file as well as those listed in the book Python and Tkinter. What option values, if any, will work? I'm running Python 2.0 -Mark From jwblist@olympus.net Mon Feb 19 21:08:25 2001 From: jwblist@olympus.net (John W Baxter) Date: Mon, 19 Feb 2001 13:08:25 -0800 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: <20010219093506.69869371690@snelboot.oratrix.nl> References: <20010219093506.69869371690@snelboot.oratrix.nl> Message-ID: At 10:35 +0100 2/19/01, Jack Jansen wrote: >Note that this is a different (and well-known) problem: the installer has to >tell the finder to look at the 2000 files it just dumped on the disk. >According to Mindvision you shoulnd't abort this process, and if you do you >should do a rebuild desktop. This may also clear the other problems you've >had. Ah, yes...I remember now. Thanks. -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jack@oratrix.nl Tue Feb 20 09:52:14 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 20 Feb 2001 10:52:14 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: Message by "Steven D. Majewski" , Mon, 19 Feb 2001 11:57:17 -0500 (EST) , Message-ID: <20010220095215.60666371690@snelboot.oratrix.nl> > EasyDialogs.test() crashes from both the python interpreter and the IDE. Ok, will look into this. > On starting the IDE, I get the message: > XXX killed unknown (crashed?) Python window. > in the output window. Yes, this also happens on OS9. I'll have a look. > > If I try to call Win.NewCWindow( ... ) > the window briefly appears and disappears, with that same message > repeated again in the output window. > > (If I do the same from Python interpreter, the window doesn't disappear) The former is expected (IDE kills any windows it doesn't know, because they mess up the redraw scheme), the latter not. Could you try a bit more elaborate test (maybe something from Demo, or FrameWork)? > There are a bunch of cosmetic glicthes in the IDE: text doesn't fit > in buttons, outline around default button doesn't quite match the > button, et.al. I know, I'm leaving this until later. Everyone ships their OSX apps with text not fitting in buttons:-) > But, I'm quite amazed that you got this far Jack -- great start! > ( Are you using CW6 for this ? I haven't upgraded mine, but if it's > really working well under OSX I may do so. Does their debugger > work under OSX ? They don't support mach-o output yet, do they? ) Yes, this is with CW6. The debugger sometimes works. On Mondays and wednesdays it works in the morning, and some other days it will work if you try it 3 times, that sort of thing. There appears to be a difference between the two public beta developer tools versions, it works more often on my work machine than at home. I think they have macho tools in their "use at your own risk" folder, but I'm not sure. > I'm sure I'll poke around on it some more. I saw some instructions > a while back on one of the OSX lists on how to coerce gdb to work > for CFM apps. If I can find that and get it to work, I'll try to > get you some more useful info. Yes! That would be very useful for tuesdays, thursdays and fridays:-) -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From brady@mmm.com Tue Feb 20 17:14:04 2001 From: brady@mmm.com (mark brady) Date: Tue, 20 Feb 2001 09:14:04 -0800 Subject: [Pythonmac-SIG] Any chance for garbage collection in MacPython anytime soon? Message-ID: If we don't currently have garbage collection, does this mean that using the del function does not free some memory? If so, then we have a sort of built in memory leak in any program which repeatedly allocates and frees memory. -Mark From jack@oratrix.nl Tue Feb 20 15:31:32 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 20 Feb 2001 16:31:32 +0100 Subject: [Pythonmac-SIG] Any chance for garbage collection in MacPython anytime soon? In-Reply-To: Message by mark brady , Tue, 20 Feb 2001 09:14:04 -0800 , Message-ID: <20010220153133.DE23F371690@snelboot.oratrix.nl> > > If we don't currently have garbage collection, does this mean that > using the del function does not free some memory? Yes and no. We don't have garbage collection but we have refcounting, so as soon as no references to an object exist anymore the object dies and its memory is freed. If two nodes have a reference to one another, however, and nothing else references them they cannot be cleanup up by the refcounting scheme. The garbage collection mods take care of this: any group of objects that have references only to each other but nothing in the "outside world" still references them can be cleaned up. The "no" bit is a bit more complex: the memory is freed when the object dies, but only for reuse by other Python objects. The memory isn't returned to MacOS. > If so, then we have a sort of built in memory leak in any program > which repeatedly allocates and frees memory. No, no problem here. The object is freed when the last reference goes away, and the memory is then reused for the next object. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jack@oratrix.nl Tue Feb 20 15:58:37 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 20 Feb 2001 16:58:37 +0100 Subject: [Pythonmac-SIG] Anyone else tried the 2.1a2? Message-ID: <20010220155909.B73E0371690@snelboot.oratrix.nl> So far only 4 people have reported that they tried the 2.1a2 distribution. Is everyone else too busy, uninterested, or what? I'd be especially interested in reports from people who run something else than 9.1 (in the hope that the problems are 9.1-only). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | ++++ see http://www.xs4all.nl/~tank/ ++++ From jbmoody@oakland.edu Tue Feb 20 17:13:04 2001 From: jbmoody@oakland.edu (Jon Moody) Date: Tue, 20 Feb 2001 12:13:04 -0500 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: <20010217222830.0E009FF2FB@oratrix.oratrix.nl>; from jack@oratrix.nl on Sat, Feb 17, 2001 at 11:28:25PM +0100 References: <20010217222830.0E009FF2FB@oratrix.oratrix.nl> Message-ID: <20010220121304.A27405@oakland.edu> System: MacOS 8.5.1 (CarbonLib 1.0.4) MacPython: 2.1a2 (200 MB memory partition) test.autotest results ===================== 96 tests OK. 3 tests failed: test_gzip test_longexp test_socket tracebacks ========== >>> import test.test_gzip Traceback (most recent call last): File "", line 1, in ? File "mac:python 2.1a2:lib:test:test_gzip.py", line 19, in ? f = gzip.GzipFile(filename, 'wb') ; f.write(data1 * 50) ; f.close() File "mac:python 2.1a2:lib:gzip.py", line 67, in __init__ self._write_gzip_header() File "mac:python 2.1a2:lib:gzip.py", line 90, in _write_gzip_header write32u(self.fileobj, long(time.time())) File "mac:python 2.1a2:lib:gzip.py", line 22, in write32u output.write(struct.pack(">> import test.test_longexp Traceback (most recent call last): File "", line 1, in ? File "mac:python 2.1a2:lib:test:test_longexp.py", line 3, in ? l = eval("[" + "2," * REPS + "]") MemoryError >>> import test.test_socket socket.error Traceback (most recent call last): File "", line 1, in ? File "mac:python 2.1a2:lib:test:test_socket.py", line 71, in ? hname, aliases, ipaddrs = socket.gethostbyaddr(ip) socket.error: host not found ====================================================================== From bkenniso@att.net Tue Feb 20 17:51:14 2001 From: bkenniso@att.net (bkenniso@att.net) Date: Tue, 20 Feb 2001 12:51:14 -0500 (EST) Subject: [Pythonmac-SIG] OSA Range references Message-ID: <200102201751.MAA01670@Brian.goodhome.org> Everyone, First,I'm not a developer but a user, and I want to thank all of you who make my use of Python on the Mac possbile. As I gain more knowledge I hope to be able to contribute in some fashion. I'm currently having a problem figuring out how to specify "ranges" when using AppleEvents. I've created a FMPro module and am running it interactively. I've been testing out as many aspects of this as I can but have yet to figure out how to ask for a range of objects. If I ask for a specific record there is no problem: >>> db.get_data(record(1)) ['Bob','Jones'] but if I ask for a range of records I get >>> db.get_data(record(Range(1,3)) [snip] aetools.Error: (-1703 'Wrong data type.', None) I've searched the docs and the web trying to find an example of how to specify ranges with no luck. Perhaps someone might be able to give me a quick example or to point me where I should look to see how aepack actually formats this. Thanks for your time and thanks for making Python availble on the Mac. Brian Kennison From web_oas@azarcon.net Tue Feb 20 17:51:58 2001 From: web_oas@azarcon.net (web_oas@azarcon.net) Date: Tue, 20 Feb 2001 12:51:58 -0500 Subject: [Pythonmac-SIG] 2.1a2 fails on 9.04 and Carbon 1.2.5f2 In-Reply-To: <20010220155909.B73E0371690@snelboot.oratrix.nl> References: <20010220155909.B73E0371690@snelboot.oratrix.nl> Message-ID: At 4:58 PM +0100 2/20/01, Jack Jansen wrote: >everyone else too busy, uninterested, or what? I'd be especially interested in >reports from people who run something else than 9.1 (in the hope that the >problems are 9.1-only). Hi Jack! PBG3 (Wallstreet) OS 9.0.4 CarbonLib 1.2.5f2 Error message after installation: The application "ConfigurePython" could not be opened because ">>CarbonLib<<" could not be found. Thanks! Eric From tom@othermedia.com Tue Feb 20 18:13:39 2001 From: tom@othermedia.com (tom smith) Date: Tue, 20 Feb 2001 18:13:39 +0000 Subject: [Pythonmac-SIG] OSA Range references In-Reply-To: <200102201751.MAA01670@Brian.goodhome.org> Message-ID: on 2/20/01 5:51 PM, bkenniso@att.net at bkenniso@att.net wrote: >>>> db.get_data(record(Range(1,3)) it's difficult to say without seeing your get_data() function. I can't remember whether FileMaker has a call where you could pass it a list of integers... If there is, I imagine you might have to use some aetools to build a list aeobject... then again , you could always... result_list = [] for i in range(1,10): record = db.get_data(i) result_list.append(record) return result_list ...which would make successive hits on the database. From adv.files@robbstucky.com Tue Feb 20 19:37:50 2001 From: adv.files@robbstucky.com (Advertising) Date: Tue, 20 Feb 2001 14:37:50 -0500 Subject: [Pythonmac-SIG] re: testing 2.1a2 Message-ID: <200102201932.LAA18024@hawk.prod.itd.earthlink.net> I'm confused. I thought the 2.1a2 release was for people running the new Carbon. (OS9 & OSX) We're still running MacOS 7.61, 8-8.6x using MacPython 2.0 Can we try out 2.1a2 even though many of our machines don't or can't have Carbon? (Carbon, as well as new versions of MacOS, bombs our proprietary legacy systems - I love closed proprietary systems, don't you - sarcasm) From sdm7g@virginia.edu Tue Feb 20 18:59:26 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Tue, 20 Feb 2001 13:59:26 -0500 (EST) Subject: [Pythonmac-SIG] 2.1a2 dies on 9.0 with Illegal Instruction In-Reply-To: <20010220155909.B73E0371690@snelboot.oratrix.nl> Message-ID: On my 8500 running 9.0, PythonMac 2.1a2-Carbon dies shorty after displaying it's interpreter window with an illegal instruction. It looked like it died in the middle of writing it's startup banner + prompt -- and the stack trace does have some references to fprintf, __pformatter, __FileWrite, fwrite, ... and some GUSI functions. ( I can send you a StdLog if you want it. ) -- Steve Majewski From jack@oratrix.nl Tue Feb 20 20:58:23 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 20 Feb 2001 21:58:23 +0100 Subject: [Pythonmac-SIG] re: testing 2.1a2 In-Reply-To: Message by Advertising , Tue, 20 Feb 2001 14:37:50 -0500 , <200102201932.LAA18024@hawk.prod.itd.earthlink.net> Message-ID: <20010220205829.A9B9411CA25@oratrix.oratrix.nl> Recently, Advertising said: > I'm confused. > I thought the 2.1a2 release was for people running the new Carbon. (OS9 & > OSX) You're right, you can't try the new Python unless you have OS9 or later, or installed CarbonLib in OS8.X. So you're excused until the next alfa:-) -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jack@oratrix.nl Tue Feb 20 21:01:44 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 20 Feb 2001 22:01:44 +0100 Subject: [Pythonmac-SIG] OSA Range references In-Reply-To: Message by bkenniso@att.net , Tue, 20 Feb 2001 12:51:14 -0500 (EST) , <200102201751.MAA01670@Brian.goodhome.org> Message-ID: <20010220210149.F002E11CA25@oratrix.oratrix.nl> Recently, bkenniso@att.net said: > I'm currently having a problem figuring out how to specify "ranges" > when using AppleEvents. I've created a FMPro module and am running > it interactively. I've been testing out as many aspects of this as > I can but have yet to figure out how to ask for a range of objects. > > If I ask for a specific record there is no problem: > > >>> db.get_data(record(1)) ['Bob','Jones'] > > but if I ask for a range of records I get > > >>> db.get_data(record(Range(1,3)) > [snip] > aetools.Error: (-1703 'Wrong data type.', None) This could well be a result of my lack of understanding how these Range() things work. (Not to mention the Test()s and such, which are worse:-). Tom's workaround is of course an option, but I'd also be interested in hearing from people who've used Range() objects succesfully, or who can tell me what is wrong with the implementation. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jack@oratrix.nl Tue Feb 20 21:05:42 2001 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 20 Feb 2001 22:05:42 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: Message by Jon Moody , Tue, 20 Feb 2001 12:13:04 -0500 , <20010220121304.A27405@oakland.edu> Message-ID: <20010220210548.8563F11CA25@oratrix.oratrix.nl> Recently, Jon Moody said: > System: MacOS 8.5.1 (CarbonLib 1.0.4) > MacPython: 2.1a2 (200 MB memory partition) > > > test.autotest results > ===================== > 96 tests OK. > 3 tests failed: test_gzip test_longexp test_socket Thanks for the report. These tests are known to fail, it should be mentioned in the readme file, I think. The better news is that it seems you're the first person to actually be able to get this far, aside from myself. And it seems you're also using CarbonLib 1.0.4, so I'm getting the impression that the exact version of CarbonLib is somehow important here. Does anyone happen to know of a source of information on compatibility of the various CarbonLib versions? -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jbmoody@oakland.edu Tue Feb 20 21:27:10 2001 From: jbmoody@oakland.edu (Jon Moody) Date: Tue, 20 Feb 2001 16:27:10 -0500 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: <20010220210548.8563F11CA25@oratrix.oratrix.nl>; from jack@oratrix.nl on Tue, Feb 20, 2001 at 10:05:42PM +0100 References: <20010220210548.8563F11CA25@oratrix.oratrix.nl> Message-ID: <20010220162710.C27405@oakland.edu> On Tue, Feb 20, 2001 at 10:05:42PM +0100, Jack Jansen wrote: > > Recently, Jon Moody said: > > System: MacOS 8.5.1 (CarbonLib 1.0.4) > > MacPython: 2.1a2 (200 MB memory partition) > > > > > > test.autotest results > > ===================== > > 96 tests OK. > > 3 tests failed: test_gzip test_longexp test_socket > > Thanks for the report. These tests are known to fail, it should be > mentioned in the readme file, I think. The README file says that these tests may fail with MemoryErrors; only test_longexp fails with a MemoryError, although I've given MacPython a kinda giant memory partition (200MB). It looks like test_gzip is failing because time.time() is returning a negative number; test_socket fails with a socket.error even though I have an internet connection. From n.hinson@mail.uhs.utexas.edu Tue Feb 20 22:04:18 2001 From: n.hinson@mail.uhs.utexas.edu (Nathen Hinson) Date: Tue, 20 Feb 2001 16:04:18 -0600 Subject: [Pythonmac-SIG] Re: Python 2.1a2 Message-ID: This note is in response to Jack's request for more users of 2.1a2: I have downloaded and installed the whole package without = incident. I am running an OS X Public Beta ( no updates ) on a G3 400 = Powerbook.=20 I do get the previously reported error of "XXX killed unknown (crashed?) = Python window." when launching the IDE.=20 I have not actually used it to work on anything yet, so I do not have = alot of useful insights at the moment, just wanted to let Jack know that = it seems to be working well.=20= From bkenniso@att.net Tue Feb 20 23:24:19 2001 From: bkenniso@att.net (bkenniso@att.net) Date: Tue, 20 Feb 2001 18:24:19 -0500 (EST) Subject: [Pythonmac-SIG] re: OSA Range references Message-ID: <200102202324.SAA01768@Brian.goodhome.org> tom smith tom@othermedia.com Tue, 20 Feb 2001 18:13:39 +0000 >it's difficult to say without seeing your get_data() function. I can't >remember whether FileMaker has a call where you could pass it a list of >integers... If there is, I imagine you might have to use some aetools to >build a list aeobject... > >then again , you could always... > >result_list = [] > >for i in range(1,10): > record = db.get_data(i) > result_list.append(record) > >return result_list > >...which would make successive hits on the database. > Thanks for your response. I don't know much about this stuff but this is what I've figured out so far from playing around and from the docs in the distribution. The get_data function is generated by the gensuite.py module and is an "event" for this package. All appleEvents have get passed the same parameters: (self,_object,_attributes={},**_arguments) Along with the "events" the gensuite modules generates classes for the objects contained in the application. In my case I working with database records hence the record() class. These object classes help you express the type of object you want to work with and I've been fairly succesful is finding the syntax for expressing those objects. Along with the object created for the application there are "generic" types that are imported through aetools from aetypes. I can say db.get_data(record(Ordinal("first")) and get the first record but when I use the Range() class from aetypes I get the error. The last parameter is a set of keyword args contained in _argmap_ varible generated by gensuite and I've been able to use them such as: db.count(database(1),_class="crow")) which returns the count of records in database 1. There is an element dictionary where you can lookup element codes ("crow") using the full name of the element ("record"). I have yet to figure out how to use that 3rd param and wonder if that might be the key. I also have yet to figure out "whose" or "where" clauses. The the events definitions then call the "send" method inherited from aetools which calls the "sendevent" method which packs the parameters passed to the event. I guess I'll have to dig deeper into what these pack methods actually do. Again, thanks for you response, -- Brian From billb@mousa.demon.co.uk Wed Feb 21 01:04:14 2001 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Wed, 21 Feb 2001 01:04:14 +0000 Subject: [Pythonmac-SIG] OSA Range references In-Reply-To: <200102201751.MAA01670@Brian.goodhome.org> References: <200102201751.MAA01670@Brian.goodhome.org> Message-ID: <860390506706062710254@mousa.demon.co.uk> At 12:51 pm -0500 20/02/01, bkenniso@att.net wrote: >Everyone, > >First,I'm not a developer but a user, and I want to thank all of >you who make my use of Python on the Mac possbile. As I gain more >knowledge I hope to be able to contribute in some fashion. > >I'm currently having a problem figuring out how to specify "ranges" >when using AppleEvents. I've created a FMPro module and am running >it interactively. I've been testing out as many aspects of this as >I can but have yet to figure out how to ask for a range of objects. > >If I ask for a specific record there is no problem: > >>>> db.get_data(record(1)) ['Bob','Jones'] > >but if I ask for a range of records I get > >>>> db.get_data(record(Range(1,3)) >[snip] >aetools.Error: (-1703 'Wrong data type.', None) > >I've searched the docs and the web trying to find an example of >how to specify ranges with no luck. Perhaps someone might be able >to give me a quick example or to point me where I should look to >see how aepack actually formats this. > Range in appleevents is a record (Python = dictionary) with the keys 'star' and 'stop' and the values object specifiers. Python simplifies this to slightly in that you only have to specify the objects. So your line should read (and I haven't tested this):- >>>> db.get_data(record(Range(cell(1),cell(3))) -- Bill Bedford One of the universal rules of happiness is: always be wary of any helpful item that weighs less than its operating manual. From jack@oratrix.nl Wed Feb 21 14:25:54 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 21 Feb 2001 15:25:54 +0100 Subject: [Pythonmac-SIG] Where to install on MacOSX, and with what permissions In-Reply-To: Message by "Tattoo Mabonzo K." , Wed, 21 Feb 2001 15:08:01 +0100 , <200102211408.f1LE83Q01641@metis.microscript.be> Message-ID: <20010221142556.852E4371690@snelboot.oratrix.nl> tmk's trouble with not being able to write in the Python home folder rais= es an = interesting point: where should we install MacPython on OSX, and with wha= t = permissions? If we install in a directory that is not world-writeable the installer sh= ould = also take care of pre-compiling all modules, because mere mortal users wi= ll = not be able to write the .pyc and .pyo files on the fly. Does anyone has any insights to share? -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++= Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig = ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.= htm = From tmk@easynet.be Wed Feb 21 15:02:16 2001 From: tmk@easynet.be (Tattoo Mabonzo K.) Date: Wed, 21 Feb 2001 16:02:16 +0100 Subject: [Pythonmac-SIG] time and MacPython 2.1a2 Message-ID: <200102211502.f1LF2G101683@metis.microscript.be> --Apple-Mail-616727086-7 content-transfer-encoding: quoted-printable content-type: text/plain; charset=us-ascii Yo, I've just noticed that on Mac OS X PB, time.time() as well as some = related time functions (os.path.getmtime()) return *negative* values. = The doc says that time.time() expected behavior is to=20 " Return the time as a floating point number expressed in seconds since = the epoch, in UTC. Note that even though the time is always returned as = a floating point number, not all systems provide time with a better = precision than 1 second. " time.gmtime(0) returns (1903, 12, 31, 23, 0, 0, 3, 365, 0) which is Thu = Dec 31, 1903 23:00:00 as the epoch both on Mac OS X PB et on Python 2.0 = on Mac OS 9.1.=20 I'd expect that time.time() would yield a positive value.=20 On OS XP: t =3D time.time() -> -1229352415.5447249 time.asctime(time.localtime(t)) -> 'Wed Feb 21 15:41:21 2001' On Mac OS 9.1 (MacPython 2.0) t =3D time.time() -> 3065614820.2202692 time.asctime(time.locatime(time.time()) -> 'Wed Feb 21 15:40:20 2001' =3D tmk =3D PS: Jack, I'm cc'ing you because I don't see my posts making it to the = list.= --Apple-Mail-616727086-7 content-transfer-encoding: quoted-printable content-type: text/enriched; charset=us-ascii <= flushleft>Helvetica28L;56L;8= 4L;112L;140L;168L;196L;224L;252L;280L;308L;336L;Yo, I've just noticed that on Mac OS X PB, time.time() as well as some = related time functions (os.path.getmtime()) return *negative* values. = The doc says that = time.Trebuchet = MS28L;56L;84L;112L;140L;168L;196L;224L;252L;280= L;308L;336L;time() expected behavior is to=20 " Return the time as a floating point number expressed in seconds since = the epoch, in UTC. Note that even though the time is always returned as = a floating point number, not all systems provide time with a better = precision than 1 second. = "Helvetica28L;56L;84L;112L;140L;168L;196L;224L;252L;280L;308L;336L; time.gmtime(0) returns (1903, 12, 31, 23, 0, 0, 3, 365, 0) which is Thu = Dec 31, 1903 23:00:00 as the epoch both on Mac OS X PB et on Python 2.0 = on Mac OS 9.1.=20 I'd expect that time.time() would yield a positive value.=20 On OS XP: t =3D time.time() -> -1229352415.5447249 time.asctime(time.localtime(t)) -> 'Wed Feb 21 15:41:21 2001' On Mac OS 9.1 (MacPython 2.0) t =3D time.time() -> 3065614820.2202692 time.asctime(time.locatime(time.time()) -> 'Wed Feb 21 15:40:20 2001' =3D tmk =3D PS: Jack, I'm cc'ing you because I don't see my posts making it to the = list.= --Apple-Mail-616727086-7-- From tmk@easynet.be Wed Feb 21 15:02:30 2001 From: tmk@easynet.be (Tattoo Mabonzo K.) Date: Wed, 21 Feb 2001 16:02:30 +0100 Subject: [Pythonmac-SIG] Where to install on MacOSX, and with what permissions Message-ID: <200102211502.f1LF2Vv01686@metis.microscript.be> Yo, Maybe there's a clear Apple guideline about this but my guess would be = that it may install somewhere under /Users/Public which is = world-writeable and desktop-visible (!?) (the standard /usr/local = directory not being desktop-visible by default. =3D tmk =3D On Wednesday, February 21, 2001, at 03:25 PM, Jack Jansen wrote: > tmk's trouble with not being able to write in the Python home folder = raises an =20 > interesting point: where should we install MacPython on OSX, and with = what =20 > permissions?=20 > =20 > If we install in a directory that is not world-writeable the installer = should =20 > also take care of pre-compiling all modules, because mere mortal users = will =20 > not be able to write the .pyc and .pyo files on the fly.=20 > =20 > Does anyone has any insights to share?=20 > --=20 > Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal = ++++=20 > Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your = sig ++++=20 > www.oratrix.nl/~jack | see = http://www.xs4all.nl/~tank/spg-l/sigaction.htm =20 > =20 > =20 > =20 > _______________________________________________=20 > Pythonmac-SIG maillist - Pythonmac-SIG@python.org=20 > http://mail.python.org/mailman/listinfo/pythonmac-sig=20 > =20 > =20 From tmk@easynet.be Wed Feb 21 11:10:22 2001 From: tmk@easynet.be (Tattoo Mabonzo K.) Date: Wed, 21 Feb 2001 12:10:22 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a2 available Message-ID: <200102211110.f1LBANk01015@metis.microscript.be> Wowwww! Kudos to you Jack!!!!.=20 MacPython is 80% of the reasons why I still use Mac OS 9.x :-). I'm running it (MacPython 2.1a2) on my PB G3-500 running Mac OS X Build = 2E14. Installation went like a cinch except for the ConfigurePython script = failing as advertized. These last months I've spent +70% of my time in PythonIDE. So I've = developed an expectation to wait a bit when (re)lauching the IDE. My = first impression after launching MacPython 2.1a2 was that it *seemed* = quite faster. Especially text display which seems quite faster (is it = just an impression or can others confirm this too?) Running the IDE I as soon as I do some editing, I get the same error: = 'IndexError: list index out of range' 'File "Wtext.py", line 455, in can_undo=0D which, redo =3D = self.ted.WEGetUndoInfo()=0D which =3D UNDOLABELS[which]=0D= --- The problem is that which contains the value '9' while UNDOLABELS only = has 8 elements Other than that I noticed the same problems already pointed to by = Steven. Next step helping debugging EditPythonPrefs crashes. =3D tmk =3D On Saturday, February 17, 2001, at 11:28 PM, Jack Jansen wrote: > Folks,=20 > the first alfa for MacPython 2.1 is available.=20 > This is the first in what will probably be a series of about 3 or 4=20 > alfas for this release, hopefully in quick succession. The reason for=20= > this is Carbon support, which allows MacPython to run natively on=20 > MacOSX. I'm planning to announce the alfas only here on pythonmac-sig, = =20 > but feel free to forward the information to other people you think=20 > could help debugging this.=20 > =20 > So, the good news is that this release supports Carbon, which is=20 > available on MacOS9 and MacOSX, and can be downloaded from the Apple=20= > site for MacOS 8.1 and onwards (you want CarbonLib 1.0.4, that's good=20= > enough for MacPython).=20 > The bad news is that this alfa is Carbon-only, the next one will=20 > include an optional Classic PPC interpreter again.=20 > =20 > Please try this version and report your findings here to=20 > pythonmac-sig, including the full version info of your OS and=20 > MacPython (needed because I expect to release alfas often).=20 > =20 > Things that are known not to work for this release:=20 > - Tkinter is missing=20 > - PIL and Numeric probably won't work=20 > - Setting both "delay console window" and "keep console open" can let=20= > you end up without a menubar.=20 > - Once in a while you get a spurious KeyboardInterrupt from nowhere.=20= > =20 > Things that are known not to work on OSX for this release:=20 > - The ConfigurePython script (run after the installer) fails, but this = =20 > isn't too much of a problem.=20 > - Applets only work if they're in the Python folder. Does anyone know=20= > where shared libraries should be put on OSX to be found by all=20 > applications?=20 > - EditPythonPrefs crashes. If anyone wants to investigate: please.=20 > - The console window doesn't automatically scroll to the bottom until=20= > input is requested.=20 > =20 > Download it from=20 > http://www.cwi.nl/ftp/jack/python/mac/MacPython21a2carbon.bin=20 > and give it a try,=20 > --=20 > Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal = ++++=20 > Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your = sig ++++=20 > www.oratrix.nl/~jack | ++++ see http://www.xs4all.nl/~tank/ ++++=20 > =20 > _______________________________________________=20 > Pythonmac-SIG maillist - Pythonmac-SIG@python.org=20 > http://mail.python.org/mailman/listinfo/pythonmac-sig=20 > =20 > =20 From tmk@easynet.be Wed Feb 21 11:58:25 2001 From: tmk@easynet.be (Tattoo Mabonzo K.) Date: Wed, 21 Feb 2001 12:58:25 +0100 Subject: [Pythonmac-SIG] Python 2.1a2 preferences Message-ID: <200102211158.f1LBwQe01594@metis.microscript.be> Yo Jack, I was wondering where the Python Prefs files are store in Mac OS X PB? I = look in the obvious /Library/Preferences folder but there's nothing = there. TIA =3D tmk =3D= From bkenniso@att.net Wed Feb 21 12:55:22 2001 From: bkenniso@att.net (bkenniso@att.net) Date: Wed, 21 Feb 2001 07:55:22 -0500 (EST) Subject: [Pythonmac-SIG] OSA Range references Message-ID: <200102211255.HAA02001@Brian.goodhome.org> > > Bill Bedford billb@mousa.demon.co.uk > Wed, 21 Feb 2001 01:04:14 +0000 > > >Range in appleevents is a record (Python = dictionary) with the keys >'star' and 'stop' and the values object specifiers. Python simplifies >this to slightly in that you only have to specify the objects. So >your line should read (and I haven't tested this):- > >>>>> db.get_data(record(Range(cell(1),cell(3))) > I should have seen that the Range needs to be expressed as class objects! db.get_data(record(Range(record(1),record(3))) The above brings back the range of records that I was after. Thanks to everyone who responded, -- Brian From tmk@easynet.be Wed Feb 21 14:08:01 2001 From: tmk@easynet.be (Tattoo Mabonzo K.) Date: Wed, 21 Feb 2001 15:08:01 +0100 Subject: [Pythonmac-SIG] Anyone else tried the 2.1a2? Message-ID: <200102211408.f1LE83Q01641@metis.microscript.be> Yo, On Wednesday, February 21, 2001, at 02:53 PM, Jack Jansen wrote: > Ah, thanks for the report! Next time, could you reply to the list (so = that =20 > other people also don't go chasing down things you've already found)?=20= Sure. That's what I intended but somehow manage to not to do it :-/=20 > =20 > Here's answers and more questions:=20 > =20 > > - One thing I've noticed is that LaunchCFMApp consume > 85% of the = CPU when the IDE is=20 > running (~ 50 when running the interpreter only) and as much as 65% of = my memory (320 megs=20 > an only Mail, Process Viewer, Clock and BetterConsole are running)=20 > =20 > Yes, I noticed this too. The Python Idle routine doesn't behave very = well =20 > under OSX. I'll have to investigate this.=20 > =20 > > - When I launch the IDE, there's a window that briefly popups = briefly stating something=20 > that the regex module deprecated in PyFontify, and that 're' should be = used instead.=20 > =20 > Ah, bingo! I never got around to finding out what the text was that = was =20 > printed, but it's the depracation warning, of course!=20 > =20 > I'll convert IDE to use re in stead of regex.=20 > =20 > > - Running test.autotest I get a lot of "exceptions.IOError: [Errno = 13] Permission=20 > denied: '@test'"=20 > > also the get spinning ball cursor all time time and Python becomes = totally=20 > irresponsive. Jack, I can send you my complete log if you will here = just the summary:=20 > > =20 > > 85 tests OK.=20 > > 15 tests failed: test_builtin test_exceptions test_array test_bufio = test_dumbdbm=20 > test_file test_gdbm test_gettext test_gzip test_imageop test_import=20 > test_largefile test_mailbox test_rgbimg test_zipfile=20 > =20 > Hmm, I get the impression that every test that uses a temporary file = (or only =20 > temporary files in the current directory?) fails. Did you install as = an =20 > admin-user or not? Were you running it as the same user as you = installed as? =20 > Could you try creating a file in the Python folder (both via Python = and via =20 > some other method)?=20 You're right. My mistake. Later on, I realized that I installed as root = in an /Application sub folder and was running Python as a non-root user = thus not having the needed credentials to write in the Python folders. I moved my Python installation in a under /Public and now I no longer = get the above exception. Here's the summary of the log: 98 tests OK.=0D1 test failed: test_gzip=0D28 tests skipped: test_al = test_bsddb test_cd test_cl test_crypt test_dbm test_dl test_fcntl = test_fork1 test_gc test_gl test_grp test_imgfile test_largefile = test_linuxaudiodev test_mmap test_nis test_openpty test_poll test_popen2 = test_pty test_pwd test_signal test_sunaudiodev test_sundry test_timing = test_winreg test_winsound=0D Much better :-). I'm now running thousands of lines of my python code (Web App) through = the debugger to see what's broken with this alpha. I'll report my findings to the list later today. =3D tmk =3D > =20 > --=20 > Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal = ++++=20 > Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your = sig ++++=20 > www.oratrix.nl/~jack | see = http://www.xs4all.nl/~tank/spg-l/sigaction.htm =20 > =20 > =20 > =20 > =20 From jack@oratrix.nl Wed Feb 21 15:31:50 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 21 Feb 2001 16:31:50 +0100 Subject: [Pythonmac-SIG] Re: time and MacPython 2.1a2 In-Reply-To: Message by "Tattoo Mabonzo K." , Wed, 21 Feb 2001 16:02:16 +0100 , <200102211502.f1LF2G101683@metis.microscript.be> Message-ID: <20010221153151.82C00371690@snelboot.oratrix.nl> > I've just noticed that on Mac OS X PB, time.time() as well as some = > related time functions (os.path.getmtime()) return *negative* values. = > The doc says that time.time() expected behavior is to=20 > > " > Return the time as a floating point number expressed in seconds since = > the epoch, in UTC. Note that even though the time is always returned as = > a floating point number, not all systems provide time with a better = > precision than 1 second. > " Oww, blech. And I just checked in a mod to the Python repository to work around this. I'll have a look to see what caused the time to go negative. I think it may be the new carbonized GUSI library we use. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jack@oratrix.nl Wed Feb 21 15:38:10 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 21 Feb 2001 16:38:10 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: Message by "Tattoo Mabonzo K." , Wed, 21 Feb 2001 12:10:22 +0100 , <200102211110.f1LBANk01015@metis.microscript.be> Message-ID: <20010221153811.535B9371690@snelboot.oratrix.nl> > Next step helping debugging EditPythonPrefs crashes. No, don't bother: it's fixed. And so is the EasyDialogs problem. It turns= out = that on OS9 you can pass a NULL pointer to the UPP-creation routines and = you = get a NULL pointer out, but not so on OSX. You get a pointer to a routine= that = happily jumps to address zero:-) Dlg.ModalDialog ran into this problem. I've hunted across the source for other places where this might be a prob= lem = but I didn't find any. But, of course, I may have missed some things, so = if = people run into crashes on OSX and it seems that it may be related to cal= lback = routines or somesuch please let me know. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++= Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig = ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.= htm = From jack@oratrix.nl Wed Feb 21 15:46:39 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 21 Feb 2001 16:46:39 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a2 available In-Reply-To: Message by "Tattoo Mabonzo K." , Wed, 21 Feb 2001 12:10:22 +0100 , <200102211110.f1LBANk01015@metis.microscript.be> Message-ID: <20010221154639.D2F13371690@snelboot.oratrix.nl> > Running the IDE I as soon as I do some editing, I get the same error: '= IndexError: list index out of range' > = > 'File "Wtext.py", line 455, in can_undo > which, redo =3D self.ted.WEGetUndoInfo() > which =3D UNDOLABELS[which] Ah, this is Waste 2.0 related. WEGetUndoInfo() can return a whole lot mor= e = values. I fixed it (and made sure it won't crash in the future). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++= Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig = ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.= htm = From jack@oratrix.nl Wed Feb 21 15:50:57 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 21 Feb 2001 16:50:57 +0100 Subject: [Pythonmac-SIG] OSA Range references In-Reply-To: Message by bkenniso@att.net , Wed, 21 Feb 2001 07:55:22 -0500 (EST) , <200102211255.HAA02001@Brian.goodhome.org> Message-ID: <20010221155202.7F769371690@snelboot.oratrix.nl> Brian and Bill, you obviously understand far more about these object specifiers than I do. I must say I'm actually surprised that they work at all: I did write the code but I didn't really test it:-) Do you think it's possible to put together a small example of how to use these beasts, with the target program something that everyone has (the Finder comes to mind, but there may be other programs that are better suited, maybe the scriptable text editor or so). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From sburr@home.com Wed Feb 21 17:52:23 2001 From: sburr@home.com (Steven Burr) Date: Wed, 21 Feb 2001 10:52:23 -0700 Subject: [Pythonmac-SIG] (no subject) Message-ID: <20010221175224.VAAI22496.mail1.rdc1.az.home.com@localhost> > > I've just noticed that on Mac OS X PB, time.time() as well as some=20= > > related time functions (os.path.getmtime()) return *negative* = values.=20 > > The doc says that time.time() expected behavior is to=20 > > =20 > > "=20 > > Return the time as a floating point number expressed in seconds = since=20 > > the epoch, in UTC. Note that even though the time is always returned = as=20 > > a floating point number, not all systems provide time with a better=20= > > precision than 1 second.=20 > > "=20 > =20 > Oww, blech. And I just checked in a mod to the Python repository to = work =20 > around this.=20 > =20 > I'll have a look to see what caused the time to go negative. I think = it may be =20 > the new carbonized GUSI library we use.=20 And yet: >>> import time=0D>>> time.time()=0D-1229371370.154659=0D>>> = time.ctime(time.time())=0D'Wed Feb 21 10:25:34 2001' time.localtime() returns the correct time tuple. Somehow the the other = time functions are able to use the negative value from time.time() to = produce the correct local calendar and clock values. =20 I checked time.time() on the command line version of Python for Darwin, = and it returns a reasonable looking positive value. BTW, I downloaded 2.1a2 this morning and am using it on a Beige = G3/300/192. It's working fine, except just now when I clicked the red = gumdrop to close a script window in IDE, the application "quit = unexpectedly." Just the kind of thing one expects from an alpha. This is a great start for Python on Mac OSX. Thanks, Jack! From jwblist@olympus.net Wed Feb 21 23:16:23 2001 From: jwblist@olympus.net (John W Baxter) Date: Wed, 21 Feb 2001 15:16:23 -0800 Subject: [Pythonmac-SIG] time and MacPython 2.1a2 In-Reply-To: <200102211502.f1LF2G101683@metis.microscript.be> References: <200102211502.f1LF2G101683@metis.microscript.be> Message-ID: At 16:02 +0100 2/21/01, Tattoo Mabonzo K. wrote: >I've just noticed that on Mac OS X PB, time.time() as well as some related >time functions (os.path.getmtime()) return *negative* values. The doc says >that time.time() expected behavior is to > >" >Return the time as a floating point number expressed in seconds since the >epoch, in UTC. Note that even though the time is always returned as a >floating point number, not all systems provide time with a better >precision than 1 second. >" > >time.gmtime(0) returns (1903, 12, 31, 23, 0, 0, 3, 365, 0) which is Thu >Dec 31, 1903 23:00:00 as the epoch both on Mac OS X PB et on Python 2.0 >on Mac OS 9.1. > >I'd expect that time.time() would yield a positive value. > >On OS XP: > >t = time.time() -> -1229352415.5447249 >time.asctime(time.localtime(t)) -> 'Wed Feb 21 15:41:21 2001' > >On Mac OS 9.1 (MacPython 2.0) > >t = time.time() -> 3065614820.2202692 >time.asctime(time.locatime(time.time()) -> 'Wed Feb 21 15:40:20 2001' Tattoo's machine--in Belgium--is one hour east of Greenwich...hence 0 on his machine is -1 hour GMT, which gmtime is happily saying. So far so good. If one treats Mac time as a four byte signed number, it turned negative sometime in 1972 (it's easy enough to figure out when...feed 0x7fffffff to the proper time module routine). It looks as if that is happening somewhere in the Mac OS X implementation (inside Python or outside isn't clear to sourceless me). If we can force the same bits to be treated unsigned, all should be well. --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From =?iso-8859-1?Q?J=F6rg_Kantel?= Thu Feb 22 10:58:15 2001 From: =?iso-8859-1?Q?J=F6rg_Kantel?= (=?iso-8859-1?Q?J=F6rg_Kantel?=) Date: 22 Feb 2001 11:58:15 +0100 Subject: [Pythonmac-SIG] Some new Python How To's in German Message-ID: <-1229279404kantel@mpiwg-berlin.mpg.de> To whom it may concern ;o) in my evergrowing collection of (Mac)Python How To's I've added three new = one: Grafische Ausgabe mit Python und Tkinter: = How To: Das Modul W oder Grafische Ausgabe in MacPython: http- und ftp-User Agenten in Python: = They are only in Germn (sorry) but if you can read German, enjoy it. = Feedback recommended. Script different! J"org Kantel (aka Der Schockwellenreiter) --=20 joerg@kantel.de -- http://www.kantel.de/ http://DerSchockwellenreiter.editthispage.com/ -- (M)ein Weblog http://rollbergnews.editthispage.com/ -- die etwas anderen News From richard@richardgordon.net Fri Feb 23 00:49:41 2001 From: richard@richardgordon.net (Richard Gordon) Date: Thu, 22 Feb 2001 19:49:41 -0500 Subject: [Pythonmac-SIG] Some new Python How To's in German In-Reply-To: <-1229279404kantel@mpiwg-berlin.mpg.de> References: <-1229279404kantel@mpiwg-berlin.mpg.de> Message-ID: >They are only in Germn (sorry) but if you can read German, enjoy it. Or, for those whose German is as bad as mine, you could feed the pages into http://translator.go.com/cb/trans_entry to get a rough idea of what's going on. Richard Gordon -------------------- Gordon Design Web Design/Database Development http://www.richardgordon.net From jack@oratrix.nl Fri Feb 23 10:50:26 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 23 Feb 2001 11:50:26 +0100 Subject: [Pythonmac-SIG] CarbonLib incompatibilities Message-ID: <20010223105026.DAB063C2032@snelboot.oratrix.nl> Folks, I'm at my wits end as to the CarbonLib incompatibilities. I've installed 9.1 on my home machine, and now indeed Carbon MacPython refuses to run. Any toy program I try runs just fine. I've started looking through the archives of Apple's Carbon Developer mailing list, but it's unsearchable, so I haven't found anything yet. If anyone has any ideas of sources of information where I could go have a look for this problem please let me know. Oh yes: if people could mail me the *exact* wording of the error message they get that would also be helpful as it would make searching easier (my system is Dutch so my error message isn't much use). Also, if someone knows of a way to get my machine to be a bit more helpful than simply saying ">>CarbonLib<<" not found or ">>CarbonLib<<" could not start that would be nice too (running under the debugger doesn't help either: the problem happens before startup). Is there a "debugging cfm", maybe? -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | ++++ see http://www.xs4all.nl/~tank/ ++++ From paulm@avacadcam.com Fri Feb 23 11:40:09 2001 From: paulm@avacadcam.com (Paul Miller) Date: Fri, 23 Feb 2001 11:40:09 +0000 Subject: [Pythonmac-SIG] CarbonLib incompatibilities In-Reply-To: <20010223105026.DAB063C2032@snelboot.oratrix.nl> Message-ID: A few suggestions (which you've probably thought of already): Which version of the Carbon stub library are you linking to? Have you tried the one from the Carbon 1.2.5 SDK? Check that you are linking to the stub library (in the Carbon Support folder), and not the actual library (in the Implementation Libraries folder). I don't know haow to get more informative error reporting from the CFM. One thing to note is that if the name of the library is in '>> <<', it means that the libraries initialisation routine failed - the library has actually been found and loaded. Paul. > From: Jack Jansen > Date: Fri, 23 Feb 2001 11:50:26 +0100 > To: pythonmac-sig@python.org > Subject: [Pythonmac-SIG] CarbonLib incompatibilities > > Folks, > I'm at my wits end as to the CarbonLib incompatibilities. I've installed 9.1 > on my home machine, and now indeed Carbon MacPython refuses to run. Any toy > program I try runs just fine. > > I've started looking through the archives of Apple's Carbon Developer mailing > list, but it's unsearchable, so I haven't found anything yet. > > If anyone has any ideas of sources of information where I could go have a look > for this problem please let me know. Oh yes: if people could mail me the > *exact* wording of the error message they get that would also be helpful as it > would make searching easier (my system is Dutch so my error message isn't much > use). > > Also, if someone knows of a way to get my machine to be a bit more helpful > than simply saying ">>CarbonLib<<" not found or ">>CarbonLib<<" could not > start that would be nice too (running under the debugger doesn't help either: > the problem happens before startup). Is there a "debugging cfm", maybe? > -- > Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ > Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ > www.oratrix.nl/~jack | ++++ see http://www.xs4all.nl/~tank/ ++++ > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From jack@oratrix.nl Fri Feb 23 13:15:40 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 23 Feb 2001 14:15:40 +0100 Subject: [Pythonmac-SIG] CarbonLib incompatibilities In-Reply-To: Message by Paul Miller , Fri, 23 Feb 2001 11:40:09 +0000 , Message-ID: <20010223131540.581FC3C2032@snelboot.oratrix.nl> > A few suggestions (which you've probably thought of already): > > Which version of the Carbon stub library are you linking to? > Have you tried the one from the Carbon 1.2.5 SDK? > Check that you are linking to the stub library (in the Carbon Support > folder), and not the actual library (in the Implementation Libraries > folder). I'm linking against the stub lib that's included with CW Pro 6. That's a 1.0.4 stub library. I've started trying to compile/link against the 1.2.5 Universal Headers and stubs, but it turns out there's lots of undefineds (all the ...UPP aliases for the ...Proc routines appear to have gone). > I don't know haow to get more informative error reporting from the CFM. One > thing to note is that if the name of the library is in '>> <<', it means > that the libraries initialisation routine failed - the library has actually > been found and loaded. Ah, that's an interesting bit of knowledge! How do you happen to know this? One of the lines of thought I'm persuing is that maybe I'm linking against routines in CarbonLib 1.0.4 that got dropped in later versions of CarbonLib. The CarbonLib stub I have has the cfm version information all zeroed out, so the cfm loader probably wouldn't be able to notice this problem. Maybe using stub routines that are not defined in the implementation library could cause such an initialization error? And, if it could, how could I find out which routines I'm calling that cause the problem? -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From paulm@avacadcam.com Fri Feb 23 15:06:09 2001 From: paulm@avacadcam.com (Paul Miller) Date: Fri, 23 Feb 2001 15:06:09 +0000 Subject: [Pythonmac-SIG] CarbonLib incompatibilities In-Reply-To: <20010223131540.581FC3C2032@snelboot.oratrix.nl> Message-ID: Jack, Maybe this is it: (from the Carbon Development mailing list) > Date: Wed, 14 Feb 2001 11:29:36 +0900 (JST) > From: Troy Dawson > To: Carbon Development > Subject: Re: Carbon Dev->>CarbonLib< > On Tue, 13 Feb 2001, David Catmull wrote: > >> I know this has come up here before, but I can't remember the answer. What >> does it mean when an app won't run because ">>CarbonLib<<" can't be found? > | > IME, it means you have Carbon 1.1 or greater and don't have High-Level | > Event Aware checked in the little popup menu thingy (the 'SIZE' flags | > on PPC Target). > > ah, MacOS programming is grand, ain't it? > > =td= > >> I don't know haow to get more informative error reporting from the CFM. One >> thing to note is that if the name of the library is in '>> <<', it means >> that the libraries initialisation routine failed - the library has actually >> been found and loaded. > > Ah, that's an interesting bit of knowledge! How do you happen to know this? It was mentioned in one of last years WWDC sessions (Carbon I think). Paul. From jack@oratrix.nl Fri Feb 23 21:59:35 2001 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 23 Feb 2001 22:59:35 +0100 Subject: [Pythonmac-SIG] CarbonLib incompatibilities In-Reply-To: Message by Paul Miller , Fri, 23 Feb 2001 15:06:09 +0000 , Message-ID: <20010223215941.1E1B411CA29@oratrix.oratrix.nl> Paul, THANKS! THANKS! THANKS! THANKS! It wasn't exactly the problem you sketched (Python does have the HLEvents flags) but pretty near: you also need the MultiFinder aware flag. Why on _earth_ CarbonLib would require that flag is beyond me. Programs that aren't multifinder aware are going to be 68K code, so they're hardly going to call CarbonLib. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From redbird@rbisland.cx Sat Feb 24 20:20:11 2001 From: redbird@rbisland.cx (Gordon Worley) Date: Sat, 24 Feb 2001 15:20:11 -0500 Subject: [Pythonmac-SIG] Python ODP category reminder Message-ID: I haven't done one of these for a while, but I just had a link submitted recently and thought I should remind everyone: if you have a page, site, or anything Online that is MacPython related, then please visit to have it listed in the Open Directory Project's MacPython category. Thanks. -- Gordon Worley http://www.rbisland.cx/ mailto:redbird@rbisland.cx PGP: C462 FA84 B811 3501 9010 20D2 6EF3 77F7 BBD3 B003 From fgranger@mail.dotcom.fr Sat Feb 24 22:42:14 2001 From: fgranger@mail.dotcom.fr (=?iso-8859-1?Q?Fran=E7ois?= Granger) Date: Sat, 24 Feb 2001 23:42:14 +0100 Subject: [Pythonmac-SIG] For french pithoneers Message-ID: [en] There is currently a discussion in fr.usenet.forum.evolution for creating a fr.comp.lang.python newsgroup [fr] Il y a en ce moment une discussion dans fr.usenet.forum.evolution pour la création d'un forum fr.comp.lang.python -- "Faites des phrases courtes. Un sujet, un verbe, un complément. Quand vous voudrez ajouter un adjectif, vous viendrez me voir." - Georges Clemenceau, 1841-1929, médecin et homme politique français. Consignes aux journalistes de "L'Aurore". d'après From fgranger@altern.org Sat Feb 24 22:53:25 2001 From: fgranger@altern.org (Francois Granger) Date: Sat, 24 Feb 2001 23:53:25 +0100 Subject: [Pythonmac-SIG] Python ODP category reminder In-Reply-To: References: Message-ID: At 15:20 -0500 24/02/01, in message [Pythonmac-SIG] Python ODP category reminder, Gordon Worley wrote: >I haven't done one of these for a while, but I just had a link >submitted recently and thought I should remind everyone: if you >have a page, site, or anything Online that is MacPython related, >then please visit >hon/> to have it listed in the Open Directory Project's MacPython >category. Thanks. Thanks for the reminder. I discovered new links since the last time I went there. -- "Faites des phrases courtes. Un sujet, un verbe, un complément. Quand vous voudrez ajouter un adjectif, vous viendrez me voir." - Georges Clemenceau, 1841-1929, médecin et homme politique français. Consignes aux journalistes de "L'Aurore". d'après From redbird@rbisland.cx Mon Feb 26 01:17:47 2001 From: redbird@rbisland.cx (Gordon Worley) Date: Sun, 25 Feb 2001 20:17:47 -0500 Subject: [Pythonmac-SIG] For french pithoneers In-Reply-To: References: Message-ID: At 11:42 PM +0100 2/24/01, Fran=E7ois Granger wrote: >[en] >There is currently a discussion in fr.usenet.forum.evolution for >creating a fr.comp.lang.python newsgroup >[fr] >Il y a en ce moment une discussion dans fr.usenet.forum.evolution >pour la cr=E9ation d'un forum fr.comp.lang.python [en] Are there at least a few Python Web sites in French? If so, please send any links to me that you have and I'll create a category for them. [fr] Est-ce qu'il y a au moins un peu sites de la toile de Python en fran=E7ais? Si vrai, m'envoies quelque liens que tu avais, s'il te pla=EEt, et je cr=E9ai un cat=E9gorie d'eux. M'excusez mon fran=E7ais mauvais. -- Gordon Worley http://www.rbisland.cx/ mailto:redbird@rbisland.cx PGP: C462 FA84 B811 3501 9010 20D2 6EF3 77F7 BBD3 B003 From sdm7g@virginia.edu Mon Feb 26 17:36:26 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Mon, 26 Feb 2001 12:36:26 -0500 (EST) Subject: [Pythonmac-SIG] Cocoa from Jython on MacOSX Message-ID: OK -- I know I was one of several people who suggested that one ought to be able to access macosx Cocoa classes from Jython, however, now that I've actually tried to do it, I can't seem to find those classes anywhere. Importing com.apple.cocoa (or com.apple.cocoa.foundation) doesn't work: Jython 2.0 on java1.2.2 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import com.apple.cocoa Traceback (innermost last): File "", line 1, in ? ImportError: No module named cocoa >>> import com.apple >>> dir(com.apple) ['__name__', 'buckyball', 'jdirect', 'mrj', 'scripting'] >>> And looking in the jar-files, I can't find it either. I'm guessing this has something to do with cocoa being implemented by the special java<->objective-c bridge. Anybody else got it working? Any clues? -- Steve Majewski From sdm7g@virginia.edu Mon Feb 26 21:21:38 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Mon, 26 Feb 2001 16:21:38 -0500 (EST) Subject: [Pythonmac-SIG] Cocoa from Jython on MacOSX In-Reply-To: Message-ID: Nevermind -- found them. They're not in a jar and they're not in: /System/Library/Frameworks/JavaVM.framework/Classes with the other java, com.sun & com.apple classes, but in separate class files in /System/Library/Java. ls /System/Library/Java/com/apple/ cocoa misc net security util % cd jython-2.0/ % setenv CLASSPATH /System/Library/Java/ % ./jython Jython 2.0 on java1.2.2 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import com.apple >>> dir() ['__doc__', '__name__', 'com'] >>> dir(com.apple) ['__name__', 'buckyball', 'cocoa', 'jdirect', 'misc', 'mrj', 'net', 'scripting', 'security', 'util'] >>> from com.apple.cocoa import foundation >>> foundation.NSBundle.allFrameworks() [ ... bunch os error messages from having no autoreleasePool class NSCFString autoreleased with no pool in place - just leaking Feb 26 16:17:49 java[420] *** _NSAutoreleaseNoPool(): Object 0x8928350 ... ] ( NSBundle (loaded), NSBundle (loaded), NSBundle (loaded), NSBundle (loaded) ) >>> -- Steve From jack@oratrix.nl Wed Feb 28 11:11:11 2001 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 28 Feb 2001 12:11:11 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a3 available Message-ID: <20010228111111.D0E9C371690@snelboot.oratrix.nl> Folks, the next alfa release of MacPython is available. It is again a Carbon-only release, because of the problems encountered with the previous one. Download it from http://www.cwi.nl/ftp/jack/python/mac/MacPython21a3carbon.bin . MacOS X users should also download a post-last-minute fix: ConfigurePythonCarbon.bin fromthe same directory (see below for details). The most important difference with this release is that it should actually work with CarbonLib 1.0.4 through 1.2.5 and with MacOSX. Various other serious problems, like EasyDialogs and EditPythonPrefs not working have also been fixed. See the release notes for additional fixes. Something that has changed with this release is that ConfigurePython has been replaced by 2 applets: ConfigurePythonCarbon and ConfigurePythonClassic. These will allow MacOS 9 users to switch back and forth between the two runtime models. (Not in this release, because classic-ppc is not included, but in the next). As ConfigurePython{Carbon,Classic} also rebuild the applets for the given execution model the applets are not included in the distribution anymore (except the Configure... ones:-). But: that means that the configure process has become more important, as you'll have no applets if it fails. And, of course, I messed up for MacOSX, so that's why X users should grab the fixed ConfigurePythonCarbon as well, drop it in their Python folder (replacing the broken one) and run it. Please share your feedback on this release here on pythonmac-sig, -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | ++++ see http://www.xs4all.nl/~tank/ ++++ From ceyrat@comint.fr Wed Feb 28 11:36:07 2001 From: ceyrat@comint.fr (Joannes Ceyrat) Date: Wed, 28 Feb 2001 12:36:07 +0100 Subject: [Pythonmac-SIG] MySQLdb on MAC OS Message-ID: <5.0.1.4.0.20010228122853.00a80070@mail.comint.fr> hello, I ' ve a cross paltform program to make. I ' ve try python an tkinker and It seems to be a good choice (I'm not a java programmer) but some data must goes into a mysql server and come from to be edited in a tkinker window. MySQLdb works fine with my NT box but it can not run on a mac. Is it possible to compile the _mysqlmodule.c for the mac to obtain a _mysql.pyd ? Otherwise How can I do ?? Thanks if you have an idea ! From bckfnn@worldonline.dk Wed Feb 28 13:14:18 2001 From: bckfnn@worldonline.dk (Finn Bock) Date: Wed, 28 Feb 2001 13:14:18 GMT Subject: [Jython-users] Re: [Pythonmac-SIG] Cocoa from Jython on MacOSX In-Reply-To: References: Message-ID: <3a9cf98f.8413798@smtp.worldonline.dk> [Steven D. Majewski] >Nevermind -- found them. Cool. >They're not in a jar and they're not in: > /System/Library/Frameworks/JavaVM.framework/Classes >with the other java, com.sun & com.apple classes, but in >separate class files in /System/Library/Java. > >ls /System/Library/Java/com/apple/ >cocoa misc net security util > > >% cd jython-2.0/ >% setenv CLASSPATH /System/Library/Java/ I wonder, would other java programs which access Cocoa, also need this setenv? It is possible that ordinary java programs don't need it, in which case your solution is a good answer to a faq. regards, finn From sdm7g@virginia.edu Wed Feb 28 16:38:18 2001 From: sdm7g@virginia.edu (Steven D. Majewski) Date: Wed, 28 Feb 2001 11:38:18 -0500 (EST) Subject: [Jython-users] Re: [Pythonmac-SIG] Cocoa from Jython on MacOSX In-Reply-To: <3a9cf98f.8413798@smtp.worldonline.dk> Message-ID: On Wed, 28 Feb 2001, Finn Bock wrote: > >% cd jython-2.0/ > >% setenv CLASSPATH /System/Library/Java/ > > I wonder, would other java programs which access Cocoa, also need this > setenv? > > It is possible that ordinary java programs don't need it, in which case > your solution is a good answer to a faq. Since I didn't see any mention of this setting in Apple's Java/Cocoa examples, I'm guessing that if you use ProjectBuilder/InterfaceBuilder (Apple's GUI developer frontend tools -- which the example code does use) it probably gets magically taken care of for you, but if you use command-line javac/java tools, it needs to be told where to look. ( I'll test the assumption when I have a chance ) I changed the jython shell script to add the path: /System/Library/Frameworks/JavaVM.framework/Versions/1.2/Home/bin/java -Dpython.home=/Users/sdm7g/jython-2.0 -classpath "/Users/sdm7g/jython-2.0/jython.jar:/System/Library/Java:$CLASSPATH" org.python.util.jython "$@" I don't know anything about how the installer works -- if there is a place for platform dependent mods, it might be nice to add that. (Also: strictly speaking, the initial path OUGHT to be: /System/Library/Frameworks/JavaVM.framework/Home/bin/java which is symbolically linked to the current version. This script works, but it won't antomatically track any Java upgrades. If it's not simple to change, you might just want to keep it in mind as another possible FAQ -- you may need to reinstall jython if you upgrade Java VM. ) I was able to get a slightly modified version of one of my PyObjC AppKit test programs to work in Jython. The main difference is that the CPython <-> Objective-C bridge does a different name mangling than the Java bridge does. PyObjC tries to pythonify the objective-C method names -- for example the objective-c statement: [ win initWithContentRect:rect styleMask:mask backing:YES defer:NO ]; actually uses the message selector: initWithContentRect:style:Mask:backing:defer: which gets name mangled by PyObjC to: win.initWithContentRect_styleMask_backing_defer_ (frame, mask, YES, NO ) but Jython gets to use the Java bridge's use of Java overloading of different polymorphic versions of the same method name (so there are a couple of different initWithContentRect 's with different numbers of args. ). In Jython: win.initWithContentRect( frame, mask, YES, NO ) ( I don't know yet what happens when there are are two objective-c methods with the same number but different args. ) I think there was some discussion on the old pyobjc-sig mailing list on whether or not to attempt this sort of overloading or to keep the more explicit name transformation. We may wish to revisit this decision -- it would be nice to have the same Cocoa bindings for Jython and CPython+PyObjC. -- Steve Majewski From jwblist@olympus.net Wed Feb 28 17:34:05 2001 From: jwblist@olympus.net (John W Baxter) Date: Wed, 28 Feb 2001 09:34:05 -0800 Subject: [Pythonmac-SIG] MacPython 2.1a3 available In-Reply-To: <20010228111111.D0E9C371690@snelboot.oratrix.nl> References: <20010228111111.D0E9C371690@snelboot.oratrix.nl> Message-ID: At 12:11 +0100 2/28/01, Jack Jansen wrote: >The most important difference with this release is that it should actually >work with CarbonLib 1.0.4 through 1.2.5 Installed fine on 8100, Mac OS 9.1, CarbonLib 1.2.5. The three expected-to-fail tests did fail (Interpreter had 35000K allocated). Other tests were OK. No time to do more right now. --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From etienne@usablenet.com Wed Feb 28 17:46:31 2001 From: etienne@usablenet.com (Etienne Antoniutti Di Muro) Date: Wed, 28 Feb 2001 18:46:31 +0100 Subject: [Pythonmac-SIG] lambda functions in embedded python References: Message-ID: <3A9D3976.22DFC4E9@alias.it> Dear list members, I would like to make a call to the "filter" function of the __builtin__ module from a C routine that embeds python. No problems for making the call, but do not know how to define the arguments: Syntax is: filter(function, list) I got the list, It comes out of some Python evaluation, itself; I'd like to use a lambda function for filtering. How do I define the "lambda" in a python C-embedded envirorment?? I need also the filtered list back in my C routine, for further use. Is this worthy instead of rebuilding the list with the PyList_.... set of functions and some if....else... stratement, to filter "manually" the unwanted items?? Any suggestion? thanx in advance etienne -- it's time to leave this town it's time to steal away let's go get lost anywhere in the U.S.A. (RHCP) From owen@astro.washington.edu Wed Feb 28 17:50:18 2001 From: owen@astro.washington.edu (Russell E Owen) Date: Wed, 28 Feb 2001 09:50:18 -0800 Subject: [Pythonmac-SIG] MacPython 2.1a3 available Message-ID: The basics work -- the expected tests failed, some modules were missing, most tests passed. Also, all of my code that I could test (which excludes a lot due to the problems listed below) worked fine. Two problems: - I cannot figure out how to modify the module search path. EditPythonPrefs exists in the Mac:Scripts folder, but fails to run with error: The application "EditPythonPrefs" could not be opened because "PythonCore" could not be found. (I did look at the prefs file with ResEdit and BBEdit, but didn't see anything that looked relevant.) - import Tkinter fails with error: ImportError: No module named Tkinter It is installed -- in Misc:RPM:Tkinter Looking good! -- Russell >Folks, >the next alfa release of MacPython is available. It is again a Carbon-only >release, because of the problems encountered with the previous one. > >Download it from http://www.cwi.nl/ftp/jack/python/mac/MacPython21a3carbon.bin >. MacOS X users should also download a post-last-minute fix: >ConfigurePythonCarbon.bin fromthe same directory (see below for details). > >The most important difference with this release is that it should actually >work with CarbonLib 1.0.4 through 1.2.5 and with MacOSX. Various other serious >problems, like EasyDialogs and EditPythonPrefs not working have also been >fixed. See the release notes for additional fixes. > >Something that has changed with this release is that ConfigurePython has been >replaced by 2 applets: ConfigurePythonCarbon and ConfigurePythonClassic. These >will allow MacOS 9 users to switch back and forth between the two runtime >models. (Not in this release, because classic-ppc is not included, but in the >next). >As ConfigurePython{Carbon,Classic} also rebuild the applets for the given >execution model the applets are not included in the distribution anymore >(except the Configure... ones:-). But: that means that the configure process >has become more important, as you'll have no applets if it fails. And, of >course, I messed up for MacOSX, so that's why X users should grab the fixed >ConfigurePythonCarbon as well, drop it in their Python folder (replacing the >broken one) and run it. > >Please share your feedback on this release here on pythonmac-sig, >-- >Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ >Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ >www.oratrix.nl/~jack | ++++ see http://www.xs4all.nl/~tank/ ++++ > > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig From bckfnn@worldonline.dk Wed Feb 28 21:20:57 2001 From: bckfnn@worldonline.dk (Finn Bock) Date: Wed, 28 Feb 2001 21:20:57 GMT Subject: [Jython-users] Re: [Pythonmac-SIG] Cocoa from Jython on MacOSX In-Reply-To: References: Message-ID: <3a9d619e.35052793@smtp.worldonline.dk> [Steven D. Majewski] >... >I changed the jython shell script to add the path: > >/System/Library/Frameworks/JavaVM.framework/Versions/1.2/Home/bin/java >-Dpython.home=/Users/sdm7g/jython-2.0 -classpath >"/Users/sdm7g/jython-2.0/jython.jar:/System/Library/Java:$CLASSPATH" org.python.util.jython >"$@" > > >I don't know anything about how the installer works -- if there is a place >for platform dependent mods, it might be nice to add that. At the moment the MacOSX is considered a unix from the installer POV. >(Also: strictly >speaking, the initial path OUGHT to be: > /System/Library/Frameworks/JavaVM.framework/Home/bin/java >which is symbolically linked to the current version. This script works, >but it won't antomatically track any Java upgrades. If it's not simple >to change, The installer uses the java.home property directly AFAICT. If the value there isn't the right one, there is nothing the installer can about it. Please try this >>> import java >>> java.lang.System.getProperty("java.home") 'I:\\JAVA\\JDK1.3\\jre' >>> >you might just want to keep it in mind as another possible >FAQ -- you may need to reinstall jython if you upgrade Java VM. ) > > >I was able to get a slightly modified version of one of my PyObjC >AppKit test programs to work in Jython. The main difference is >that the CPython <-> Objective-C bridge does a different name >mangling than the Java bridge does. PyObjC tries to pythonify >the objective-C method names -- for example > >the objective-c statement: > > [ win initWithContentRect:rect styleMask:mask backing:YES defer:NO ]; > >actually uses the message selector: > > initWithContentRect:style:Mask:backing:defer: > >which gets name mangled by PyObjC to: > > win.initWithContentRect_styleMask_backing_defer_ (frame, mask, YES, NO ) > > >but Jython gets to use the Java bridge's use of Java overloading of >different polymorphic versions of the same method name (so there are >a couple of different initWithContentRect 's with different numbers >of args. ). > >In Jython: > > win.initWithContentRect( frame, mask, YES, NO ) > > >( I don't know yet what happens when there are are two objective-c > methods with the same number but different args. ) Jython will succesfully call the correct method. It works flawlessly in 99.9% of all cases. For some of the remaining cases a helper object can be used to specify which overloaded function to call. See: http://www.jython.org/docs/usejava.html section "Overloaded Java Method Signatures" For the remaining cases, like this: void foo(int x); void foo(Integer x); jython picks one, and there is no way to select. >I think there was some discussion on the old pyobjc-sig mailing list >on whether or not to attempt this sort of overloading or to keep the >more explicit name transformation. We may wish to revisit this >decision -- it would be nice to have the same Cocoa bindings for Jython >and CPython+PyObjC. The pure pleasure of having overloading just work suggest that it is worth the additional implementation. The ability of calling overloaded java methods from jython without any manual mangling, was a fundamental necessity for jython's success. OTOH, there is a performance issue, at least with the way Jython implements overloaded methods. Overloaded methods are sorted according to the precedents of the arguments and when a method is called, the runtime will attempt to coerce the actual arguments into the argument that each of the overloaded java method expect. If there is a lot of overloaded method with the same number of args, all the coercion attempts will take time. As an example look at String.valueOf method: >>> import java >>> java.lang.String.valueOf >>> java.lang.String.valueOf.argslist regards, finn From jack@oratrix.nl Wed Feb 28 23:31:35 2001 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 01 Mar 2001 00:31:35 +0100 Subject: [Pythonmac-SIG] MacPython 2.1a3 also available for classic PPC Message-ID: <20010228233140.EA326EA11D@oratrix.oratrix.nl> Hi gang, things have been moving faster than I had anticipated, and I've put together a fat installer for 2.1a3. The installer, at http://www.cwi.nl/ftp/jack/python/mac/MacPython21a3full.bin will install either classic Python (if you have a non-carbon pre-macos9 machine) carbon Python (if you have a macosx machine) or both (if you have macos 8 or 9 with CarbonLib installed). It also has the MacOSX Configure bug fixed (I hope: I haven't tested it yet, I'll leave that to you folks or do it tomorrow). If you have a machine on which both classic and carbon are installed the installation will be pre-configured for carbon (if all goes well:-). I'd like everyone with some spare time to try this release. Barring any showstoppers we can then go to beta distributions! Oh yes: the installer is a hefty 8MB. I'm going to look into doing an active installer (which only retrieves the bits that are needed). -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | ++++ see http://www.xs4all.nl/~tank/ ++++