From jack@oratrix.nl Wed Sep 1 13:05:36 1999 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 01 Sep 1999 14:05:36 +0200 Subject: [Pythonmac-SIG] CXX and SCXX Message-ID: <19990901120538.438C935BB1F@snelboot.oratrix.nl> Has anyone used CXX or SCXX with MacPython? Comments? In case you've never heard of these: CXX is a set of C++ templates that allow you to treat Python objects as first class citizens in C++ code. So all the INCREFs and DECREFs are taken care of, if you get passed two Python number objects in your C++ code you can just do "a + b" and you'll get back a Python object with the sum of them, etc. It all looks really really neat, from the description. CXX is part of the LLNL distribution. SCXX is a lightweight re-implementation of it, which was recently announced to python-announce (the URL is http://starship.python.net/crew/gmcm/scxx.html). And, if noone has used it yet: does anyone have a project in which they could use this? The reason I'm asking all this is that it looks like CXX could make life _so_ much easier for writing Toolbox modules and such that it might be worthwhile to switch to C++ for the Toolbox modules, provided all this stuff indeed works... -- 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 joe@strout.net Wed Sep 1 16:32:17 1999 From: joe@strout.net (Joseph J. Strout) Date: Wed, 1 Sep 1999 08:32:17 -0700 Subject: [Pythonmac-SIG] CXX and SCXX In-Reply-To: <19990901120538.438C935BB1F@snelboot.oratrix.nl> References: <19990901120538.438C935BB1F@snelboot.oratrix.nl> Message-ID: At 2:05 PM +0200 09/01/99, Jack Jansen wrote: >And, if noone has used it yet: does anyone have a project in which they could >use this? I haven't tried it yet, but I can indeed imagine making good use of this if it works as advertised. (Congrats on the release of your multimedia product, BTW! Does this mean we can expect to see MacPython 1.5.2+ soon?) Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From dozier@abs.net Fri Sep 3 04:30:54 1999 From: dozier@abs.net (Bill Dozier) Date: Thu, 02 Sep 1999 23:30:54 -0400 Subject: [Pythonmac-SIG] CXX and SCXX Message-ID: <199909030331.XAA02835@vwww1.abs.net> It appears that if CWPro 5's compiler understood the "explicit" keyword, CXX would compile right out of the box. It shouldn't be too hard to port. From jac@lanl.gov Fri Sep 3 06:19:42 1999 From: jac@lanl.gov (James A. Crotinger) Date: Thu, 02 Sep 1999 23:19:42 -0600 Subject: [Pythonmac-SIG] CXX and SCXX Message-ID: <199909030520.XAA27255@cic-mail.lanl.gov> My CWPro has understood explicit for some time (4 & 5 at least). What exactly is the problem? Jim ------------------------------------------------------------------------ James A. Crotinger Los Alamos National Lab email: jac@lanl.gov Technical Staff Member CIC-ACL, MS B287 phone: 505-665-6022 Pooma Team Los Alamos, NM 87545 fax: 505-665-4939 ---------- >From: "Bill Dozier" >To: pythonmac-sig@python.org >Subject: Re: [Pythonmac-SIG] CXX and SCXX >Date: Thu, Sep 2, 1999, 9:30 PM > > It appears that if CWPro 5's compiler understood the "explicit" keyword, > CXX would compile right out of the box. It shouldn't be too hard to port. > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://www.python.org/mailman/listinfo/pythonmac-sig > From dozier@abs.net Fri Sep 3 13:35:43 1999 From: dozier@abs.net (Bill Dozier) Date: Fri, 03 Sep 1999 08:35:43 -0400 Subject: [Pythonmac-SIG] CXX and SCXX Message-ID: <199909031236.IAA22859@vwww1.abs.net> Error : illegal use of 'explicit' CXX_Objects.h line 856 explicit SeqBase () explicit SeqBase () :Object(FromAPI(PyTuple_New(0))) { validate(); } Error : illegal use of 'explicit' CXX_Objects.h line 862 explicit SeqBase (PyObject* pyob): Object(pyob) { explicit SeqBase (PyObject* pyob): Object(pyob) { validate(); } Error : illegal use of 'explicit' CXX_Objects.h line 1573 explicit MapBase(){} explicit MapBase(){} Error : illegal use of 'explicit' CXX_Objects.h line 1578 explicit MapBase (PyObject *pyob): Object(pyob) { explicit MapBase (PyObject *pyob): Object(pyob) { validate(); } ---------- >From: "James A. Crotinger" >To: Bill Dozier , pythonmac-sig@python.org >Subject: Re: [Pythonmac-SIG] CXX and SCXX >Date: Fri, Sep 3, 1999, 1:19 AM > > My CWPro has understood explicit for some time (4 & 5 at least). What > exactly is the problem? > > Jim > > ------------------------------------------------------------------------ > James A. Crotinger Los Alamos National Lab email: jac@lanl.gov > Technical Staff Member CIC-ACL, MS B287 phone: 505-665-6022 > Pooma Team Los Alamos, NM 87545 fax: 505-665-4939 > > > ---------- >>From: "Bill Dozier" >>To: pythonmac-sig@python.org >>Subject: Re: [Pythonmac-SIG] CXX and SCXX >>Date: Thu, Sep 2, 1999, 9:30 PM >> > >> It appears that if CWPro 5's compiler understood the "explicit" keyword, >> CXX would compile right out of the box. It shouldn't be too hard to port. >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://www.python.org/mailman/listinfo/pythonmac-sig >> > From jac@lanl.gov Sat Sep 4 00:19:59 1999 From: jac@lanl.gov (James A. Crotinger) Date: Fri, 03 Sep 1999 17:19:59 -0600 Subject: [Pythonmac-SIG] CXX and SCXX Message-ID: <199909032325.RAA09127@cic-mail.lanl.gov> Hmmm. I never put template parameters after a constructor name. I don't even know if it is legal. But certainly CW accepts it without the explicit keyword. At any rate, it is not needed and removing the template parameters does indeed fix it: template class D { public: explicit D() { } }; int main() { D d; } gives the error: Error : illegal use of 'explicit' HelloWorld.cp line 16 explicit D() { } And this does compile if I remove "explicit". But it also compiles if I remove the : template class D { public: explicit D() { } // . . . ^^^-------------- not D() }; Since there is no reason to have D there, and this fixes the problem, I'd go with that. (Mark or Geoff, do you know if D() is legal? It seems like it should be. If it is a bug, I'll submit it to Metrowerks. Or more explicitly, there must be a bug here since "explicit D()" fails and plain "D()" works and "explicit D()" works. I just need to know which is correct.) (BTW, what does explicit buy you on default constructors? I had not seen this construct before, and have only used it on single-argument constructors.) Jim ------------------------------------------------------------------------ James A. Crotinger Los Alamos National Lab email: jac@lanl.gov Technical Staff Member CIC-ACL, MS B287 phone: 505-665-6022 Pooma Team Los Alamos, NM 87545 fax: 505-665-4939 From mark@codesourcery.com Sat Sep 4 00:40:36 1999 From: mark@codesourcery.com (Mark Mitchell) Date: Fri, 03 Sep 1999 16:40:36 -0700 Subject: [Pythonmac-SIG] CXX and SCXX In-Reply-To: <199909032325.RAA09127@cic-mail.lanl.gov> References: <199909032325.RAA09127@cic-mail.lanl.gov> Message-ID: <19990903164036E.mitchell@codesourcery.com> >>>>> "James" == James A Crotinger writes: James> Hmmm. I never put template parameters after a constructor James> name. I don't even know if it is legal. But certainly CW James> accepts it without the explicit keyword. At any rate, it is James> not needed and removing the template parameters does indeed James> fix it: Easy one: 14.6.1 Locally declared names [temp.local] 1 Within the scope of a class template, when the name of the template is neither qualified nor followed by <, it is equivalent to the name of the template followed by the template-parameters enclosed in <>. [Example: the constructor for Set can be referred to as Set() or Set(). ] Other specializations (_temp.expl.spec_) of the class can be referred to by explicitly qualifying the template name with the appropriate template-arguments. [Example: template class X { X* p; // meaning X X* p2; X* p3; }; --end example] So, your compiler is buggy. James> (BTW, what does explicit buy you on default constructors? I James> had not seen this construct before, and have only used it James> on single-argument constructors.) It doesn't buy you anything, so far as I know, or can see from a quick peek at [class.conv.ctor]. -- Mark Mitchell mark@codesourcery.com CodeSourcery, LLC http://www.codesourcery.com From drw@stimpy.anu.edu.au Mon Sep 6 18:21:24 1999 From: drw@stimpy.anu.edu.au (David Worrall) Date: Mon, 6 Sep 1999 12:21:24 -0500 Subject: [Pythonmac-SIG] macspeech and SoundManager Message-ID: <9909061221.ZM23657@scar> Hi! I've just subscribed to this SIG and am working on audio+speech using python. At Mark Hammond's suggestion, I'm posting my query to this group in the hope that someone may be able to give me a clue... I'm using python 1.5.2 for the mac under OS 8. I'm trying to find a way of controlling the audio output of speechchannels in the audio *stereo* field. I've plowed through Inside Mac. audio, speech etc to little avail, and I would greatly appreciate some advice on how to go about this. is there some way of picking up the audio channel output so as I can use the Sound Manager controls, or do I have to hack a mixer together or use the component manager, or what? cheers, David. -- ___________________________________________________ Head, Australian Centre for the Arts and Technology Australian National University President, Australasian Computer Music Association GPO Box 804 Canberra Australia 2601 'phone: +61 2 6249.5640 Fax: +61 2 6247.0229 email: David.Worrall@anu.edu.au http://online.anu.edu.au/ITA/ACAT/drw/ ___________________________________________________ From nbornstein@plr.com Fri Sep 10 02:35:29 1999 From: nbornstein@plr.com (Niel M. Bornstein) Date: Thu, 9 Sep 1999 21:35:29 -0400 Subject: [Pythonmac-SIG] More on Error Message-ID: A few weeks ago I posted a message to the list asking about the following error: Traceback (innermost last): File "Kyoto:Projects:Pivotal:1.01b3:Plink.py", line 7, in ? File "Kyoto:Development:Python 1.5.2b1:Mac:Lib:FrameWork.py", line 8, in ? ImportError: toolboxmodules.ppc.slb: The named library was not found. I have a little more information from my client now. As a reminder, this is a stand-alone Python app, created with BuildApplication. It works fine on some Macs (for example, it works great on my PowerCenter 132 and an iMac they had at their office), but it gives the above error on others. Apparently at least two of the machines that are failing are 8100's with OS 7.5.3. When I asked the client to try option-launching the app, the same traceback came up, so there was no opportunity to do the "import sys; print sys.path, sys.modules" bit. Dropping the app on Edit{PythonPrefs shows the sys.path to be $(APPLICATION). It's especially difficult for me to provide any more info, as my client's clients are far away, and my client is not at all Mac literate. My client is desperate and has even gone as far as buying one of his clients a new Mac just to get this running. Any ideas? Niel From peter.sommerfeld@gmx.de Fri Sep 10 13:44:10 1999 From: peter.sommerfeld@gmx.de (Peter Sommerfeld) Date: Fri, 10 Sep 1999 14:44:10 +0200 Subject: [Pythonmac-SIG] More on Error In-Reply-To: Message-ID: Niel M. Bornstein wrote: >Traceback (innermost last): > File "Kyoto:Projects:Pivotal:1.01b3:Plink.py", line 7, in ? > File "Kyoto:Development:Python 1.5.2b1:Mac:Lib:FrameWork.py", line 8, in ? >ImportError: toolboxmodules.ppc.slb: The named library was not found. Nils, the "toolboxmodules.ppc.slb" is in $(APPLICATION):PlugIns. Put it into the extention folder of the system folder or make a proper PlugIns Folder at $(APPLICATION). -- Peter From tylerh@alumni.caltech.edu Mon Sep 13 19:27:17 1999 From: tylerh@alumni.caltech.edu (Tyler Holcomb) Date: Mon, 13 Sep 1999 11:27:17 -0700 Subject: [Pythonmac-SIG] newbie Tkinter problem Message-ID: First: an apology. If this problem is covered in a FAQ somewhere I haven't found it yet, so please direct me. I am new to Python, and am still finding my way around. === Problem: Having problems using Tkinter. Almost certainly an initialization/installation error, I just haven't managed to track it down. Here is the current error: Traceback (innermost last): File "Mac:Applications:Python 1.5.1:forecast.py", line 7, in ? import Tkinter File "Mac:Applications:Python 1.5.1:Lib:Tkinter.py", line 5, in ? import _tkinter # If this fails your Python is not configured for Tk ImportError: No module named _tkinter This error only appears after putting _tkinter.ppc.slb in the extensions folder. === The complete history: write script, called "forecast.py". Script includes "import Tkinter" From Python command line, "import forecast." Able to build window. Life is good. Double clicked on forecast.pyc. This brought up the Python application, ran the script, window worked, life is good. Dragged forecast.py onto BuildApplet. Seems to work. Double click the resulting forecast application. Hangs, at the self.create(...) call in Tkinter.py, line 820. Looks like code is using a bad default to find _tkinter. Life is confusing Nose around. Find the plugin _tkinter.ppc.slb hanging around. Drag to system folder, reboot. Rebuild forecast.pyc and forecast application. Life is hopeful. Double click forecast application, and see: Traceback (innermost last): File "Mac:Applications:Python 1.5.1:forecast.py", line 7, in ? import Tkinter File "Mac:Applications:Python 1.5.1:Lib:Tkinter.py", line 5, in ? import _tkinter # If this fails your Python is not configured for Tk ImportError: No module named _tkinter Interestingly, "import forecast" from the command prompt ">>>", now also gives this same error, even though it worked before. Life is consistent, but not good. HELP! === Once again, I am newbie, and I apologize if this is a "noise" posting for this group. If so, please redirect me. Thank you, Tyler Holcomb tylerh@alumni.caltech.edu From maccgi@bellsouth.net Wed Sep 15 05:49:44 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Wed, 15 Sep 1999 00:49:44 -0400 Subject: [Pythonmac-SIG] Pattern Matching Speeds? Message-ID: I finally got around to reworking a Perl script to Python that I wrote to convert 2 digit yrs. into 4 digit yrs in text files for database import. In MacPerl, this processes about 1200 test records per second, while in MacPython, the rate is more like 800 per second and that's kind of disappointing. Multiple comparison tests were done on the same data and the same machine with both interpreters set to 10240K. The data is about 36,000 tab delimited records and each has two dates in it- most need to be fixed but some don't. I won't bore you with the perl code, but it's pretty simple and about what you would expect. I am pasting in the python code below and would appreciate it if anyone can spot something that might be bogging this thing down. Thanks. ############## import re, sys, string infile = open("Conkie:Desktop Folder:2to4:fmptest.tab", "r") outfile = open("Conkie:Desktop Folder:2to4:fixed.tab", "w" sys.stdout = outfile data = infile.read() paragraphs = string.split(data, '\n') matchstr = re.compile(r'(\b\d\d*/)(\d\d*/)(\d\d)\b') def cent(matchobj): centuryA = '19' centuryB = '20' if len(matchobj.group(1)) == 2: month = '0'+matchobj.group(1) else: month = matchobj.group(1) if len(matchobj.group(2)) == 2: day = '0'+matchobj.group(2) else: day = matchobj.group(2) if matchobj.group(3) > '89': newDate = month+day+centuryA+matchobj.group(3) else: newDate = month+day+centuryB+matchobj.group(3) return newDate for paragraph in paragraphs: if not paragraph: break else: fixed_paragraph = matchstr.sub(cent, paragraph) print fixed_paragraph ############## Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From nbornstein@plr.com Wed Sep 15 23:15:43 1999 From: nbornstein@plr.com (Niel M. Bornstein) Date: Wed, 15 Sep 1999 18:15:43 -0400 Subject: [Pythonmac-SIG] Filtering keystrokes in a dialog Message-ID: I'm trying to filter input in a text field in a dialog box. The main thing I want to filter out is the return and enter keys, my clients apparently can't stop themselves from hitting them while entering data. Here's what I have in my MyDialog class: def do_itemhit( self, item, event ): if item == ITEM_SEND: self.send() elif item == ITEM_CANCEL: self.cancel() elif item == ITEM_DOCID or item == ITEM_PINN: # filter the input tp, h, rect = self.wid.GetDialogItem( item ) field = GetDialogItemText( h ) field = strip( join( split( field ), "" ) ) SetDialogItemText( h, field ) The problem is that this does nothing when the return key is hit, until the next key is hit, and then the field sort of jumps back up to where the return is gone. Is there another way to filter keystrokes? I know how I would do it in C... Niel From ventrego@yahoo.com Thu Sep 16 20:33:12 1999 From: ventrego@yahoo.com (Michael) Date: Thu, 16 Sep 1999 12:33:12 -0700 (PDT) Subject: [Pythonmac-SIG] Python termination problems Message-ID: <19990916193312.1997.rocketmail@web1303.mail.yahoo.com> This is my first post to the SIG, so HI, everybody! :) Using editpythonprefs, I've set python to keep the standard output window open if there's an error. This works wonderfully, as it allows me to have the error on-screen at the same time as the code. However, the window title changes to <> when the program halts. At this point, how do I close the window? It doesn't have a close button, and it doesn't respond to apple-Q. Sometimes it closes wen I hit , but not reliably. Worse, using apple-option-escape to "force quit" frequently crashes the computer. For what it's worth, I'm using an iMac with OS 8.6. Thanks for the help - Michael __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com From PClaerhout@CREO.BE Thu Sep 16 20:38:49 1999 From: PClaerhout@CREO.BE (Pieter Claerhout) Date: Thu, 16 Sep 1999 21:38:49 +0200 Subject: [Pythonmac-SIG] Python termination problems Message-ID: <2B1262E83448D211AE4B00A0C9D61B03688502@MSGEURO1> Try typing CTRL+Z to close the window. Kind regards, Pieter PClaerhout@creo.be -----Original Message----- From: Michael To: pythonmac-sig@python.org Sent: 9/16/99 12:33 PM Subject: [Pythonmac-SIG] Python termination problems This is my first post to the SIG, so HI, everybody! :) Using editpythonprefs, I've set python to keep the standard output window open if there's an error. This works wonderfully, as it allows me to have the error on-screen at the same time as the code. However, the window title changes to <> when the program halts. At this point, how do I close the window? It doesn't have a close button, and it doesn't respond to apple-Q. Sometimes it closes wen I hit , but not reliably. Worse, using apple-option-escape to "force quit" frequently crashes the computer. For what it's worth, I'm using an iMac with OS 8.6. Thanks for the help - Michael __________________________________________________ Do You Yahoo!? Bid and sell for free at http://auctions.yahoo.com _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://www.python.org/mailman/listinfo/pythonmac-sig From joe@strout.net Mon Sep 20 20:25:59 1999 From: joe@strout.net (Joseph J. Strout) Date: Mon, 20 Sep 1999 12:25:59 -0700 Subject: [Pythonmac-SIG] PythonIDE no longer works?!? In-Reply-To: <199908061802.OAA04491@snow.cit.cornell.edu> References: <199908061802.OAA04491@snow.cit.cornell.edu> Message-ID: Whoa! Talk about a Monday... I tried to launch Python IDE this morning, and got the following traceback: Traceback (innermost last): File "Chinacat:Users:Strout:tools:Python 1.5.2b1:IDE:PythonIDE.py", line 48, in ? init() File "Chinacat:Users:Strout:tools:Python 1.5.2b1:IDE:PythonIDE.py", line 16, in init Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) TypeError: buffer length should be sizeof(Cursor) Seems to be saying that the buffer returned by Qd.GetCursor, when getting the watch cursor, is not the same length as a Cursor structure. How could that be? What's stranger, everything was just fine last week, I haven't changed anything on my system, I swear! It's possible that one of my office mates changed something, but I doubt it... running MacOS 8.6 (but have been for quite a while). Any guesses what might be going on here? Thanks, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From joe@strout.net Mon Sep 20 20:30:48 1999 From: joe@strout.net (Joseph J. Strout) Date: Mon, 20 Sep 1999 12:30:48 -0700 Subject: [Pythonmac-SIG] Re: PythonIDE no longer works?!? Message-ID: I just wrote: > Qd.SetCursor(Qd.GetCursor(QuickDraw.watchCursor).data) >TypeError: buffer length should be sizeof(Cursor) To follow up my own post, I then rebooted, and everything's fine again. This is just some bizarre side-effect of some weird state my Mac was in. Sorry I posted before trying that -- but at least this way, if it happens to you, you'll have heard of it before. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From jimmy@cs.cofc.edu Tue Sep 21 00:21:52 1999 From: jimmy@cs.cofc.edu (James B. Wilkinson) Date: Mon, 20 Sep 1999 19:21:52 -0400 Subject: [Pythonmac-SIG] Filtering keystrokes in a dialog In-Reply-To: Message-ID: Are you using the Framework? I've got a class that allows arbitrary filtering of keystrokes in text boxes. I've used it a bunch in plain windows but never tried dialog boxes. Looks like it might be overkill for what you want right now, but I've found lots of uses for it. Let me know if you're interested. Niel M. Bornstein said: >I'm trying to filter input in a text field in a dialog box. The main thing >I want to filter out is the return and enter keys, my clients apparently >can't stop themselves from hitting them while entering data. ------------------------------------------------------------- Jimmy Wilkinson | Perfessor 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". From draayer@door.net Tue Sep 21 10:55:00 1999 From: draayer@door.net (Dean E.Draayer) Date: Tue, 21 Sep 99 04:55:00 -0500 Subject: [Pythonmac-SIG] RE: Python termination problems Message-ID: <19990921100146761.AAA89@mail.door.net@[208.247.125.109]> Regarding Michael's message: >Using editpythonprefs, I've set python to keep the standard output >window open if there's an error. This works wonderfully, as it allows >me to have the error on-screen at the same time as the code. However, >the window title changes to <> when the program halts. At >this point, how do I close the window? It doesn't have a close button, >and it doesn't respond to apple-Q. Sometimes it closes wen I hit >, but not reliably. Worse, using apple-option-escape to "force >quit" frequently crashes the computer. and Pieter Claerhout's response: >Try typing CTRL+Z to close the window. I was having the same problem as Michael. But one day I accidentally hit the key (on my extended keyboard) and the <> window vanished! And it hasn't failed me since. (Is hitting the key equivalent to typing a Ctrl-Z?) I don't recall seeing the proper response to this window documented anywhere - it would be handy to know! Dean Draayer From nbornstein@plr.com Tue Sep 21 11:29:16 1999 From: nbornstein@plr.com (Niel M. Bornstein) Date: Tue, 21 Sep 1999 06:29:16 -0400 Subject: [Pythonmac-SIG] Filtering keystrokes in a dialog In-Reply-To: References: Message-ID: Yes, I'm using the Framework. Yeah, that would be great. I do have other things I need to filter, return/enter just seemed to be the easiest to start with. >Are you using the Framework? I've got a class that allows arbitrary >filtering of keystrokes in text boxes. I've used it a bunch in plain >windows but never tried dialog boxes. Looks like it might be overkill for >what you want right now, but I've found lots of uses for it. Let me know if >you're interested. From savageb@pacbell.net Tue Sep 21 17:18:23 1999 From: savageb@pacbell.net (Bob Savage) Date: Tue, 21 Sep 1999 09:18:23 -0700 Subject: [Pythonmac-SIG] RE: Python termination problems Message-ID: <199909211618.JAA16464@smtp2.Stanford.EDU> > >>Try typing CTRL+Z to close the window. > >I was having the same problem as Michael. But one day I accidentally >hit the key (on my extended keyboard) and the <> window >vanished! And it hasn't failed me since. (Is hitting the key >equivalent to typing a Ctrl-Z?) I don't recall seeing the proper response >to this window documented anywhere - it would be handy to know! > Hmmm... I think this should be "ctrl + D". Ctrl + Z is Windows for End Of File, on Unix and MacOS ctrl + D is EOF (at least ctrl+D works for me, except when I'm in Unix). My guess is that in this case the "end" key is mapped to EOF. Bob From oc918@mizzou.edu Wed Sep 22 00:52:08 1999 From: oc918@mizzou.edu (Oscar Chavez) Date: Tue, 21 Sep 1999 17:52:08 -0600 Subject: [Pythonmac-SIG] Installing Python in an iMac Message-ID: Are there any known problems about installing Python 1.5.1 in an iMac? I downloaded the installer, and everything seemed right. Suddenly the installation process was interrupted by the following dialog box: An unexpected error ocurred while installing "Python" 1008:17, -23 OK I tried the easy installation and the customized one. Neither one worked. I tried the installer in a Power Mac 8500/150 and it installed Python without problems (but the 8500 is not mine, so it does not help, it was only a test). __________________________________________________________________________ Oscar Chavez oc918@mizzou.edu 104 Stewart Hall University of Missouri (573) 882-4521 Columbia, MO 65211-6180 fax: (573) 882-4481 From btcoburn@oberlin.edu Wed Sep 22 03:41:05 1999 From: btcoburn@oberlin.edu (Ben Coburn) Date: Tue, 21 Sep 1999 22:41:05 -0400 (EDT) Subject: [Pythonmac-SIG] Installing Python in an iMac In-Reply-To: Message-ID: On Tue, 21 Sep 1999, Oscar Chavez wrote: > > An unexpected error ocurred > while installing "Python" > > 1008:17, -23 OK > > I tried the easy installation and the customized one. Neither one worked. I > tried the installer in a Power Mac 8500/150 and it installed Python without > problems (but the 8500 is not mine, so it does not help, it was only a > test). > Check the MacOS version number for the Power Mac 8500. (Is it less than 8.6?) I got errors like that when installing under MacOS 8.6, though installing with "extensions off" worked as I recall. (Hold the shift key down when starting up the iMac.) Regards, Ben Coburn ----------------------------------------------------------------------- Ben Coburn "Black holes are where God divided by zero." -Anon. btcoburn@oberlin.edu Offsite Paradox Associate Biochemistry & Biology Major Arcosanti Paradox Project Oberlin College http://www.arcosanti.org/paradox/ ----------------------------------------------------------------------- From oc918@mizzou.edu Wed Sep 22 15:18:08 1999 From: oc918@mizzou.edu (Oscar Chavez) Date: Wed, 22 Sep 1999 09:18:08 -0500 Subject: [Pythonmac-SIG] Embarrassing clarification Message-ID: I finally was able to install Python in the iMac, I just turned Virex off. About a different matter, what would be the best resource (tutorial, book,...) for a beginner, with no programming experience at all? __________________________________________________________________________ Oscar Chavez oc918@mizzou.edu 104 Stewart Hall University of Missouri (573) 882-4521 Columbia, MO 65211-6180 fax: (573) 882-4481 From PClaerhout@CREO.BE Wed Sep 22 15:31:24 1999 From: PClaerhout@CREO.BE (Pieter Claerhout) Date: Wed, 22 Sep 1999 16:31:24 +0200 Subject: [Pythonmac-SIG] Embarrassing clarification Message-ID: <2B1262E83448D211AE4B00A0C9D61B0368852C@MSGEURO1> I would start with the tutorial. It gives you a real nice introduction to the language. You can also consider bying the book "Learning Python" from O'Reilly. Take get an overview of possible intro's to Python, see: http://www.deja.com/getdoc.xp?AN=523189453 It points out the best resources for people who want to learn programming using Python. Also take a look at the mac specific information, which can be found somewhere in the Mac subfolder of your Python installation. Kind regards, Pieter Pieter Claerhout - PClaerhout@creo.be Response Center - Applications Support Creo Europe - Excelsiorlaan 21 - 1930 Zaventem - Belgium Tel: +32 (2) 711 14 00 - Fax: +32 (2) 720 96 71 -----Original Message----- From: Oscar Chavez [mailto:oc918@mizzou.edu] Sent: Wednesday, September 22, 1999 7:18 AM To: Python SIG mailing list Subject: [Pythonmac-SIG] Embarrassing clarification I finally was able to install Python in the iMac, I just turned Virex off. About a different matter, what would be the best resource (tutorial, book,...) for a beginner, with no programming experience at all? __________________________________________________________________________ Oscar Chavez oc918@mizzou.edu 104 Stewart Hall University of Missouri (573) 882-4521 Columbia, MO 65211-6180 fax: (573) 882-4481 _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://www.python.org/mailman/listinfo/pythonmac-sig From maccgi@bellsouth.net Wed Sep 22 16:00:16 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Wed, 22 Sep 1999 11:00:16 -0400 Subject: [Pythonmac-SIG] Embarrassing clarification In-Reply-To: References: Message-ID: At 09:18 -0500 09/22/1999, Oscar Chavez wrote: >About a different matter, what would be the best resource (tutorial, >book,...) for a beginner, with no programming experience at all? The general html documentation that's included in the installation isn't bad once you figure out what you are looking for and you *do* want to look at the Mac stuff in HardDrive:Python 1.5.2b1:Python HTML Docs:mac:index.html. Otherwise, "Learning Python" by Mark Lutz & David Ascher is a good bet- my only real criticism of it is that it lacks a glossary and it seems to me that an introductory book should have one (another Lutz book, "Programming Python," does have a glossary but goes well beyond the basics and would probably just confuse you). Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From savageb@pacbell.net Wed Sep 22 20:08:11 1999 From: savageb@pacbell.net (Bob Savage) Date: Wed, 22 Sep 1999 12:08:11 -0700 Subject: [Pythonmac-SIG] Embarrassing clarification Message-ID: <199909221908.MAA08540@smtp2.Stanford.EDU> >>About a different matter, what would be the best resource (tutorial, >>book,...) for a beginner, with no programming experience at all? > >Otherwise, "Learning Python" by Mark Lutz & David Ascher is a good bet I agree. This is a very good book. Stay away from the other OReilly Lutz book (the honkin' thick one) if you are not already comfortable programming. But the Lutz & Ascher book is very clear and geared towards those just learning. I also found it useful after having used Python for a year. It is not always great on explaining Mac-centric things (like it goes into great detail about OLE on Windows, but Scripting on the Mac (using Apple Events) is not mentioned. So if there is no indication of how to do something on the Mac version ask here. :) Bob From richard@richardgordon.net Fri Sep 24 03:31:06 1999 From: richard@richardgordon.net (Richard Gordon) Date: Thu, 23 Sep 1999 22:31:06 -0400 Subject: [Pythonmac-SIG] Miscellaneous MacPython Questions Message-ID: I've accumulated several questions about using MacPython over the past few days and haven't been able to turn up answers on my own, so I figured that it was time to turn to the gurus for a little help. I consider myself somewhere between a newbie and a yearling as far as Python goes and hope that none of these indicate that I have overestimated my status. :-] 1. In the course of testing a text manipulation script that opens a file, reads it, and then outputs the processed data into a new text file, I have run into a problem if the output file already exists from previous tests. Specifically if foo.txt already exists when the script tries to set sys.stdout to foo.txt with the w switch, I get an invalid argument error that won't go away until I trash the existing foo.txt file. My expectation was that Python would simply overwrite the existing file the way that Perl does, but I guess not. Is this a Mac thing or what? In any case is there a switch that can be used to force an overwrite (not an append)? 2. Is there a switch (or something) that can be used to simply check the syntax of a script without actually trying to run it (kind of like the Check Syntax command in MacPerl)? 3. What exactly is the difference between MacFreeze and the BuildApplication droplet? 4. What is the correct syntax to get the profiler to work on a Mac? If I option launch Python and then try to set a unix command line like python profile.py myscript.py I get nowhere. 5. What's the preferred way to set sys.stdout back to the python.out window after you've already switched it to a file during script execution? I'm using sys.stdout = sys.__stdout__ and that works fine, but the __doc__ says to never use the __stdout__ static object and I was just wondering how come (and whether I am getting ready to find out the hard way if I continue to do that)? 6. If I was going to put an interface on a standalone Mac-only application, am I correct in believing that there is no reason to bother considering the use of (the very spooky) Tkinter over native Mac tools? 7. When .pyo files are created, is the optimization machine-environment-specific, cpu specific or what? 8. When you create a standalone with MacFreeze, is a python application effectively transformed into a C application? Is it likely to run faster as a standalone? That's about it. Thanks for help with any or all of the above. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From just@letterror.com Fri Sep 24 09:27:16 1999 From: just@letterror.com (Just van Rossum) Date: Fri, 24 Sep 1999 10:27:16 +0200 Subject: [Pythonmac-SIG] Miscellaneous MacPython Questions In-Reply-To: Message-ID: At 10:31 PM -0400 9/23/99, Richard Gordon wrote: >1. In the course of testing a text manipulation script that opens a >file, reads it, and then outputs the processed data into a new text >file, I have run into a problem if the output file already exists >from previous tests. Specifically if foo.txt already exists when the >script tries to set sys.stdout to foo.txt with the w switch, I get an >invalid argument error that won't go away until I trash the existing >foo.txt file. My expectation was that Python would simply overwrite >the existing file the way that Perl does, but I guess not. Is this a >Mac thing or what? In any case is there a switch that can be used to >force an overwrite (not an append)? It will give that exception if the file is still open. f = open("foo.txt", "w") will normally overwrite an existing file. >2. Is there a switch (or something) that can be used to simply check >the syntax of a script without actually trying to run it (kind of >like the Check Syntax command in MacPerl)? No. Would be a nice option for the IDE, though. >3. What exactly is the difference between MacFreeze and the >BuildApplication droplet? Mostly a different front end. >4. What is the correct syntax to get the profiler to work on a Mac? >If I option launch Python and then try to set a unix command line >like python profile.py myscript.py I get nowhere. Dunno... In the IDE, go to the little popup arrow on the top right, select "enable profiler" and run your script. After the script is done you'll be presented with a stats window. >5. What's the preferred way to set sys.stdout back to the python.out >window after you've already switched it to a file during script >execution? I'm using sys.stdout = sys.__stdout__ and that works fine, >but the __doc__ says to never use the __stdout__ static object and I >was just wondering how come (and whether I am getting ready to find >out the hard way if I continue to do that)? using __stdout__ works only if stdout was not already redirected, like in the IDE. I still prefer something like: savestdout = sys.stdout sys.stdout = myfile try: do stuff finally: sys.stdout = savestdout >6. If I was going to put an interface on a standalone Mac-only >application, am I correct in believing that there is no reason to >bother considering the use of (the very spooky) Tkinter over native >Mac tools? Depends: if you're already familiar with Tkinter you might want to try that. >7. When .pyo files are created, is the optimization >machine-environment-specific, cpu specific or what? None of these. It's only slightly optimized bytecode, and the speedup has never been interesting enough to me to use it... Look up the details in the reference manual. >8. When you create a standalone with MacFreeze, is a python >application effectively transformed into a C application? Is it >likely to run faster as a standalone? No. Maybe it will startup slightly faster, since all relevant modules are easier to find for Python. BuildApplication/MacFreeze will find all modules that the application depends on. It will create 'PYC ' resources for each .pyc file, and will stuff all shared libraries in the data fork of the app. These shared libraries are found through 'PYD ' resources. Just From maccgi@bellsouth.net Fri Sep 24 14:18:17 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Fri, 24 Sep 1999 09:18:17 -0400 Subject: [Pythonmac-SIG] Miscellaneous MacPython Questions In-Reply-To: References: Message-ID: At 10:27 +0200 09/24/1999, Just van Rossum wrote: >It will give that exception if the file is still open. f = open("foo.txt", >"w") will normally overwrite an existing file. Awk! I can't believe that I forgot to close the file! >Dunno... In the IDE, go to the little popup arrow on the top right, select >"enable profiler" and run your script. After the script is done you'll be >presented with a stats window. Very cool. Now I just need to figure out how to interpret the results. I was interested in the profiler partly because when I port my script to a Solaris Enterprise Server with a gig of ram and scsi3, it only executes 3 seconds faster than it does on an 8100/100 ppc- something is wrong with this picture and I suspect it involves inept programming. >using __stdout__ works only if stdout was not already redirected, like in >the IDE. I still prefer something like: > >savestdout = sys.stdout >sys.stdout = myfile >try: > do stuff >finally: > sys.stdout = savestdout OK, that makes sense. > >6. If I was going to put an interface on a standalone Mac-only > >application, am I correct in believing that there is no reason to > >bother considering the use of (the very spooky) Tkinter over native > >Mac tools? > >Depends: if you're already familiar with Tkinter you might want to try that. That settles that. :-] >BuildApplication/MacFreeze will find all modules that the application >depends on. It will create 'PYC ' resources for each .pyc file, and will >stuff all shared libraries in the data fork of the app. These shared >libraries are found through 'PYD ' resources. And I suppose that both BuildApplication and MacFreeze will also merge any .rsrc files that are used for dialogs, etc? Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From rgacote@AppropriateSolutions.com Fri Sep 24 15:17:03 1999 From: rgacote@AppropriateSolutions.com (Raymond Cote) Date: Fri, 24 Sep 1999 10:17:03 -0400 Subject: [Pythonmac-SIG] Miscellaneous MacPython Questions In-Reply-To: References: Message-ID: At 9:18 AM -0400 9/24/99, Richard Gordon wrote: >At 10:27 +0200 09/24/1999, Just van Rossum wrote: > >> >6. If I was going to put an interface on a standalone Mac-only >> >application, am I correct in believing that there is no reason to >> >bother considering the use of (the very spooky) Tkinter over native >> >Mac tools? >> >>Depends: if you're already familiar with Tkinter you might want to try that. > >That settles that. :-] I'd also recommend you look at WxWin that has a Python interface since it will also provide you with future portability (I believe latest Python interfaces are currently being worked on and older version available). I'm currently using under Windows, but chose it because I have a number of Mac products in mind. Less cumbersome than Tkinter. Closer to nice native interfaces. Ray ------------------------------------------------------------------- Raymond Cote, President Appropriate Solutions, Inc. www.AppropriateSolutions.com rgacote@AppropriateSolutions.com 603.924.6079(v) POB 458, Peterborough, NH 03458 603.924.8668(f) From maccgi@bellsouth.net Fri Sep 24 15:50:24 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Fri, 24 Sep 1999 10:50:24 -0400 Subject: [Pythonmac-SIG] Miscellaneous MacPython Questions In-Reply-To: References: Message-ID: At 10:17 -0400 09/24/1999, Raymond Cote wrote: >I'd also recommend you look at WxWin that has a Python interface >since it will also provide you with future portability (I believe >latest Python interfaces are currently being worked on and older >version available). >I'm currently using under Windows, but chose it because I have a >number of Mac products in mind. Less cumbersome than Tkinte Thanks for the suggestion, but I'm a little confused- are you talking about wxPython and, if so, I didn't think that it would work on a Mac at present? Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From robin@alldunn.com Fri Sep 24 16:31:38 1999 From: robin@alldunn.com (Robin Dunn) Date: Fri, 24 Sep 1999 08:31:38 -0700 Subject: [Pythonmac-SIG] Miscellaneous MacPython Questions References: Message-ID: <001b01bf06a1$f06fe6f0$1a25d2d1@jenkondev.com> > At 10:17 -0400 09/24/1999, Raymond Cote wrote: > >I'd also recommend you look at WxWin that has a Python interface > >since it will also provide you with future portability (I believe > >latest Python interfaces are currently being worked on and older > >version available). > >I'm currently using under Windows, but chose it because I have a > >number of Mac products in mind. Less cumbersome than Tkinte > > Thanks for the suggestion, but I'm a little confused- are you talking > about wxPython and, if so, I didn't think that it would work on a Mac > at present? > Not yet, but it is being worked on. -- Robin Dunn Software Craftsman robin@AllDunn.com http://AllDunn.com/robin/ http://AllDunn.com/wxPython/ Check it out! From draayer@door.net Mon Sep 27 08:05:53 1999 From: draayer@door.net (Dean E.Draayer) Date: Mon, 27 Sep 99 02:05:53 -0500 Subject: [Pythonmac-SIG] Re: Miscellaneous MacPython Questions Message-ID: <19990927071246713.AAA214@mail.door.net@[208.247.125.124]> >4. What is the correct syntax to get the profiler to work on a Mac? >If I option launch Python and then try to set a unix command line >like python profile.py myscript.py I get nowhere. I'm not sure about specifying the scripts on the command line like that, but in the interpreter you can say something like: profile.run('myscriptmainfunc()') The profiler is described in Chapter 10 of the Python Library Reference. I haven't used it much (yet), but it did work for me - quite useful and fun! The manual should help you interpret the results and also describes numerous options for controlling the profiler and/or the data it generates. >3. What exactly is the difference between MacFreeze and the >BuildApplication droplet? Isn't BuildApplication just the application form of MacFreeze? Like if you run macfreeze.py on itself? Anyway, one difference is that you can just drop a script on the BuildApplication icon but not on macfreeze.py. By the way, when I run either of these on some of my scripts, I get a ValueError: (-120, 'Directory not found') error. Probably I forgot to add to the search paths. But what I find curious is that the Traceback begins as follows: Traceback (innermost last): File "flap:jack:Python:Mac:scripts:BuildApplication.py", line 145, in ? File "flap:jack:Python:Mac:scripts:BuildApplication.py", line 49, in main File "flap:jack:Python:Mac:scripts:BuildApplication.py", line 86, in buildapplication and these definitely are no pathnames of any files on my computer. Is this anything to worry about? Jack? Dean From jack@oratrix.nl Wed Sep 29 13:14:52 1999 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 29 Sep 1999 14:14:52 +0200 Subject: [Pythonmac-SIG] Re: Miscellaneous MacPython Questions In-Reply-To: Message by "Dean E.Draayer" , Mon, 27 Sep 99 02:05:53 -0500 , <19990927071246713.AAA214@mail.door.net@[208.247.125.124]> Message-ID: <19990929121453.0760536E440@snelboot.oratrix.nl> > >3. What exactly is the difference between MacFreeze and the > >BuildApplication droplet? > > Isn't BuildApplication just the application form of MacFreeze? > Like if you run macfreeze.py on itself? Anyway, one difference > is that you can just drop a script on the BuildApplication icon > but not on macfreeze.py. That's basically the answer, indeed. macfreeze can do one extra thing and that is create some of the files you need to build a fully tailored statically loaded standalone application if you have CodeWarrior and python source. This shaves a few more seconds off the startup time of the application, but the process is rather convoluted so I never bothered to document it (and, hence, I'm the only one using it:-). > By the way, when I run either of these on some of my scripts, I > get a ValueError: (-120, 'Directory not found') error. Probably > I forgot to add to the search paths. But what I find curious is > that the Traceback begins as follows: > Traceback (innermost last): > File "flap:jack:Python:Mac:scripts:BuildApplication.py", line 145, in ? > File "flap:jack:Python:Mac:scripts:BuildApplication.py", line 49, in > main > File "flap:jack:Python:Mac:scripts:BuildApplication.py", line 86, in > buildapplication > and these definitely are no pathnames of any files on my computer. > Is this anything to worry about? Jack? No, not to worry, these are pathnames on _my_ computer. Which is only logical, as the BuildApplication applet was created on my computer, and at that time the source file pathnames were as you see them here. I can't tell you what the error was, though, as you've omitted the rest of the traceback (the filesnames of which should refer to your disk, so you should be able to interpret them yourself). -- 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 Sep 29 13:18:24 1999 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 29 Sep 1999 14:18:24 +0200 Subject: [Pythonmac-SIG] Custom Folder Icon (fwd) Message-ID: <19990929121824.8B51E36E440@snelboot.oratrix.nl> I didn't see this question appear here, and I don't know the answer myself, so can anyone help this person, maybe? Please reply directly as well as to the list, I'm not sure hung_jung_lu@adventure.com is on the list. ------- Forwarded Message From jack@oratrix.nl Wed Sep 29 21:55:55 1999 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 29 Sep 1999 22:55:55 +0200 Subject: [Pythonmac-SIG] MacPython 1.5.2 available, finally Message-ID: <19990929205600.547DEED745@oratrix.oratrix.nl> olks, after a long long wait, due to both me and Just being in the loop for a MacPython release, and both of us being very busy, we finally put a MacPython 1.5.2 release together. You can get it through http://www.cwi.nl/~jack/macpython.html . There is one gotcha: the release calls itself Python 1.5.2c1, both in version number and in the folder it installs into. Unfortunately, this was far more work to fix than it was worth (with Python sources having moved on significantly beyond 1.5.2 alreadyy), so we've decided not to fix it. I'll also have to skip on providing a list of highlights for this release (simply because I don't remember anymore), but be assured that there are many. And a final note to people who have sent me contributions over the last month but note that these are missing from the distribution: again, mea culpa, you'll find them in the next release. Oh yes, a final final note: over the last few weeks I've started receiving reports from people who had problems installing the previous MacPython on iMacs with extensions enabled. So far I haven't been able to detect a pattern in the reports. If anyone has a problem installing 1.5.2 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 joe@strout.net Wed Sep 29 22:19:20 1999 From: joe@strout.net (Joseph J. Strout) Date: Wed, 29 Sep 1999 14:19:20 -0700 Subject: [Pythonmac-SIG] MacPython 1.5.2 available, finally In-Reply-To: <19990929205600.547DEED745@oratrix.oratrix.nl> References: <19990929205600.547DEED745@oratrix.oratrix.nl> Message-ID: At 10:55 PM +0200 09/29/99, Jack Jansen wrote: >after a long long wait, due to both me and Just being in the loop for >a MacPython release, and both of us being very busy, we finally put a >MacPython 1.5.2 release together. You can get it through >http://www.cwi.nl/~jack/macpython.html . In the words of Luke Skywalker: "Yahoo!!!" This is super, guys. I'm really excited about this. I've been hesitating renewing my objection to Lisp and trying to suggest Python to my boss instead, because the last release has so many problems which I believe will be fixed in this release. So I'm very very happy to see this. Keep up the great work! Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From PClaerhout@CREO.BE Wed Sep 29 22:48:42 1999 From: PClaerhout@CREO.BE (Pieter Claerhout) Date: Wed, 29 Sep 1999 23:48:42 +0200 Subject: [Pythonmac-SIG] MacPython 1.5.2 available, finally Message-ID: <2B1262E83448D211AE4B00A0C9D61B0368854E@MSGEURO1> Does it include syntax coloring for the PythonIDE?? Kind regards, Pieter PClaerhout@creo.be -----Original Message----- From: Jack Jansen To: pythonmac-sig@python.org Sent: 9/29/99 10:55 PM Subject: [Pythonmac-SIG] MacPython 1.5.2 available, finally olks, after a long long wait, due to both me and Just being in the loop for a MacPython release, and both of us being very busy, we finally put a MacPython 1.5.2 release together. You can get it through http://www.cwi.nl/~jack/macpython.html . There is one gotcha: the release calls itself Python 1.5.2c1, both in version number and in the folder it installs into. Unfortunately, this was far more work to fix than it was worth (with Python sources having moved on significantly beyond 1.5.2 alreadyy), so we've decided not to fix it. I'll also have to skip on providing a list of highlights for this release (simply because I don't remember anymore), but be assured that there are many. And a final note to people who have sent me contributions over the last month but note that these are missing from the distribution: again, mea culpa, you'll find them in the next release. Oh yes, a final final note: over the last few weeks I've started receiving reports from people who had problems installing the previous MacPython on iMacs with extensions enabled. So far I haven't been able to detect a pattern in the reports. If anyone has a problem installing 1.5.2 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 _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://www.python.org/mailman/listinfo/pythonmac-sig From joe@strout.net Wed Sep 29 23:11:36 1999 From: joe@strout.net (Joseph J. Strout) Date: Wed, 29 Sep 1999 15:11:36 -0700 Subject: [Pythonmac-SIG] MacPython 1.5.2 available, finally In-Reply-To: <2B1262E83448D211AE4B00A0C9D61B0368854E@MSGEURO1> References: <2B1262E83448D211AE4B00A0C9D61B0368854E@MSGEURO1> Message-ID: At 11:48 PM +0200 09/29/99, Pieter Claerhout wrote: >Does it include syntax coloring for the PythonIDE?? It doesn't seem to. However, I've discovered where the IDE files are kept (they're in the Mac:Tools folder), and I'm preparing a series of patches which you'll be able to apply to add printing support, syntax coloring, etc. Stay tuned! Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From joe@strout.net Thu Sep 30 00:38:44 1999 From: joe@strout.net (Joseph J. Strout) Date: Wed, 29 Sep 1999 16:38:44 -0700 Subject: [Pythonmac-SIG] Printing Patch Message-ID: For the brave & adventurous: I've just posted a file which will patch the (1.5.2c1) IDE to add printing support. You can find it here: http://www.strout.net/info/coding/python/mac/index.html I'll try to get a syntax-coloring patch tomorrow or Friday. This has only been tested on my machine, so please try it only if you're brave and willing to tell me when something goes wrong. ;) If you're less than brave, just wait until the early-adopters and I have exercised it a bit; if you don't hear any complaints by next week, it should be safe. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From joe@strout.net Thu Sep 30 00:50:08 1999 From: joe@strout.net (Joseph J. Strout) Date: Wed, 29 Sep 1999 16:50:08 -0700 Subject: [Pythonmac-SIG] gnuplot on MacOS? Message-ID: Has anyone gotten Gnuplot.py to work on the Mac? The web page doesn't mention it, but there is a rather nice Mac implementation of gnuplot itself (as ports of command-line Unix tools go), so it doesn't seem unreasonable. Thanks, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From savageb@pacbell.net Thu Sep 30 06:28:24 1999 From: savageb@pacbell.net (savageb) Date: Wed, 29 Sep 1999 22:28:24 -0700 Subject: [Pythonmac-SIG] gnuplot on MacOS? Message-ID: <199909300528.WAA21482@mail-gw3.pacbell.net> >Subject: [Pythonmac-SIG] gnuplot on MacOS? >Date: Wed, Sep 29, 1999, 4:50 PM > Has anyone gotten Gnuplot.py to work on the Mac? The web page > doesn't mention it, but there is a rather nice Mac implementation of > gnuplot itself (as ports of command-line Unix tools go), so it > doesn't seem unreasonable. > Yes, Joe, I had it running a while back Tony Ingraldi did a wonderful job, you can use Python as an interactive front end, or from a script. I think I got my version *with* the MacGnuPlot port, but here is Mr. Ingraldi's email if necessary: A.M.Ingraldi@LaRC.nasa.gov best of luck with it. Bob (BTW, thanks for the printing patch!) From patrick@swdev.com Thu Sep 30 06:35:09 1999 From: patrick@swdev.com (patrick) Date: Wed, 29 Sep 1999 22:35:09 -0700 Subject: [Pythonmac-SIG] Mac Python support for MySQL References: <199909300503.BAA11832@python.org> Message-ID: <37F2F68B.A9F4FC58@swdev.com> Hey All! Haven't even downloaded the new build yet, but... Looking around yesterday I found site that has some tips for Mac SQL and pointers to code. It even includes a MySQL client library for the mac. I'd love to see the standard Mysqldb module available to me on the mac. If I could use much the same source on linux and mac for that it'd be great. Unfortunately, I've got no compiler for the mac. Any chance of including MySQL support? Thanks for the info. --p -- Patrick Curtain, Husband & Father ( i also write software ) patrick@swdev.com http://www.swdev.com/people/patrick/ patrick@ablecommerce.com http://www.ablecommerce.com/ From patrick@swdev.com Thu Sep 30 06:54:08 1999 From: patrick@swdev.com (patrick) Date: Wed, 29 Sep 1999 22:54:08 -0700 Subject: [Pythonmac-SIG] Mac Python support for MySQL References: <199909300545.WAA27429@mail-gw3.pacbell.net> Message-ID: <37F2FAFD.13B7B27C@swdev.com> Hey All! OOPS! Sorry about that. Thought I included the links. I found it on this page: http://www.lilback.com/macsql/ There's a link for MySQL/mSQL right there at the top. --p savageb wrote: > Patrick, I am also interested in a Mac version of MySQL stuff. Can you > forward the URL to me (or the list, where it can be archived)? > > thanks, Bob > > > I found site that has some tips for Mac SQL and pointers to code. > > It even includes a MySQL client library for the mac. I'd love to see > > the standard Mysqldb module available to me on the mac. -- Patrick Curtain, Husband & Father ( i also write software ) patrick@swdev.com http://www.swdev.com/people/patrick/ patrick@ablecommerce.com http://www.ablecommerce.com/ From maccgi@bellsouth.net Thu Sep 30 15:20:05 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Thu, 30 Sep 1999 10:20:05 -0400 Subject: [Pythonmac-SIG] MacPython 1.5.2 available, finally In-Reply-To: <19990929205600.547DEED745@oratrix.oratrix.nl> References: <19990929205600.547DEED745@oratrix.oratrix.nl> Message-ID: At 22:55 +0200 09/29/1999, Jack Jansen wrote: >olks, >after a long long wait, due to both me and Just being in the loop for >a MacPython release, and both of us being very busy, we finally put a >MacPython 1.5.2 release together. You can get it through >http://www.cwi.nl/~jack/macpython.html . I installed this and am kind of curious about why I seem to have lost some execution speed vs. 1.5.2b? A text processing script that formerly took 257 seconds to run now takes 369 seconds- same script, machine & test files and no changes in environment that I know of. I've given the interpreter 15000k just like before and the only difference that I can think of is that I used the easy install this time instead of only installing for PPC. Could this be executing 68k code instead of PPC code? That's the only explanation that I've thought of thus far, but maybe I am overlooking something. Thanks for any suggestions. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From jack@oratrix.nl Thu Sep 30 15:34:42 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 30 Sep 1999 16:34:42 +0200 Subject: [Pythonmac-SIG] MacPython 1.5.2 available, finally In-Reply-To: Message by Richard Gordon , Thu, 30 Sep 1999 10:20:05 -0400 , Message-ID: <19990930143442.51F1936E440@snelboot.oratrix.nl> > I installed this and am kind of curious about why I seem to have lost > some execution speed vs. 1.5.2b? A text processing script that > formerly took 257 seconds to run now takes 369 seconds- same script, > machine & test files and no changes in environment that I know of. Hmm, that's interesting. Checking whether you have a PPC or 68K interpreter is easy: look at the banner when you start an interpreter (it'll say PPC or 68K, along with the version number and date and such). The second thing to check is to run the script again: your .py files have to be compiled to .pyc files again after the new install, so maybe you measured that time as well. If you're still stuck at the 369 seconds you could try running test.pystone.main() in the old and new interpreter. If these also show this big difference it means that I probably did something really stupid and distributed a Python with debug on or something silly like that (but I _try_ not to do such things:-), so please let me know the results. If pystone appears to be the same speed in the old and new interpreter the problem is with one of the modules you use (re comes to mind when you say "textprocessing script"). You could try to use the profiler to see where the extra time is spent. -- 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 maccgi@bellsouth.net Thu Sep 30 15:51:59 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Thu, 30 Sep 1999 10:51:59 -0400 Subject: [Pythonmac-SIG] Printing Patch In-Reply-To: References: Message-ID: At 16:38 -0700 09/29/1999, Joseph J. Strout wrote: >For the brave & adventurous: I've just posted a file which will >patch the (1.5.2c1) IDE to add printing support. I applied the patch and, eventually, got things to work ok. Problems I ran across: 1. At some point, I believe that it starts looking for :Mac:Tools: FontSettings.pyc and since this wasn't part of my path when I originally compiled all, I didn't have a .pyc. I added the directory and ran compileall.py again, but then I ran into problems because it started trying to find things in :Mac:Tools:Mac:Tools:, so I had to remove :Mac:Tools: from my path to make it happy. 2. For reasons that escape me, the Page Setup and Print menu items that were installed both ended with an extra character that was the letter "a" with an umlaut. It didn't seem to break anything, but it looked strange, so I went back to square one and edited the patch to get rid of these, then reran the whole thing. 3. I figured it out on my own, but you might want to mention in the instructions that the patched PythonIDE.py script still needs to be dropped on BuildApplet to actually get things ready to run normally. 4. I like the line numbering on the printout, but noticed that at least on my printer (Epson 740i), line 00000 is begun above the printable portion of the page- the first line of succeeding pages prints normally as does line 00001. I don't know if the Epson driver doesn't know what to do with a line 00000 or what, but would guess that if line numbering began with 00001, it would work properly. As first tries go, this wasn't too ragged and I appreciate your efforts. Thanks. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From joe@strout.net Thu Sep 30 16:09:55 1999 From: joe@strout.net (Joseph J. Strout) Date: Thu, 30 Sep 1999 08:09:55 -0700 Subject: [Pythonmac-SIG] Printing Patch In-Reply-To: References: Message-ID: Hi Richard, Thanks for the feedback -- I'm eager to hear how well it works for others. (Theoretically we all have the same 1.5.2c1 system, but...) >1. At some point, I believe that it starts looking for :Mac:Tools: >FontSettings.pyc and since this wasn't part of my path when I >originally compiled all, I didn't have a .pyc. Wait. My patch certainly doesn't look for this... it must be when you ran BuildIDE.py? But this doesn't need any .pyc's; it automatically recompiles from the .py files. Do you still have the traceback it generated? > I added the directory and ran compileall.py again, but then I ran >into problems because it started trying to find things in >:Mac:Tools:Mac:Tools:, so I had to remove :Mac:Tools: from my path >to make it happy. Hmm... FWIW, I've never run compileall.py, nor did I change the default path. I'm at a loss to explain the problems you saw here. >2. For reasons that escape me, the Page Setup and Print menu items >that were installed both ended with an extra character that was the >letter "a" with an umlaut. It didn't seem to break anything, but it >looked strange, so I went back to square one and edited the patch to >get rid of these, then reran the whole thing. Ah... this is supposed to be the ellipsis character (like "..." but a single character in the Mac character set). Looks like this didn't survive the upload and download via http. I'll try changing it to three periods, which is unorthodox but probably nobody will know the difference. >3. I figured it out on my own, but you might want to mention in the >instructions that the patched PythonIDE.py script still needs to be >dropped on BuildApplet to actually get things ready to run normally. Hmm, no, I never had to do this. I just quit the IDE, double-click BuildIDE.py, and it rebuilds the PythonIDE applet for me. Did you do this step? If not, it could explain both problems 1 and 3. >4. I like the line numbering on the printout, but noticed that at >least on my printer (Epson 740i), line 00000 is begun above the >printable portion of the page- the first line of succeeding pages >prints normally as does line 00001. Hmm, now that you mention it, I've got something cut off there too. I'll look into it -- thanks for pointing this out. > I don't know if the Epson driver doesn't know what to do with a >line 00000 or what, but would guess that if line numbering began >with 00001, it would work properly. No, the numbers are just strings, they could be the Gettysburg Address for all the printer driver can tell. I think the numbering *does* begin with 00001, but there is clearly something getting cut off before the first line. I'll fix ASAP. >As first tries go, this wasn't too ragged and I appreciate your efforts. Thanks, and I appreciate your feedback! Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From bstankie@eye.psych.umn.edu Thu Sep 30 16:31:07 1999 From: bstankie@eye.psych.umn.edu (Brian J. Stankiewicz) Date: Thu, 30 Sep 1999 10:31:07 -0500 Subject: [Pythonmac-SIG] Problems with Tk using MacPython vers 1.5.2c1 Message-ID: Hi, I know that this is a bit of a newbie question, but I am trying to install MacPython on my 8500 with OS 8.0 and I am having a difficult time figuring out how to get the Tk commands to work. Here is a short session with the search paths included, but when I try to import Tkinter it tries to find _tkinter and cannot find the module. I found _tkinter.ppc.slib and placed a re-named copy _tkinter in the extensions folder, but this didn't do the trick either. Could someone please give me a hand on this? By the way, I have been having similar problems on my iMac at home. -Brian Python 1.5.2c1 (#56, Apr 12 1999, 14:19:52) [CW PPC w/GUSI w/MSL] Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> import sys >>> sys.path ['APS DRIVE:Applications:Python 1.5.2c1:Mac:Tools:IDE', 'APS DRIVE:Applications:Python 1.5.2c1:', 'APS DRIVE:Applications:Python 1.5.2c1:', 'APS DRIVE:Applications:Python 1.5.2c1:Lib', 'APS DRIVE:Applications:Python 1.5.2c1:Mac:PlugIns', 'APS DRIVE:Applications:Python 1.5.2c1:Mac:Lib', 'APS DRIVE:Applications:Python 1.5.2c1:Mac:Lib:lib-toolbox', 'APS DRIVE:Applications:Python 1.5.2c1:Mac:Lib:lib-scripting', 'APS DRIVE:Applications:Python 1.5.2c1:Extensions:img:Mac', 'APS DRIVE:Applications:Python 1.5.2c1:Extensions:img:Lib', 'APS DRIVE:Applications:Python 1.5.2c1:Extensions:Numerical:Lib'] >>> sys.path.append('APS DRIVE:Applications:Python 1.5.2c1:Lib:lib-tk') >>> from Tkinter import * Traceback (innermost last): File "", line 1, in ? File "APS DRIVE:Applications:Python 1.5.2c1:Lib:lib-tk:Tkinter.py", line 8, in ? import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter ____________________________________________________________ Brian J.Stankiewicz, Ph.D. |bstankie@eye.psych.umn.edu 75 East River Rd. | Department of Psychology | University of Minnesota |(Off)612-624-7353 Minneapolis, Minnesota 55455 |(Fax)612-626-2079 ________________________________|___________________________ http://vision.psych.umn.edu/www/people/brian ____________________________________________________________ From joe@strout.net Thu Sep 30 17:40:23 1999 From: joe@strout.net (Joseph J. Strout) Date: Thu, 30 Sep 1999 09:40:23 -0700 Subject: [Pythonmac-SIG] revised printing patch Message-ID: I've updated the printing patch. Changes today: - Line numbers now start at 1 rather than 0, as Richard suggested. - We now indent 1/4 inch from the top, and 1/8 inch from the left, to keep lines from being cut off by the printer. - We now find the proper line spacing from the font metrics, rather than just guessing based on the nominal font size. - The patch is now broken into two files, PrintingPatch.py and PatchUtils.py. The latter contains code which may be used on other patches. - The patch is now a little smarter; after using this new version once, you can use it again and it will recognize the need to undo previous patching. But please note! You will have to manually undo yesterday's patch the first time. Here's the procedure: 1. Open up Python 1.5.2c1:Mac:Tools:IDE. 2. Delete PyEdit.py and PythonIDEMain.py. 3a. Rename PyEdit.py.bak to PyEdit.py. 3b. Rename PythonIDEMAin.py.bak to PythonIDEMain.py. That's it, you're back to the original state (whew!), and can go ahead and apply the new patch. Hereafter, you can skip these steps, as they will be done for you. Things still less-than-ideal about the printing support: - The page is always assumed to be 10 inches long. This will probably cause grief when printing in landscape mode, or scaled, or whatever. I don't know how to get the page size from the print record (any ideas?). - Hmm... well, actually that's pretty much it. If you have any trouble, please let me know right away; don't waste too much time wrestling with it, because it ought to be a very quick & painless operation. If it's not, something is wrong and I want to know about it! Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From maccgi@bellsouth.net Thu Sep 30 17:59:55 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Thu, 30 Sep 1999 12:59:55 -0400 Subject: [Pythonmac-SIG] Printing Patch In-Reply-To: References: Message-ID: At 08:09 -0700 09/30/1999, Joseph J. Strout wrote: >>1. At some point, I believe that it starts looking for :Mac:Tools: >>FontSettings.pyc and since this wasn't part of my path when I >>originally compiled all, I didn't have a .pyc. > >Wait. My patch certainly doesn't look for this... it must be when >you ran BuildIDE.py? But this doesn't need any .pyc's; it >automatically recompiles from the .py files. Do you still have the >traceback it generated? Yes, I think it occurred during BuildIDE.py and, no, I didn't save the traceback. If I ran BuildIDE.pyc, would this cause it to want .pyc files (I might have done that)? >>I added the directory and ran compileall.py again, but then I ran >>into problems because it started trying to find things in >>:Mac:Tools:Mac:Tools:, so I had to remove :Mac:Tools: from my path >>to make it happy. > >Hmm... FWIW, I've never run compileall.py, nor did I change the >default path. I'm at a loss to explain the problems you saw here. The pathing variable is set to: basePath = string.join(string.split(sys.path[1],':')[:-1],':') + ':Mac:Tools:IDE:' So if :Mac:Tools:IDE: is already in the sys.path, it gets confused (it wouldn't have been an issue except for the gymnastics under #1, above. > >>3. I figured it out on my own, but you might want to mention in the >>instructions that the patched PythonIDE.py script still needs to be >>dropped on BuildApplet to actually get things ready to run normally. > >Hmm, no, I never had to do this. I just quit the IDE, double-click >BuildIDE.py, and it rebuilds the PythonIDE applet for me. Did you >do this step? If not, it could explain both problems 1 and 3. I did do this, but just wound up with PythonIDE.py. Again I might have run BuildIDE.pyc if that makes any difference. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From maccgi@bellsouth.net Thu Sep 30 18:00:09 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Thu, 30 Sep 1999 13:00:09 -0400 Subject: [Pythonmac-SIG] MacPython 1.5.2 available, finally In-Reply-To: <19990930143442.51F1936E440@snelboot.oratrix.nl> References: <19990930143442.51F1936E440@snelboot.oratrix.nl> Message-ID: At 16:34 +0200 09/30/1999, Jack Jansen wrote: >Hmm, that's interesting. Checking whether you have a PPC or 68K interpreter is >easy: look at the banner when you start an interpreter (it'll say PPC or 68K, >along with the version number and date and such). The interpreter says it's ppc. >The second thing to check is to run the script again: your .py files have to >be compiled to .pyc files again after the new install, so maybe you measured >that time as well. I actually lost time once (464 seconds), then gained (298 seconds) but am still well off the earlier performance. >If you're still stuck at the 369 seconds you could try running >test.pystone.main() in the old and new interpreter. >If these also show this big difference it means that I probably did something >really stupid and distributed a Python with debug on or something silly like >that (but I _try_ not to do such things:-), so please let me know the results. Sorry but I tossed the beta installation (and installer) once I got things running. In any case, I now think it's something local to my environment rather than a problem with the release as such. >If pystone appears to be the same speed in the old and new interpreter the >problem is with one of the modules you use (re comes to mind when you say >"textprocessing script"). You could try to use the profiler to see where the >extra time is spent. I am using the re module and some of the things it is doing profile much slower than I recall when I profiled this under the beta. I'll keep playing with it and see if I can figure out what's going on. Thanks. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From joe@strout.net Thu Sep 30 18:11:18 1999 From: joe@strout.net (Joseph J. Strout) Date: Thu, 30 Sep 1999 10:11:18 -0700 Subject: [Pythonmac-SIG] Printing Patch In-Reply-To: References: Message-ID: At 12:59 PM -0400 09/30/99, Richard Gordon wrote: >Yes, I think it occurred during BuildIDE.py and, no, I didn't save >the traceback. If I ran BuildIDE.pyc, would this cause it to want >.pyc files (I might have done that)? No, that shouldn't make any difference. >The pathing variable is set to: >basePath = string.join(string.split(sys.path[1],':')[:-1],':') + >':Mac:Tools:IDE:' > >So if :Mac:Tools:IDE: is already in the sys.path, it gets confused >(it wouldn't have been an issue except for the gymnastics under #1, >above. Only if the :Mac:Tools:IDE is element 1 of sys.path, rather than any other element. My sys.path looks like this: ['Chinacat:Applications:Python 1.5.2c1:Python IDE', 'Chinacat:Applications:Python 1.5.2c1:', 'Chinacat:Applications:Python 1.5.2c1:', 'Chinacat:Applications:Python 1.5.2c1:Lib', 'Chinacat:Applications:Python 1.5.2c1:Mac:PlugIns', 'Chinacat:Applications:Python 1.5.2c1:Mac:Lib', 'Chinacat:Applications:Python 1.5.2c1:Mac:Lib:lib-toolbox', 'Chinacat:Applications:Python 1.5.2c1:Mac:Lib:lib-scripting', 'Chinacat:Applications:Python 1.5.2c1:Extensions:img:Mac', 'Chinacat:Applications:Python 1.5.2c1:Extensions:img:Lib', 'Chinacat:Applications:Python 1.5.2c1:Extensions:Numerical:Lib'] Element 0 is the folder you're running the script from, and element 1 should be the Python folder. Is that what yours looks like? >>Hmm, no, I never had to do this. I just quit the IDE, double-click >>BuildIDE.py, and it rebuilds the PythonIDE applet for me. > >I did do this, but just wound up with PythonIDE.py. Again I might >have run BuildIDE.pyc if that makes any difference. Hmm, no, that's just very odd. You are doing all this on 1.5.2c1, right? PowerPC version? I'm trying to imagine why it might act differently for you than for me. Thanks, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From maccgi@bellsouth.net Thu Sep 30 18:35:50 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Thu, 30 Sep 1999 13:35:50 -0400 Subject: [Pythonmac-SIG] Printing Patch In-Reply-To: References: Message-ID: At 10:11 -0700 09/30/1999, Joseph J. Strout wrote: >['Chinacat:Applications:Python 1.5.2c1:Python IDE', >'Chinacat:Applications:Python 1.5.2c1:', >'Chinacat:Applications:Python 1.5.2c1:', >'Chinacat:Applications:Python 1.5.2c1:Lib', >'Chinacat:Applications:Python 1.5.2c1:Mac:PlugIns', >'Chinacat:Applications:Python 1.5.2c1:Mac:Lib', >'Chinacat:Applications:Python 1.5.2c1:Mac:Lib:lib-toolbox', >'Chinacat:Applications:Python 1.5.2c1:Mac:Lib:lib-scripting', >'Chinacat:Applications:Python 1.5.2c1:Extensions:img:Mac', >'Chinacat:Applications:Python 1.5.2c1:Extensions:img:Lib', >'Chinacat:Applications:Python 1.5.2c1:Extensions:Numerical:Lib'] > >Element 0 is the folder you're running the script from, and element >1 should be the Python folder. Is that what yours looks like? I see. My element 0 is 'Poindexter:Python 1.5.2:Mac:Tools:IDE' so I guess that explains that. > >>>Hmm, no, I never had to do this. I just quit the IDE, >>>double-click BuildIDE.py, and it rebuilds the PythonIDE applet for >>>me. >> >>I did do this, but just wound up with PythonIDE.py. Again I might >>have run BuildIDE.pyc if that makes any difference. > >Hmm, no, that's just very odd. You are doing all this on 1.5.2c1, >right? PowerPC version? I'm trying to imagine why it might act >differently for you than for me. Yes, 1.5.2c1 PPC. Very strange. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From managan@llnl.gov Thu Sep 30 20:08:17 1999 From: managan@llnl.gov (Rob Managan) Date: Thu, 30 Sep 1999 12:08:17 -0700 Subject: [Pythonmac-SIG] Printing Patch In-Reply-To: References: Message-ID: As far as the printing patch goes. I report the same problem as Richard Gordon. I open up PrintingPath.py in the IDE (either by starting the Python IDE icon or dropping the file on the IDE icon). I enable the debugger and run the script. when I step over the line import sys and look at the path I find that path[0:2] 'Macintosh HD:Python:Python 1.5.2c1:printing Patch', 'Macintosh HD:Python:Python 1.5.2c1:Mac:Tools:IDE', 'Macintosh HD:Python:Python 1.5.2c1:' It seems that the first one is the folder for the script, the second is the location of the IDE and then we have the Python folder. I had just installed the 1.5.2c1 version as well. So Joe, how do you start up the IDE? I will note that if I double click on the IDE, and then in the console window type 'import sys', and type 'sys.path' that I get: 'Macintosh HD:Python:Python 1.5.2c1:Mac:Tools:IDE', 'Macintosh HD:Python:Python 1.5.2c1:', 'Macintosh HD:Python:Python 1.5.2c1:', 'Macintosh HD:Python:Python 1.5.2c1:Lib' After I open the PrintingPatch.py file there is no change. Once I start the script I get the result I first described. It appears to prefix the path with the scripts folder. All said and done when I change the definition of basepath in PrintingPatch.py to basePath = string.join(string.split(sys.path[2],':')[:-1],':') + ':Mac:Tools:IDE:' it works for me. *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan LLNL ph: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From joe@strout.net Thu Sep 30 20:39:21 1999 From: joe@strout.net (Joseph J. Strout) Date: Thu, 30 Sep 1999 12:39:21 -0700 Subject: [Pythonmac-SIG] Printing Patch In-Reply-To: References: Message-ID: Thanks Rob. Clearly the order of things in sys.path is not reliable. I need another way to get the location of the IDE folder... I suppose at worst, I just search sys.path for the one that ends in something recognizable (like "1.5.2c1:") and take it from there. There must be a better way, though... Anybody have any ideas? Thanks, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From A.M.INGRALDI@larc.nasa.gov Thu Sep 30 21:40:39 1999 From: A.M.INGRALDI@larc.nasa.gov (Anthony M. Ingraldi) Date: Thu, 30 Sep 1999 16:40:39 -0400 Subject: [Pythonmac-SIG] gnuplot on MacOS? Message-ID: <199909302038.QAA21387@express.larc.nasa.gov> On Thursday, September 30, 1999, savageb wrote: >> Has anyone gotten Gnuplot.py to work on the Mac?... > >Yes, Joe, I had it running a while back Tony Ingraldi did a wonderful job, >you can use Python as an interactive front end, or from a script. I think I >got my version *with* the MacGnuPlot port, but here is Mr. Ingraldi's email >if necessary: The files that I contributed to the MacGnuPlot port allow users to interact with MacGnuPlot via a console window in essentially the same way as you would on UNIX. After seeing Joe's post today, I downloaded the Gnuplot package from http://monsoon.harvard.edu/~mhagger/Gnuplot/Gnuplot.html and I now have a version of the Gnuplot package that will run on a Mac. Well, at least the demo.py file executes properly. I haven't tested it beyond that. I'll probably contact the author of the Gnuplot package to see if he would be interested in incorporating the small mods into the Gnuplot distribution. In the meantime, if anyone on this list would like a copy of the modified package, let me know and I'll e-mail it to you. -- Tony Ingraldi A.M.INGRALDI@LaRC.NASA.GOV Phone : (757) 864-3039 Fax : (757) 864-7892 From joe@strout.net Thu Sep 30 21:49:32 1999 From: joe@strout.net (Joseph J. Strout) Date: Thu, 30 Sep 1999 13:49:32 -0700 Subject: [Pythonmac-SIG] Advanced Editor patch Message-ID: Hi gang, OK, here's a patch (at http://www.strout.net/python/mac/) which extends the IDE's editor in a couple of ways: Syntax Coloring: This feature highlights keywords, strings, comments, etc. in various colors and styles. A new menu command in the pop-up menu above the vertical scrollbar lets you turn this on and off. This feature is still a work in progress; and has several limitations: - It can get confused when multi-line strings are involved. If that happens, just turn coloring off and back on; that should fix it. (In the future we may have a command key to do this more quickly.) - It assumes you have Profont installed, and want to use it. I can't imagine why you wouldn't, but if it's a problem let me know and we'll talk. Function Look-up: This feature looks for doc strings for a function or class when you type a question mark ("?") after the function name in an editor window. For example, go into any IDE editor window at type "string?". The string.__doc__ will be printed to the output window. It also works for functions, e.g. "string.strip?". When the query is successful, the question mark is absorbed (not entered into the editor). If you really need to type the question mark after a known function, you'll have to type it first after a space, and then delete the space. I've also updated both patches to use the sys.exec_prefix trick, which should hopefully solve the problems some folks have been having with the path. This patch only patches PyEdit.py a little bit; most of the real new functionality is implemented by a new "PyAdvancedEditor" module. This is handy, because it means that we can hack on PyAdvancedEditor.py and distribute the updates without having to reapply any patches. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From joe@strout.net Thu Sep 30 22:19:00 1999 From: joe@strout.net (Joseph J. Strout) Date: Thu, 30 Sep 1999 14:19:00 -0700 Subject: [Pythonmac-SIG] "inspect" Message-ID: Me again -- just wanted to point out that some cool new features *did* make it into this release -- at least, I think they're new. One is the "inspect" function, now built into the console window. Try this in the IDE console window (command-0): import sys inspect(sys) Cool, huh? You can inspect anything except unitary types like numbers and strings. Just says he never uses the console window, but I use this all the time, so I thought it worth pointing out. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From maccgi@bellsouth.net Thu Sep 30 23:33:52 1999 From: maccgi@bellsouth.net (Richard Gordon) Date: Thu, 30 Sep 1999 18:33:52 -0400 Subject: [Pythonmac-SIG] Advanced Editor patch In-Reply-To: References: Message-ID: At 13:49 -0700 09/30/1999, Joseph J. Strout wrote: >OK, here's a patch (at http://www.strout.net/python/mac/) which >extends the IDE's editor in a couple of ways: Hi Joe I trashed everything from earlier today and reinstalled Python from scratch, then got your revised printing patch as well as the editor patch. This time everything went very well, tho I still had to use BuildApplet to get where I wanted to be (the PythonIDE icon that was left from all of the patching had a generic document icon). The only other catch was that I had to get rid of unix line endings after downloading your stuff, but that's no big deal. Anyway, I'm pleased with your efforts and really appreciate these enhancements. Richard Gordon -------------------- Gordon Consulting & Design Database Design/Scripting Languages mailto:richard@richardgordon.net http://www.richardgordon.net 770.971.6887 (voice) 770.216.1829 (fax) From joe@strout.net Thu Sep 30 23:47:08 1999 From: joe@strout.net (Joseph J. Strout) Date: Thu, 30 Sep 1999 15:47:08 -0700 Subject: [Pythonmac-SIG] Advanced Editor patch In-Reply-To: References: Message-ID: At 6:33 PM -0400 09/30/99, Richard Gordon wrote: >I trashed everything from earlier today and reinstalled Python from >scratch, then got your revised printing patch as well as the editor >patch. This time everything went very well, tho I still had to use >BuildApplet to get where I wanted to be (the PythonIDE icon that was >left from all of the patching had a generic document icon). The generic document icon is probably just a Finder database issue; you probably could have got by rebuilding the desktop (or possibly just closing the Python folder and opening it again). > The only other catch was that I had to get rid of unix line endings >after downloading your stuff, but that's no big deal. OK, this comes from the way your browser was configured and how you downloaded the files; it's a pretty common problem. I like to put the Python source right on the web page so you can view it before saving it, but it does cause this little difficulty with some browsers... I'll try to come up with a clever solution that doesn't involve me updating a Stuffit archive every time I update the files. ;) > Anyway, I'm pleased with your efforts and really appreciate these >enhancements. Thanks. I'm glad to hear it's working for you! FYI, I'm now working on improving the double-click behavior, so that it selects a "word" based on proper Python delimiters, and if you double-click a grouping character (like '(', '[', '{', or a quotation mark), it selects the whole group (i.e., to the corresponding character). Coming along nicely so far, though quotation marks are going to be tricky, since there's no way to tell whether a particular quote you're looking at is the starting or ending quote without analyzing the whole file. On that topic, does anyone understand what command-clicking currently does? It selects a range of text, but I can't see any rhyme or reason to the range it selects. MCL has a very cool feature when you command-click somewhere, rather than moving the text cursor, it copies the "block" of text where you clicked to the current insertion point. Extremely handy, saves your fingers a lot of work. (A "block" of text is what you would have gotten by double-clicking that same location.) I'd like to add this feature too. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------'