From erik@letterror.com Wed Dec 1 11:33:19 1999 From: erik@letterror.com (Erik van Blokland) Date: Wed, 1 Dec 1999 12:33:19 +0100 Subject: [Pythonmac-SIG] not very Standard_Suite Message-ID: <199912011133.MAA11934@leidschenveen.denhaag.dataweb.net> hello, I've been playing around with gensuitemodule and ran into something odd. Gensuitemodule creates a Standard_Suite.py file for each application it wraps. I assumed that this file was the same as the Standard_Suite.py included in the python distribution at Python 1.5.1:Mac:Lib:lib-scripting:Standard_Suite.py and I threw the newly generated Standard_Suite in favor of the standard-python-standard-suite. Then I discovered several missing methods and a bunch of missing constants. I needed to import functionality from both Standard_Suites: I regenerated the new one, renamed it. Then my final object inherits from both and it seems to work. But it's a bit clumsy. Does each application have it's own ideas about what is needed in a Standard_Suite? are there more elegant ways of dealing with this? erik van blokland -- letterror From A.M.INGRALDI@larc.nasa.gov Wed Dec 1 13:20:24 1999 From: A.M.INGRALDI@larc.nasa.gov (Anthony M. Ingraldi) Date: Wed, 01 Dec 1999 08:20:24 -0500 Subject: [Pythonmac-SIG] console vs. BuildApplication Message-ID: Hello, I have built a python/tk application using the BuildApplication utility and it appears that the console window cannot be hidden when using applications built in this manner. I have specified the "Delay console window until needed" option for the application but the console still comes up when the application launches. This wouldn't be all that annoying if it at least came up in behind the tk window. Is there an alternate method used to hide the console for python applications? -- Tony Ingraldi A.M.INGRALDI@LaRC.NASA.GOV Phone : (757) 864-3039 Fax : (757) 864-7892 From jack@oratrix.nl Thu Dec 2 11:08:23 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 02 Dec 1999 12:08:23 +0100 Subject: [Pythonmac-SIG] not very Standard_Suite In-Reply-To: Message by Erik van Blokland , Wed, 1 Dec 1999 12:33:19 +0100 , <199912011133.MAA11934@leidschenveen.denhaag.dataweb.net> Message-ID: <19991202110823.84077370CF2@snelboot.oratrix.nl> I don't fully understand how OSA inheritance works, so that's why the current scheme is a bit clumsy. The inheritance _is_ specified in the various Inside Mac chapters, so if someone cares to implement this correctly: please be my guest. I think the inheritance goes something like 1. If you declare the suite without any content you get the standard one. 2. If you put content in you have to add empty placeholders for all things you want to inherit as-is. 3. For anything you want to modify (add extra optional parameters, for instance) you have to fully specify it. This could be implemented in Python with a bit of redesign: currently the suite name is used both as module name and class name, but you should use the suite name as class name only and the application name as module name. Then you could do something like # File CodeWarrior.py import Applescript class Standard_Suite(Applescript.Standard_Suite): ... override anything you want ... -- 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 Thu Dec 2 11:20:45 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 02 Dec 1999 12:20:45 +0100 Subject: [Pythonmac-SIG] console vs. BuildApplication In-Reply-To: Message by "Anthony M. Ingraldi" , Wed, 01 Dec 1999 08:20:24 -0500 , Message-ID: <19991202112045.D6EC1370CF2@snelboot.oratrix.nl> > I have built a python/tk application using the BuildApplication utility and > it appears that the console window cannot be hidden when using applications > built in this manner. I have specified the "Delay console window until > needed" option for the application but the console still comes up when the > application launches. This wouldn't be all that annoying if it at least > came up in behind the tk window. Is there an alternate method used to hide > the console for python applications? Hmm, strange. Just that we're talking about the same thing: you do understand that the console will pop up as soon as you write something to it or read from it, even with the "hidden until needed" bit on? It may be that someone is writing to it, somewhere, which you could circumvene by redirecting stdin/stdout/stderr somewhere. -- 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 giorgio@dimi.uniud.it Thu Dec 2 13:20:26 1999 From: giorgio@dimi.uniud.it (Giorgio Brajnik) Date: Thu, 2 Dec 1999 14:20:26 +0100 (MET) Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? Message-ID: <199912021320.OAA01806@galileo.dimi.uniud.it> [this is a reposting, hoping that some Mac guru could help me] Hi. I'm in the process of planning to port a Python application that is being developed on Linux to the Mac. One of the many questions I have is how to emulate in Python/Mac something like: def doit(infile, outfile, errfile, exefile): """ execute "exefile" on "infile" and write "outfile" and "errfile" """ cmd = '%s < "%s" > "%s" 2> "%s"'%(exefile, infile, outfile, errfile) os.system(cmd) return (outfile, errfile) Any suggestion? Giorgio Brajnik ______________________________________________________________________ Dip. di Matematica e Informatica | voice: +39 (432) 55.8445 Universita` di Udine | fax: +39 (432) 55.8499 Via delle Scienze, 206 | email: giorgio@dimi.uniud.it Loc. Rizzi -- 33100 Udine -- ITALY | http://www.dimi.uniud.it/~giorgio ------- End of forwarded message ------- From A.M.INGRALDI@larc.nasa.gov Thu Dec 2 13:24:02 1999 From: A.M.INGRALDI@larc.nasa.gov (Anthony M. Ingraldi) Date: Thu, 02 Dec 1999 08:24:02 -0500 Subject: [Pythonmac-SIG] console vs. BuildApplication In-Reply-To: <19991202112045.D6EC1370CF2@snelboot.oratrix.nl> Message-ID: On 12/2/99 6:20 AM, Jack Jansen wrote: > Just that we're talking about the same thing: you do understand that the > console will pop up as soon as you write something to it Yes, I understand that. This very same code works as expected when run as an applet. -- Tony Ingraldi A.M.INGRALDI@LaRC.NASA.GOV Phone : (757) 864-3039 Fax : (757) 864-7892 From jack@oratrix.nl Thu Dec 2 13:25:48 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 02 Dec 1999 14:25:48 +0100 Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? In-Reply-To: Message by Giorgio Brajnik , Thu, 2 Dec 1999 14:20:26 +0100 (MET) , <199912021320.OAA01806@galileo.dimi.uniud.it> Message-ID: <19991202132612.8C7C3370CF2@snelboot.oratrix.nl> I'm afraid this is impossible, as MacOS has no concept of stdin/stdout/stderr. You can make this work for some applications, on a per-application basis, but there is no general solution. If you can give some details on the program you're trying to execute someone here may be able to come up with a solution that'll work for this particular case. > I'm in the process of planning to port a Python application that > is being developed on Linux to the Mac. One of the many questions I > have is how to emulate in Python/Mac something like: > > > def doit(infile, outfile, errfile, exefile): > """ > execute "exefile" on "infile" and write "outfile" and "errfile" > """ > cmd = '%s < "%s" > "%s" 2> "%s"'%(exefile, infile, outfile, errfile) > os.system(cmd) > return (outfile, errfile) -- 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 giorgio@dimi.uniud.it Thu Dec 2 13:52:23 1999 From: giorgio@dimi.uniud.it (Giorgio Brajnik) Date: Thu, 2 Dec 1999 14:52:23 +0100 (MET) Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? In-Reply-To: <19991202132612.8C7C3370CF2@snelboot.oratrix.nl> (message from Jack Jansen on Thu, 02 Dec 1999 14:25:48 +0100) References: <19991202132612.8C7C3370CF2@snelboot.oratrix.nl> Message-ID: <199912021352.OAA01858@galileo.dimi.uniud.it> Thanks a lot, Jack. > I'm afraid this is impossible, as MacOS has no concept of stdin/stdout/stderr. > You can make this work for some applications, on a per-application basis, but > there is no general solution. I suspected that os.system() couldn't be implemented directly on Macs. What I was looking for is some method (perhaps based on AppleScript, and/or some sort of launch() routines) to obtain the same result. I'm very happy with Python, and consider it a beatiful and effective glue language. But PythonMac falls short on this aspect if there are no easy ways to let two separate applications talk. > > If you can give some details on the program you're trying to execute someone > here may be able to come up with a solution that'll work for this particular > case. I'm willing to remove the distinction between stdout and stderr, but still need to launch a batch application on an input file, wait its termination and read its results from a file. [BTW, the application I need to run is nsgmls, a SGML-based validator (http://www.jclark.com/sp/). ] > > > I'm in the process of planning to port a Python application that > > is being developed on Linux to the Mac. One of the many questions I > > have is how to emulate in Python/Mac something like: > > > > > > def doit(infile, outfile, errfile, exefile): > > """ > > execute "exefile" on "infile" and write "outfile" and "errfile" > > """ > > cmd = '%s < "%s" > "%s" 2> "%s"'%(exefile, infile, outfile, errfile) > > os.system(cmd) > > return (outfile, errfile) > Giorgio Brajnik ______________________________________________________________________ Dip. di Matematica e Informatica | voice: +39 (0432) 55.8445 Universita` di Udine | fax: +39 (0432) 55.8499 Via delle Scienze, 206 | email: giorgio@dimi.uniud.it Loc. Rizzi -- 33100 Udine -- ITALY | http://www.dimi.uniud.it/~giorgio From jack@oratrix.nl Thu Dec 2 14:51:34 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 02 Dec 1999 15:51:34 +0100 Subject: [Pythonmac-SIG] console vs. BuildApplication In-Reply-To: Message by "Anthony M. Ingraldi" , Thu, 02 Dec 1999 08:24:02 -0500 , Message-ID: <19991202145134.CBEC0370CF2@snelboot.oratrix.nl> > On 12/2/99 6:20 AM, Jack Jansen wrote: > > > Just that we're talking about the same thing: you do understand that the > > console will pop up as soon as you write something to it > > Yes, I understand that. This very same code works as expected when run as > an applet. Hmm, interesting. Could you have a look at the GUI resources in both the working applet and nonworking application? Both should be the same, and have resource ID 10241. I'm asking this because the only thing I can think of right now is that somehow your application didn't get a 10241 GUI resource but a 10240 one, which is overridden by any preferences setting you have. For the curious, and for the record as I don't think this process is documented anywhere yet: for all resources (python path initialization, options, gusi options) we search four places and use the first match: 1. Preference file, override resource ID 2. Application, override resource ID 3. Preference file, normal resource ID 4. Application, normal resource ID The first one doesn't normally find anything, the second one finds EditPythonPrefs settings in the applet/application, the third one finds system-wide EditPythonPrefs settings and the last one finds the "factory defaults" in the interpreter. -- 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 Thu Dec 2 15:00:45 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 02 Dec 1999 16:00:45 +0100 Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? In-Reply-To: Message by Giorgio Brajnik , Thu, 2 Dec 1999 14:52:23 +0100 (MET) , <199912021352.OAA01858@galileo.dimi.uniud.it> Message-ID: <19991202150046.1EF8C370CF2@snelboot.oratrix.nl> > [BTW, the application I need to run is nsgmls, a SGML-based validator > (http://www.jclark.com/sp/). ] And are you going to port nsgmls yourself, or is it already available for the mac? If you're doing the port yourself you could think of wrapping the whole thing up in a Python extension module, so you don't have to fire up a separate program at all. If you have a port of nsgmls and it understands the "Open Document" Appleevent you can use the applescript modules to first ask the finder to open the application (see aetools.TalkTo for sample code) and then use the standard scripting methods to ask the application to open the file (an example is in the Mac:Demo folder). And if nsgmls has a nice unique signature you can even skip the first step if your input file has the correct creator: send the "open document" command to the finder and it'll open the app as well. -- 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 tschinke@swissonline.ch Thu Dec 2 21:10:11 1999 From: tschinke@swissonline.ch (Vincenzo Tschinke) Date: Thu, 2 Dec 1999 22:10:11 +0100 Subject: [Pythonmac-SIG] TOGL for Mac Message-ID: Hi everybody! I am attempting to port TOGL to the Mac. I am interested in such a port because I would like to use and develop on the Mac the Python code with Tk and OpenGL calls that I have running on SGI's. I am doing the port myself because it very much seems to me that nobody else is willing to do it. If this is not the case, please let me know. I am at a very early stage of this project. I am using the source code for TOGL 1.5 and Tcl/Tk 8.0.5. I use Tcl/Tk 8.0 since this is the version interfaces to my current Python release, 1.5.2 on both Mac and SGI. I was able to resolve all library calls to Tcl/Tk from TOGL, and a few to OpenGL libraries. I use CodeWarrior Pro 4 and Apple's OpenGL SDK 1.0. I am now planning to look at the GLX calls and replace them with corresponding AGL calls, when possible. I would like to avoid using the GLUT library, except for prototyping. AGL is Apple's OpenGL interface, corresponding to GLX on X window and WGL on MS Windows. Since this is an interface to Tk anyways, I guess it's OK not to use "portable" libraries such as GLUT. If somebody thinks I better stick to GLUT, please let me know why. Any suggestion from the Mac/OpenGL/Tcl/Tk/Python community is warmly welcome. All the best, Vincenzo Tschinke ======================= Vincenzo Tschinke Kernmattstr. 24 CH-4102 Binningen Switzerland +4161 422 1991 (T+F) tschinke@swissonline.ch ======================= From managan@llnl.gov Thu Dec 2 22:25:18 1999 From: managan@llnl.gov (Rob Managan) Date: Thu, 2 Dec 1999 14:25:18 -0800 Subject: [Pythonmac-SIG] Re: TOGL for Mac Message-ID: At 1:06 PM -0800 12/2/99, tschinke@swissonline.ch wrote: >Hi everybody! > >I am attempting to port TOGL to the Mac. > >I am interested in such a port because I would like to use >and develop on the Mac the Python code with Tk and OpenGL >calls that I have running on SGI's. > I concur that no one else seems to have the time for it, especially me! I just wanted to remind you that I recently submitted my non-ToGL Macintosh stuff to the PyOpenGL CVS server if you want to look at it. Again this is a pure GLUT version. *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan LLNL ph: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From etienne@alias.it Fri Dec 3 11:58:25 1999 From: etienne@alias.it (etienne antoniutti di muro) Date: Fri, 03 Dec 1999 12:58:25 +0100 Subject: [Pythonmac-SIG] Problems building Python 1.5.2 on MacOS 9 Message-ID: <3847B061.AA559B79@alias.it> List members, I'm a newbie and this is my first message posted, so Hi everybody! Foreword: I'm an absolute beginner with MacOS: forgive me, I may run into inacurancies!! Problem:Due to embedding and extending Python with C language on MacOS, i'm trying to build Python on MacOS. Using: iMac PPC Mac OS T1-9.0 Code Warrior Release 5 (CW IDE 4.0) Python1.5.2c1src from http://www.cwi.nl/ftp/jack/python/mac/Python152src.sit Following instructions in "Building Mac Python from source" html doc located in the src folder:Mac:Demo:building.html State of the art: Created a folder 'Mac Python' on my HD. Set up acces paths as indicated in building.html into my 'Mac Python' folder. Downloaded GUSI from ftp://sunsite.cnlab-switch.ch/software/platform/macos/src. Built GUSI2: CW built GUSI_MSL.PPC.Lib in 'MacPython:CWGUSI. I duplicated and renamed it into MSLGUSI.Lib.PPC since discovered that PythonCorePPC.prj looks for it. Encountered problems: I decided to build prj one by pne since the buildlibs.prj gives too much trouble (acces paths) and because the included projects (libpng.prj,libjpg.prj,...) seemed accessories to me. First CW asks to convert prjs to the new version. Ok. I started with PythonCorePPC.prj: 1) CW searches for a list of sys/xxx.h headers. Got many of them on my HD. I included in System access path those into the 'include:src' folder of GUSI distribution (more correlated), put them either above and under the Metrowerks Standard Library. Seems to work but... 2)..at Making time CW arises declaration syntax errors, that make me suppose that those sys/xxx.h are NOT the right ones !!!! Which ones am I supposed to use? 3) Building other projects before PythonCorePPC.prj, CW remonstrates that he isn't able to find PythonCore file project (even if a User Path is set pointing where PythonCore.prj is) Finally: ...at this point i give up!! Is anybody into this matter? In particoular: 1_ am i doing anything in the right way? 2_ which extra software am i supposed to use? 3_ how do i have to set up acces paths for CW? 4_ why it seems to me that names, paths and versions of the downloaded packages, are all wrong? By the way: then i have to embed and extend Python with C language. Any tip or trick for the beginner? thanks a TON etienne From jack@oratrix.nl Fri Dec 3 14:02:51 1999 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 03 Dec 1999 15:02:51 +0100 Subject: [Pythonmac-SIG] Problems building Python 1.5.2 on MacOS 9 In-Reply-To: Message by etienne antoniutti di muro , Fri, 03 Dec 1999 12:58:25 +0100 , <3847B061.AA559B79@alias.it> Message-ID: <19991203140251.CEE97370CF2@snelboot.oratrix.nl> Etienne, most (if not all) of your problems seem to come from using GUSI 2, while the current Python distribution Expects GUSI 1.something. There are big differences between GUSI 1 and 2, and people are currently looking into using GUSI 2 for Python but this isn't finished yet. -- 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 sean@digitalharmony.com Fri Dec 3 21:24:29 1999 From: sean@digitalharmony.com (Sean Hummel) Date: Fri, 3 Dec 1999 13:24:29 -0800 Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? In-Reply-To: <199912021320.OAA01806@galileo.dimi.uniud.it> Message-ID: <000401bf3dd4$c977dca0$cf00a8c0@digitalharmony.com> Having put some thought time into this for previous projects. I would do the following: 1. Get the old N-Shell source. This was a well written commercial product which became defunct, and the company released it to the public domain. It is easily expandable with plugins. And I have found it useful in many projects which required a command line interface. It already does the most common things you would expect a shell to do. 2. I'd modify the source of Nshell so that Python was embedded in it. 3. Make an os.system module for your embedded version of Python, which allows you to send those command lines to the N-Shell command interpreter. 4. Write plugins for N-Shell which simulate your commands. Of course this is more simplistic than I am sure the project would be, but it may be worth your time to look into such a solution. -----Original Message----- From: pythonmac-sig-admin@python.org [mailto:pythonmac-sig-admin@python.org] On Behalf Of Giorgio Brajnik Sent: Thursday, December 02, 1999 5:20 AM To: pythonmac-sig@python.org Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? [this is a reposting, hoping that some Mac guru could help me] Hi. I'm in the process of planning to port a Python application that is being developed on Linux to the Mac. One of the many questions I have is how to emulate in Python/Mac something like: def doit(infile, outfile, errfile, exefile): """ execute "exefile" on "infile" and write "outfile" and "errfile" """ cmd = '%s < "%s" > "%s" 2> "%s"'%(exefile, infile, outfile, errfile) os.system(cmd) return (outfile, errfile) Any suggestion? Giorgio Brajnik ______________________________________________________________________ Dip. di Matematica e Informatica | voice: +39 (432) 55.8445 Universita` di Udine | fax: +39 (432) 55.8499 Via delle Scienze, 206 | email: giorgio@dimi.uniud.it Loc. Rizzi -- 33100 Udine -- ITALY | http://www.dimi.uniud.it/~giorgio ------- End of forwarded message ------- _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://www.python.org/mailman/listinfo/pythonmac-sig From jack@oratrix.nl Fri Dec 3 23:30:26 1999 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 04 Dec 1999 00:30:26 +0100 Subject: [Pythonmac-SIG] Re: "Build Applet" not Drag and drop anymore? In-Reply-To: Message by John W Baxter , Sun, 21 Nov 1999 20:16:05 -0800 , Message-ID: <19991203233031.787F3D52C5@oratrix.oratrix.nl> Continuing on an old discussion: Recently, John W Baxter said: > MacPerl builds the icon family for its "droplets" into each droplet, with > the icons being resource ID 128. > > Python (the applet builder) copies the three icons from the interpreter > into the applet. But, the icon family ID 128 is still the interpreter, not > the applet, and the FREF ID 128 is still for the APPL. Somewhere in there > is likely the problem...it would probably be better to copy the applet icon > family into the applet as ID 128, not 129, and either omit the icon family > for the interpreter, or give it a different number. The situation is slightly different. PythonInterpreter has three BNDLs: 128 for the interpreter (signature Pyth), 129 for the default applet (signature Pyt0) and 130 for the IDE (don't remember the signature). These three are all copied to the new applet, and it is given the Pyt0 creator, APPL type. I reverse-engineered this scheme from what Applescript does with its droplets, but I've never managed to fully understand the interaction between BNDLs, owner resources, FREFs and what-have-you, and Apple isn't very clear in explaining it either, except for the common one-bundle case. And there's a good chance I fouled up the reverse-engineering of Applescript as well:-) Would it be a good idea if BuildApplet only copied the 129 BNDL? Should it renumber it to 128? And, if so, should it renumber the frefs and such too? And what are these "icon localids" anyway? I think I've shown my ignorance of this whole subject quite enough by now, so if someone could step in and tell me what BuildApplet should do: please step forward:-) -- 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 jwblist@olympus.net Sat Dec 4 05:59:22 1999 From: jwblist@olympus.net (John W Baxter) Date: Fri, 3 Dec 1999 21:59:22 -0800 Subject: [Pythonmac-SIG] Re: "Build Applet" not Drag and drop anymore? In-Reply-To: <19991203233031.787F3D52C5@oratrix.oratrix.nl> References: <19991203233031.787F3D52C5@oratrix.oratrix.nl> Message-ID: At 0:30 +0100 12/4/99, Jack Jansen wrote: >I think I've shown my ignorance of this whole subject quite enough by >now, so if someone could step in and tell me what BuildApplet should >do: please step forward:-) Well, I've said more than I know (or at least more than I remember) already. So I fear it will have to be someone else who steps in. --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From savageb@pacbell.net Sat Dec 4 07:19:24 1999 From: savageb@pacbell.net (savageb) Date: Fri, 03 Dec 1999 23:19:24 -0800 Subject: [Pythonmac-SIG] MacOS X Server installation documentation Message-ID: Just installed Python 1.5.2 on MacOS X Server. I followed the instructions at http://xclave.macnn.com/Features/QuickNDirty/ to whit: > =A0 > And now Python 1.5.2. > Easy easy easy. Download the Python source code to /usr/local/src (or /tm= p if > you don't care to store the source code). > In Terminal: >=20 > cd *directory you chose* > gnutar xpzf Python-1.5.2.tar.gz > cd Python-1.5.2 > ./configure --with-host=3Dpowerpc-apple-netbsd -silent > The with-host (*#$ is because the installer doesn't understand Rhapsody, = or > it's needs=8Aand it has needs, people. So, instead it just uses the templat= e for > a PowerPC chip and NetBSD. If you are thinking that this sounds questiona= ble, > don't. This is quick and dirty! > In Terminal: >=20 > make > make install > ln -s /usr/local/lib/Python1.5 /usr/bin/python > The final line allows you to call python from the command line. > =A0 the link on "Python source code" above was http://www.python.org/ftp/python/src/py152.tgz I noticed one change from the above, however: I have "openup" installed and that takes care of the decompressing and detarring automatically, but it moves things to a different directory. (Just thought I would note this here in case someone searches the archives looking for this info, but if anyone wants to comment on this procedure, please speak up as I am quite unfit to judge if the "quick and dirty" natur= e of the configure procedure is a problem. BTW, the version information that comes up at first says I am running on "next5_3", and os.name =3D=3D "posix".) Nota Bene: this is different from the config options mentioned in the previous post http://dinsdale.python.org/pipermail/pythonmac-sig/1999-May/002648.html which specifically mentioned compiling with threads so that Zope would run. Hope someone finds this stuff useful, Bob From giorgio@dimi.uniud.it Sat Dec 4 12:10:50 1999 From: giorgio@dimi.uniud.it (Giorgio Brajnik) Date: Sat, 4 Dec 1999 13:10:50 +0100 (MET) Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? In-Reply-To: <000401bf3dd4$c977dca0$cf00a8c0@digitalharmony.com> (sean@digitalharmony.com) References: <000401bf3dd4$c977dca0$cf00a8c0@digitalharmony.com> Message-ID: <199912041210.NAA05580@galileo.dimi.uniud.it> Sean, thank you for your thoughts. It looks like a promising direction, even though I cannot yet estimate the effort needed to make N-Shell become a python extension. Could you please give me a pointer to where the old sources of N-shell can be downloaded? Giorgio >>>>> On Fri, 3 Dec 1999 13:24:29 -0800, "Sean Hummel" said: Sean> Having put some thought time into this for previous Sean> projects. I would do the following: Sean> 1. Get the old N-Shell source. This was a well written Sean> commercial product which became defunct, and the company Sean> released it to the public domain. It is easily expandable Sean> with plugins. And I have found it useful in many projects Sean> which required a command line interface. It already does Sean> the most common things you would expect a shell to do. Sean> 2. I'd modify the source of Nshell so that Python was Sean> embedded in it. 3. Make an os.system module for your Sean> embedded version of Python, which allows you to send those Sean> command lines to the N-Shell command interpreter. 4. Write Sean> plugins for N-Shell which simulate your commands. Sean> Of course this is more simplistic than I am sure the project Sean> would be, but it may be worth your time to look into such a Sean> solution. From steve@spvi.com Mon Dec 6 03:57:22 1999 From: steve@spvi.com (Steve Spicklemire) Date: Sun, 5 Dec 1999 22:57:22 -0500 (EST) Subject: [Pythonmac-SIG] AESend and "Event Manager" events... Message-ID: <199912060357.WAA07257@acer.spvi.com> Hi Python-Mac folks.... OK.. this shows my real lack of Mac-knowledge (I'm not even sure this is really a python question.. but what the heck.. I'm using python to implement it... if it's possible to implement at all!). I need to work out some scheme for sending keystrokes to an app. I've read through "Event Manager" and the PPC stuff in Inside Mac VI... but it seems like 'high level events' and 'plain old ordinary events' are completely different. I was hoping I could use the python AE module to 'AESend' a plain old keyDown event to any old app that I could find with PPCBrowser()... but I'm missing something important! Is there some way to 'coerce' a high level event (send with AESend) to an EventRecord with an "event.what" of keyDown? thanks, -steve From dozier@abs.net Sun Dec 5 18:34:07 1999 From: dozier@abs.net (Bill Dozier) Date: Sun, 05 Dec 1999 13:34:07 -0500 Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? In-Reply-To: <199912041210.NAA05580@galileo.dimi.uniud.it> Message-ID: I don't know if this is the most recent version available, but at least the link Sherlock turned up wasn't dead. http://hyperarchive.lcs.mit.edu/cgi-bin/NewSearch?key=nshell > From: Giorgio Brajnik > Date: Sat, 4 Dec 1999 13:10:50 +0100 (MET) > To: sean@digitalharmony.com > Cc: pythonmac-sig@python.org > Subject: Re: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? > > Sean, > > thank you for your thoughts. It looks like a promising direction, even > though I cannot yet estimate the effort needed to make N-Shell become a > python extension. > Could you please give me a pointer to where the old sources of N-shell > can be downloaded? > > Giorgio >>>>>> On Fri, 3 Dec 1999 13:24:29 -0800, "Sean Hummel" >>>>>> said: > > Sean> Having put some thought time into this for previous > Sean> projects. I would do the following: > > Sean> 1. Get the old N-Shell source. This was a well written > Sean> commercial product which became defunct, and the company > Sean> released it to the public domain. It is easily expandable > Sean> with plugins. And I have found it useful in many projects > Sean> which required a command line interface. It already does > Sean> the most common things you would expect a shell to do. > Sean> 2. I'd modify the source of Nshell so that Python was > Sean> embedded in it. 3. Make an os.system module for your > Sean> embedded version of Python, which allows you to send those > Sean> command lines to the N-Shell command interpreter. 4. Write > Sean> plugins for N-Shell which simulate your commands. > > Sean> Of course this is more simplistic than I am sure the project > Sean> would be, but it may be worth your time to look into such a > Sean> solution. > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://www.python.org/mailman/listinfo/pythonmac-sig > From etienne@alias.it Mon Dec 6 12:13:15 1999 From: etienne@alias.it (etienne antoniutti di muro) Date: Mon, 06 Dec 1999 13:13:15 +0100 Subject: [Pythonmac-SIG] Problems building Python 1.5.2 on MacOS 9 References: <19991203140251.CEE97370CF2@snelboot.oratrix.nl> Message-ID: <384BA85B.8868EAF6@alias.it> Jack, thanks a lot for your previous hint: I have made a step forward !!! Got the GUSI distribution right for me (actually i'm using 1.84), i built all essential Libs. I've started building PythonCorePPC.prj: I have had some problems with type casting, but I coped and at this point I have everything properly compiled, or i hope so. By now I have linking problems, as follows: System acces path : first 'CWGUSI' libs, then 'MSL' compiler libs, at last compiler 'MacOS Support' libs. I have this kind of Warnings : "ignored XXX (code/descriptor) in MSL C.PPC.Lib; previously defined in MSLGUSI.Lib.PPC" -- and this sound not too bad. I have this kind of Linking Error : " Link Error : export symbol 'XYZXYZ' is undefined" -- most of these "exported symbols" come from Python1.5.2c1src:Mac:modules:macconfig.c file, but I CAN'T find others (_num_to_file,_malloc_pool,_pool_free,_pool_realloc,...) even with a wide multi-file search in all Python and GUSI downloaded files. Do I need any extra libs, files or packages? Do I have to set up access path in a different order (even if I just tried swapping Libs in every possible order)? Is it due to some CODE WARRIOR linking configuration that I ignore? thanks etienne Jack Jansen wrote: > > Etienne, > most (if not all) of your problems seem to come from using GUSI 2, while the > current Python distribution Expects GUSI 1.something. There are big > differences between GUSI 1 and 2, and people are currently looking into using > GUSI 2 for Python but this isn't finished yet. > -- > 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 Mon Dec 6 21:03:50 1999 From: joe@strout.net (Joseph J. Strout) Date: Mon, 6 Dec 1999 13:03:50 -0800 Subject: [Pythonmac-SIG] AESend and "Event Manager" events... In-Reply-To: <199912060357.WAA07257@acer.spvi.com> References: <199912060357.WAA07257@acer.spvi.com> Message-ID: Hi Steve, No, you can't send keystrokes with AESend. The only way to do what you want is to muck about with the Event Manager directly, but even this won't work if the app you want to send keystrokes to is not the frontmost application. A better solution (i.e., less work for you and more reliable) is to use something like KeyQuencer or QuickKeys or Akua Sweets (the latter is free) to fake the keypresses and mouseclicks you need. The first two are apps which are scriptable, Akua Sweets is an Applescript extension library which implements commands for all sorts of amazingly handy things. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From steve@spvi.com Mon Dec 6 21:21:06 1999 From: steve@spvi.com (Steve Spicklemire) Date: Mon, 6 Dec 1999 16:21:06 -0500 (EST) Subject: [Pythonmac-SIG] AESend and "Event Manager" events... In-Reply-To: (joe@strout.net) References: <199912060357.WAA07257@acer.spvi.com> Message-ID: <199912062121.QAA11469@acer.spvi.com> Thanks Joe! I'm not sure that's the answer I was *hoping* for.. but it's an answer I can probably live with. -steve >>>>> "Joe" == Joseph J Strout writes: Joe> Hi Steve, Joe> No, you can't send keystrokes with AESend. The only Joe> way to do what you want is to muck about with the Event Joe> Manager directly, but even this won't work if the app you Joe> want to send keystrokes to is not the frontmost application. Joe> A better solution (i.e., less work for you and more Joe> reliable) is to use something like KeyQuencer or QuickKeys or Joe> Akua Sweets (the latter is free) to fake the keypresses and Joe> mouseclicks you need. The first two are apps which are Joe> scriptable, Akua Sweets is an Applescript extension library Joe> which implements commands for all sorts of amazingly handy Joe> things. Joe> Cheers, -- Joe From sean@digitalharmony.com Tue Dec 7 05:57:19 1999 From: sean@digitalharmony.com (Sean Hummel) Date: Mon, 6 Dec 1999 21:57:19 -0800 Subject: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? In-Reply-To: <199912041210.NAA05580@galileo.dimi.uniud.it> Message-ID: <000001bf4077$ed457020$cf00a8c0@digitalharmony.com> I used to find them on AOL, but I'm sure that they can be found on the Info-mac sites. -----Original Message----- From: Giorgio Brajnik [mailto:giorgio@dimi.uniud.it] Sent: Saturday, December 04, 1999 4:11 AM To: sean@digitalharmony.com Cc: pythonmac-sig@python.org Subject: Re: [Pythonmac-SIG] reposting: Q: emulating os.system() on macs? Sean, thank you for your thoughts. It looks like a promising direction, even though I cannot yet estimate the effort needed to make N-Shell become a python extension. Could you please give me a pointer to where the old sources of N-shell can be downloaded? Giorgio >>>>> On Fri, 3 Dec 1999 13:24:29 -0800, "Sean Hummel" said: Sean> Having put some thought time into this for previous Sean> projects. I would do the following: Sean> 1. Get the old N-Shell source. This was a well written Sean> commercial product which became defunct, and the company Sean> released it to the public domain. It is easily expandable Sean> with plugins. And I have found it useful in many projects Sean> which required a command line interface. It already does Sean> the most common things you would expect a shell to do. Sean> 2. I'd modify the source of Nshell so that Python was Sean> embedded in it. 3. Make an os.system module for your Sean> embedded version of Python, which allows you to send those Sean> command lines to the N-Shell command interpreter. 4. Write Sean> plugins for N-Shell which simulate your commands. Sean> Of course this is more simplistic than I am sure the project Sean> would be, but it may be worth your time to look into such a Sean> solution. From etienne@alias.it Tue Dec 7 15:24:29 1999 From: etienne@alias.it (etienne antoniutti di muro) Date: Tue, 07 Dec 1999 16:24:29 +0100 Subject: [Pythonmac-SIG] embedding python into C Message-ID: <384D26AD.6C91B9A4@alias.it> List members, what kind of error is: "no mem to add parser accelerators" occured after a PyRun_SimpleString(...) ? How to cope? thanks etienne From jack@oratrix.nl Tue Dec 7 20:45:12 1999 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 07 Dec 1999 21:45:12 +0100 Subject: [Pythonmac-SIG] Appearance Message-ID: <19991207204517.AA5BDD52C5@oratrix.oratrix.nl> Folks, I'm about to convert various (and, eventually, all) dialogs and such in MacPython to Appearance Manager. Moreover, I'm about to do so pretty soon, at least for some stuff like EasyDialogs, as I need appearance support quickly for GRiNS. The thing I'm still not 100% certain about is backward compatability. I see the following possible solutions which I'd like feedback on, but any other ideas are of course welcome too. 1. Forget about backwards compatability. This is definitely the easiest solution:-) I'm afraid it might be unacceptable, though, because there are people with machines that can't run Appearance. If so: please speak up. 2. Have a special non-appearance directory in sys.path, probably something like Mac:Lib:lib-noappearance. This directory would contain versions of EasyDialogs, Framework and others plus their resource files. This directory should be prepended to sys.path either by the installer or by the user (probably after a warning message by the appearance-EasyDialogs or so). The non-appearance modules would probably eventually start lagging behind in functionality. An alternative of this might be the reverse: have the appearance versions in lib-appearance and the compatible ones in the standard sys.path. 3. Have modules dynamically decide whether to provide appearance support or not. This is the most elegant solution from a user point of view, but quite a bit more work than I really care for, unless it turns out a large proportion of the MacPython users still have pre-appearance machines. Another issue is that of the dialogs in the interpreter itself and the surrounding applets like EditPythonPrefs (and IDE, which I'll leave to Just), but I think these can be handled in similar ways. -- 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 Dec 7 21:14:19 1999 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 07 Dec 1999 22:14:19 +0100 Subject: [Pythonmac-SIG] embedding python into C In-Reply-To: Message by etienne antoniutti di muro , Tue, 07 Dec 1999 16:24:29 +0100 , <384D26AD.6C91B9A4@alias.it> Message-ID: <19991207211424.C596BD52C5@oratrix.oratrix.nl> Recently, etienne antoniutti di muro said: > List members, > what kind of error is: > > "no mem to add parser accelerators" > > occured after a PyRun_SimpleString(...) ? Your application has run out of memory. Python allocates everything out of the application heap, my guess is that the engine will gobble up at least 500k for bookkeeping, and add to that any memory your script uses. If you give your application about 4Mb extra (aside from what the application itself needs) that should be fine for scripts that don't create huge datastructures. -- 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 billpy@mousa.demon.co.uk Wed Dec 8 00:05:18 1999 From: billpy@mousa.demon.co.uk (Bill Bedford) Date: Wed, 8 Dec 1999 00:05:18 +0000 Subject: [Pythonmac-SIG] Appearance In-Reply-To: <19991207204517.AA5BDD52C5@oratrix.oratrix.nl> References: <19991207204517.AA5BDD52C5@oratrix.oratrix.nl> Message-ID: At 9:45 pm +0100 07/12/99, Jack Jansen wrote: >Folks, >I'm about to convert various (and, eventually, all) dialogs and such >in MacPython to Appearance Manager. Moreover, I'm about to do so >pretty soon, at least for some stuff like EasyDialogs, as I need >appearance support quickly for GRiNS. > >The thing I'm still not 100% certain about is backward >compatability. I see the following possible solutions which I'd like >feedback on, but any other ideas are of course welcome too. > >1. Forget about backwards compatability. This is definitely the > easiest solution:-) I'm afraid it might be unacceptable, though, > because there are people with machines that can't run > Appearance. If so: please speak up. Acording to the Appearence SDK it works with all systems later than 7.1, Since Python doesn't work with System 6 the number of people who your changes will affect is likely to be quite small. -- Bill Bedford mailto://billb@mousa.demon.co.uk People have believed for hundreds of years that newts in a well mean that the water's fresh and drinkable, and *in all that time* never asked themselves whether the newts got out to go to the lavatory. From joe@strout.net Wed Dec 8 00:26:11 1999 From: joe@strout.net (Joseph J. Strout) Date: Tue, 7 Dec 1999 16:26:11 -0800 Subject: [Pythonmac-SIG] Appearance In-Reply-To: References: <19991207204517.AA5BDD52C5@oratrix.oratrix.nl> Message-ID: At 12:05 AM +0000 12/8/99, Bill Bedford wrote: >Acording to the Appearence SDK it works with all systems later than >7.1, Since Python doesn't work with System 6 the number of people >who your changes will affect is likely to be quite small. Not entirely true -- you can install the SDK on older systems, but not everybody does so for various reasons (memory limitations, etc.). All the same, I'm inclined to agree that it's probably not a big deal. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From noboru.yamamoto@kek.jp Thu Dec 9 01:14:53 1999 From: noboru.yamamoto@kek.jp (Noboru Yamamoto) Date: Thu, 09 Dec 1999 10:14:53 +0900 Subject: [Pythonmac-SIG] CGI on Mac/WebStar using Python Message-ID: <384F00DA.FF92DA05@kek.jp> Hi, Two days ago, I decided to write a CGI program for WebStar(a commercial WWW server for Macintosh). I found a sample CGI program for Mac/WebStar in Mac/demo/cgi folder of Mac/Python distribution. I took it, realcgitest.py, and converted it to an Python applet using BuildApplet. Then I put it in the folder where the WebStar can access. It works OK and I extend the cgi program little by little and tested it. In this process, I noticed one glitch. First attempt to the cgi program always fails if the cgi program is not running. If you start the cgi by hand or second attempt to the cgi from WWW browser works just fine. After a long test and consideration, I concluded that an event loop to support python console window takes a first Apple event and it does not pass it to a callback function for the WebStar/CGI event('WWW\275', 'sdoc') because the callback is NOT installed yet at this point. This morning, I turned ON three startup options for Python on the mac running WebStar. Three options I turned on are: 1) Disable Interactive option setting 2) Disable argc/argv emulation 3) Delay console window until needed. With this setting, the phenomena I mentioned disappear. All CGI request from WWW browser are handled properly even if the CGI program is not running. So you can use set self.quitting = 1 at the end of CGI callback to terminate execution of the CGI program. I didn't check if it is really necessary to turn on all three options. It may be enough to turn on the third option("Delay console window until needed") . Regards, Noboru Yamamoto Accelerator Lab. KEK, High Energy Accelerator Research Organization Tsukuba, Ibaraki JAPAN From jwblist@olympus.net Thu Dec 9 06:30:59 1999 From: jwblist@olympus.net (John W Baxter) Date: Wed, 8 Dec 1999 22:30:59 -0800 Subject: [Pythonmac-SIG] Appearance In-Reply-To: <19991207204517.AA5BDD52C5@oratrix.oratrix.nl> References: <19991207204517.AA5BDD52C5@oratrix.oratrix.nl> Message-ID: At 21:45 +0100 12/7/99, Jack Jansen wrote: >The thing I'm still not 100% certain about is backward >compatability. I see the following possible solutions which I'd like >feedback on, but any other ideas are of course welcome too. > >1. Forget about backwards compatability. This is definitely the > easiest solution:-) I'm afraid it might be unacceptable, though, > because there are people with machines that can't run > Appearance. If so: please speak up. >2. Have a special non-appearance directory in sys.path, probably > something like Mac:Lib:lib-noappearance. This directory would > contain versions of EasyDialogs, Framework and others plus their > resource files. This directory should be prepended to sys.path > either by the installer or by the user (probably after a warning > message by the appearance-EasyDialogs or so). The non-appearance > modules would probably eventually start lagging behind in > functionality. An alternative of this might be the reverse: have > the appearance versions in lib-appearance and the compatible ones > in the standard sys.path. I would be content with either #1 or the variant of #2 in which the appearance module collection is the default, and special action is needed (one-time) for the backwards compatibility. I don't have any machines which I run at all which can't run Appearance (somewhat slowly in the case of my 8100/80). Priority for things like the EditPythonPrefs applet change would be rather low for me (I can't remember the last time I ran it except when Installing a Python version, and I don't need the new look to do that). I don't thing #3's effort would be worth it: it might seem so today, but there will be fewer non-Appearance machines as time goes on. --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jack@oratrix.nl Thu Dec 9 16:49:51 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 09 Dec 1999 17:49:51 +0100 Subject: [Pythonmac-SIG] CGI on Mac/WebStar using Python In-Reply-To: Message by Noboru Yamamoto , Thu, 09 Dec 1999 10:14:53 +0900 , <384F00DA.FF92DA05@kek.jp> Message-ID: <19991209164951.C1534370CF2@snelboot.oratrix.nl> > This morning, I turned ON three startup options for Python on the mac > running WebStar. > Three options I turned on are: > 1) Disable Interactive option setting > 2) Disable argc/argv emulation > 3) Delay console window until needed. > With this setting, the phenomena I mentioned disappear. All CGI request > from WWW browser are handled > properly even if the CGI program is not running. So you can use set > self.quitting = 1 at the end of CGI callback > to terminate execution of the CGI program. I _think_ it is documented that you should turn these one, but I will check again. It is definitely necessary to do (2), I'm not sure about (1) and (3). -- 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 jeffrey@Digicool.com Thu Dec 9 18:18:19 1999 From: jeffrey@Digicool.com (Jeffrey P Shell) Date: Thu, 09 Dec 1999 13:18:19 -0500 Subject: [Pythonmac-SIG] MacOS X Server installation documentation In-Reply-To: Message-ID: on 12/4/99 2:19 AM, savageb at savageb@pacbell.net wrote: > Just installed Python 1.5.2 on MacOS X Server. I followed the instructions > at http://xclave.macnn.com/Features/QuickNDirty/ to whit: Does this configure/install it with threads and shared libs? Threads is easy to configure, getting shared libraries has been a bitch (the --with-dyld didn't work on its own, and --with-next-framework gave me a lot of difficulties. Shared libs and threads are needed for Zope). Does any one know of any initiative to get such a Python into the Darwin base? That way, Python will show up in both MacOS X and MacOS X Server (rumors are that the next Server release will be Darwin based). -- Jeffrey P Shell, jeffrey@Digicool.com http://www.zope.org/ From managan@llnl.gov Fri Dec 10 00:58:00 1999 From: managan@llnl.gov (Rob Managan) Date: Thu, 9 Dec 1999 16:58:00 -0800 Subject: [Pythonmac-SIG] SWIG and making extension modules Message-ID: I have successfully used SWIG to wrap the Processor Manager functions. At this time I have really only tested the GetProcessInformation and the MacGetCurrentProcess functions. I set this up to see how hard it would be to use SWIG for this purpose. Mainly I wanted to be able to get the process name, Signature, and active time. It turns out that it is not as easy to use as I would like. However, it does give you a lot of flexibility. The main problems revolve around trying to use the special objects that Jack provides for things like FSspec pointers and OSTypes... I want to clean it up a little and add some documentation and then hope to make it available. If you want to see it in its rough form let me know. *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan LLNL ph: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From jack@oratrix.nl Fri Dec 10 13:17:37 1999 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 10 Dec 1999 14:17:37 +0100 Subject: [Pythonmac-SIG] MacOS X Server installation documentation In-Reply-To: Message by Jeffrey P Shell , Thu, 09 Dec 1999 13:18:19 -0500 , Message-ID: <19991210131738.592C5370CF2@snelboot.oratrix.nl> > Does any one know of any initiative to get such a Python into the Darwin > base? That way, Python will show up in both MacOS X and MacOS X Server > (rumors are that the next Server release will be Darwin based). I don't have time to look into this, but I definitely hope someone else does. -- 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 Fri Dec 10 13:28:57 1999 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 10 Dec 1999 14:28:57 +0100 Subject: [Pythonmac-SIG] SWIG and making extension modules In-Reply-To: Message by Rob Managan , Thu, 9 Dec 1999 16:58:00 -0800 , Message-ID: <19991210132858.3B2BC370CF2@snelboot.oratrix.nl> > I have successfully used SWIG to wrap the Processor Manager > functions. At this time I have really only tested the > GetProcessInformation and the MacGetCurrentProcess functions. I set > this up to see how hard it would be to use SWIG for this purpose. > Mainly I wanted to be able to get the process name, Signature, and > active time. > > It turns out that it is not as easy to use as I would like. However, > it does give you a lot of flexibility. The main problems revolve > around trying to use the special objects that Jack provides for > things like FSspec pointers and OSTypes... I want to clean it up a > little and add some documentation and then hope to make it available. This is one of the reasons I've always stayed away from SWIG. SWIG is nice, but it has two drawbacks that are (to me, at least) showstoppers: - Any arguments other than the standard int/string/float/etc are difficult. Bgen has no trouble with this: as long as you can explain it the C code needed to wrap/unwrap argument types it'll do it for you. - SWIG exports a C-library more-or-less as-is, which means you often have to wrap it into an OO module in Python. Again, bgen is superior here: you can explain it if the first (or last, or whatever) argument is of type X the C function should be exported to Python as a method of the X type. -- 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 managan@llnl.gov Fri Dec 10 18:16:49 1999 From: managan@llnl.gov (Rob Managan) Date: Fri, 10 Dec 1999 10:16:49 -0800 Subject: [Pythonmac-SIG] SWIG and making extension modules In-Reply-To: <19991210132858.3B2BC370CF2@snelboot.oratrix.nl> References: <19991210132858.3B2BC370CF2@snelboot.oratrix.nl> Message-ID: > >This is one of the reasons I've always stayed away from SWIG. SWIG is nice, >but it has two drawbacks that are (to me, at least) showstoppers: >- Any arguments other than the standard int/string/float/etc are difficult. >Bgen has no trouble with this: as long as you can explain it the C code needed >to wrap/unwrap argument types it'll do it for you. >- SWIG exports a C-library more-or-less as-is, which means you often have to >wrap it into an OO module in Python. Again, bgen is superior here: you can >explain it if the first (or last, or whatever) argument is of type X the C >function should be exported to Python as a method of the X type. > >-- I guess then that I should continue to encourage you to find time to put out an example of how to use bgen. The files in the tools folder are a little opaque to me. I suppose that the procedure you have used on a module already in MacPython would help a lot in this regard. *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan LLNL ph: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From fkawasak@po.twin.ne.jp Fri Dec 10 01:22:09 1999 From: fkawasak@po.twin.ne.jp (KAWASAKI) Date: Fri, 10 Dec 1999 10:22:09 +0900 Subject: [Pythonmac-SIG] newbie's Q Message-ID: hello,all I am a newbie to mac python. when I double click a module in whatever folder the interpreter says to me it can't find the module. for example. Double click $PYTHON:Lib:binhex.py --->PythonInterpreter:: can't open file 'binhex.py:' I can import the binhex.py from the interpreter command line. I suspect it is not a problem of path settings.( indeed $PYTHON:Lib: is in the path) PLUS, I can't open any file in IDE! it complains "can't find *****" I thought I had no trouble when I was using ver 1.4 Please tell me what's wrong. Thank you in advance. _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://www.python.org/mailman/listinfo/pythonmac-sig From llatz@s.netic.de Sat Dec 11 22:43:45 1999 From: llatz@s.netic.de (tomtom) Date: Sat, 11 Dec 1999 23:43:45 +0100 Subject: [Pythonmac-SIG] setting up python Message-ID: <3852D39F.97CF641A@s.netic.de> hope these newbieish questions arent inappropriate for the list: i have installed python 1.52c1 (had the beta before that) some days ago. i had done some scripting involving the string and os modules and those work. however, today i tried doubleclicking some demos and the tkinter demos didnt work: they cant find the Tkinter module for some reason. it lives in the tk-lib in the lib and the lib *is* in the pythonpath (i checked it). do i have to separately put the path to lib:tk-lib there? i wanna be careful with those paths (pathes? path'th?) cause i dont want to foul anything up.. thought i'd rather ask. another question (maybe thats really a piddle question, dunno..): i installed piddle and put it in the pythonpath. some of the testing stuff gives me: cant find module 'w'. i dont know what that module is and if it belongs to piddle or not.. some of the piddle testing stuff that writes pdf does work and writes it to python.out until the window kindof overflows and starts flashing in a wild way. i guess i should redirect the output.. is there something mac-pythonish about doing that or should i read about it in the general docs? thanks for being patient.. Ni! lukas From dante@oz.net Sun Dec 12 00:57:58 1999 From: dante@oz.net (Dante) Date: Sat, 11 Dec 1999 16:57:58 -0800 Subject: [Pythonmac-SIG] just one apple event Message-ID: I've been working with aetools and gensuitemodule.py trying to get Python to work smoothly with a scriptable app. It hasn't been going very well. What I truly desire is to be able to write a function to send an application ONE appleevent. I have gleaned the information I need from MacOS with CaptureAE and a one line applescript. So where in this mess of tools do I go to be able to do this? Dante _________________________________________________________ Dante - dante@oz.net - #FightThePower on Openprojects From billpy@mousa.demon.co.uk Sun Dec 12 11:41:51 1999 From: billpy@mousa.demon.co.uk (Bill Bedford) Date: Sun, 12 Dec 1999 11:41:51 +0000 Subject: [Pythonmac-SIG] just one apple event In-Reply-To: References: Message-ID: At 4:57 pm -0800 11/12/99, Dante wrote: >I've been working with aetools and gensuitemodule.py trying to get >Python to work smoothly with a scriptable app. It hasn't been going >very well. What I truly desire is to be able to write a function to >send an application ONE appleevent. I have gleaned the information I >need from MacOS with CaptureAE and a one line applescript. > >So where in this mess of tools do I go to be able to do this? Each method, in the modules generated by gensuitemodule.py, represents your single apple event. They even have the same name. -- Bill Bedford mailto://billb@mousa.demon.co.uk The man gave a shrug which indicated that, although the world did indeed have many problems, this was one of them that was not his. From dante@oz.net Sun Dec 12 20:19:44 1999 From: dante@oz.net (Dante) Date: Sun, 12 Dec 1999 12:19:44 -0800 Subject: [Pythonmac-SIG] just one apple event In-Reply-To: References: Message-ID: At 11:41 AM +0000 12/12/99, Bill Bedford wrote: >At 4:57 pm -0800 11/12/99, Dante wrote: > >>I've been working with aetools and gensuitemodule.py trying to get >>Python to work smoothly with a scriptable app. It hasn't been going >>very well. What I truly desire is to be able to write a function to >>send an application ONE appleevent. I have gleaned the information >>I need from MacOS with CaptureAE and a one line applescript. >> >>So where in this mess of tools do I go to be able to do this? > >Each method, in the modules generated by gensuitemodule.py, >represents your single apple event. They even have the same name. I don't think I stated my problem clearly. Once I build modules with gensuitemodule.py I am able to make the call as I (more or less) normally would. But I am left with several k of python code that I don't necessarily need or want. Somewhere in the files created by gensuitemodule.py Python sends the appleevent "misc, dosc, "----":"workspace.foo", &tran:63464" to "LAND". That event is identical to the one sent by the applescript one liner I can write to do this job except for the &tran which is replaced with &subj:'null'() For instance, in UserTalk (which bears a striking resemblance to Python) there is the following call: appleevent("LAND", "misc", "dosc", "----", "workspace.foo") which is pretty self explanatory. What I want is the python version of this one liner and I can't seem to figure out where I go for this. Dante _________________________________________________________ Dante - dante@oz.net - #FightThePower on Openprojects From jack@oratrix.nl Sun Dec 12 21:32:32 1999 From: jack@oratrix.nl (Jack Jansen) Date: Sun, 12 Dec 1999 22:32:32 +0100 Subject: [Pythonmac-SIG] What to do about missing toolbox routines Message-ID: <19991212213237.A0798D52C5@oratrix.oratrix.nl> Folks, now that I'm regenerating lots of the toolbox modules to support the new MacOS 8.6 calls I'm again running into the question of how to handle toolbox calls that don't exist on the current machine. The current "solution" is that the various libraries like DragLib, QuickTime, etc. are imported weak, which means that if the library doesn't exist at runtime (or if the library exists but not all calls exist) Python will silently continue. However, attmpting to use a non-existent method from Python will result in a call to address zero, and hence a crash. This is suboptimal:-) I can think of two decent solutions, and I'd like feedback on the preferred one (but note that the actual implementation will also depend on the amount of time I have, so even though everyone agrees on an optimal one that doesn't imply it'll actualy be implemented:-): 1. Upon first call of a toolbox method check whether it actually exists and raise an exception if it doesn't. 2. Upon import of a plugin module test all toolbox routines for existence (by comparing the routine address to 0) and for those that don't exist don't export the Python method either. This is a lot more work. But, of course, an answer of "ah well, leave it as it is, it hasn't bitten me yet" is also welcome, -- 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 jwblist@olympus.net Mon Dec 13 02:58:29 1999 From: jwblist@olympus.net (John W Baxter) Date: Sun, 12 Dec 1999 18:58:29 -0800 Subject: [Pythonmac-SIG] What to do about missing toolbox routines In-Reply-To: <19991212213237.A0798D52C5@oratrix.oratrix.nl> References: <19991212213237.A0798D52C5@oratrix.oratrix.nl> Message-ID: At 22:32 +0100 12/12/99, Jack Jansen wrote: >I can think of two decent solutions, and I'd like feedback on the >preferred one (but note that the actual implementation will also depend on >the amount of time I have, so even though everyone agrees on an >optimal one that doesn't imply it'll actualy be implemented:-): > >1. Upon first call of a toolbox method check whether it actually > exists and raise an exception if it doesn't. >2. Upon import of a plugin module test all toolbox routines for > existence (by comparing the routine address to 0) and for those that > don't exist don't export the Python method either. This is a lot > more work. Alternative 3: export boolean hasToolboxFoo for every Foo which is weak linked (or every such call for which there isn't a Gestalt call which will detect presence/absence). That's a rather verbose name...since we're looking at modules it could be perhaps reduced to hasFoo without name collision problems. 1. is probably cleanest (and avoids assumptions like "if it has X it must have Y and Z," which while true up through some System might become untrue, and avoids lazy programmers ). --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jack@oratrix.nl Mon Dec 13 11:35:20 1999 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 13 Dec 1999 12:35:20 +0100 Subject: [Pythonmac-SIG] What to do about missing toolbox routines In-Reply-To: Message by John W Baxter , Sun, 12 Dec 1999 18:58:29 -0800 , Message-ID: <19991213113520.DC728370CF2@snelboot.oratrix.nl> > Alternative 3: export boolean hasToolboxFoo for every Foo which is weak > linked (or every such call for which there isn't a Gestalt call which will > detect presence/absence). That's a rather verbose name...since we're > looking at modules it could be perhaps reduced to hasFoo without name > collision problems. Hmm, that's an interesting angle! I'll think about this a bit more, it may be that a different interface (for instance a is_implemented("ToolBoxCallName") method) might be easier to implement (and cause less namespace clutter), though. -- 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 Dec 13 11:42:42 1999 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 13 Dec 1999 12:42:42 +0100 Subject: [Pythonmac-SIG] just one apple event In-Reply-To: Message by Dante , Sun, 12 Dec 1999 12:19:44 -0800 , Message-ID: <19991213114242.A86F5370CF2@snelboot.oratrix.nl> > I don't think I stated my problem clearly. Once I build modules with > gensuitemodule.py I am able to make the call as I (more or less) > normally would. But I am left with several k of python code that I > don't necessarily need or want. Somewhere in the files created by > gensuitemodule.py Python sends the appleevent "misc, dosc, > "----":"workspace.foo", &tran:63464" to "LAND". That event is > identical to the one sent by the applescript one liner I can write to > do this job except for the &tran which is replaced with &subj:'null'() > > For instance, in UserTalk (which bears a striking resemblance to > Python) there is the following call: appleevent("LAND", "misc", > "dosc", "----", "workspace.foo") which is pretty self explanatory. The gensuitemodule stuff is all meant to isolate you from these low-level details. If you want to do the lowlevel stuff yourself (but be aware that you're also responsible for argument conversion and such) you can do it like this: dummy, rv, dummy2 = aetools.Talker("LAND").send("misc", "dosc", {"----":"workspace.foo"}) rv will again be a dictionary mapping 4-char keys to return values. You may want to add the optional start=1 argument (to fire up the app if needed) to the Talker call. -- 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 Dec 13 11:51:56 1999 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 13 Dec 1999 12:51:56 +0100 Subject: [Pythonmac-SIG] newbie's Q In-Reply-To: Message by KAWASAKI , Fri, 10 Dec 1999 10:22:09 +0900 , Message-ID: <19991213115156.4390E370CF2@snelboot.oratrix.nl> > hello,all > I am a newbie to mac python. > when I double click a module in whatever folder > the interpreter says to me it can't find the module. > for example. > Double click $PYTHON:Lib:binhex.py > > --->PythonInterpreter:: can't open file 'binhex.py:' This is very strange. Try rebuilding your desktop to see whether that makes a difference. Also, could you give us the exact error message if it still fails after the desktop rebuild? And could you try dragging-and-dropping the .py file to the interpreter, to see whether that gives the same error message as double-clicking? -- 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 billpy@mousa.demon.co.uk Mon Dec 13 11:00:03 1999 From: billpy@mousa.demon.co.uk (Bill Bedford) Date: Mon, 13 Dec 1999 11:00:03 +0000 Subject: [Pythonmac-SIG] just one apple event In-Reply-To: References: Message-ID: At 12:19 pm -0800 12/12/99, Dante wrote: > >I don't think I stated my problem clearly. Once I build modules with >gensuitemodule.py I am able to make the call as I (more or less) >normally would. But I am left with several k of python code that I >don't necessarily need or want. Somewhere in the files created by >gensuitemodule.py Python sends the appleevent "misc, dosc, >"----":"workspace.foo", &tran:63464" to "LAND". That event is >identical to the one sent by the applescript one liner I can write >to do this job except for the &tran which is replaced with >&subj:'null'() > >For instance, in UserTalk (which bears a striking resemblance to >Python) there is the following call: appleevent("LAND", "misc", >"dosc", "----", "workspace.foo") which is pretty self explanatory. > >What I want is the python version of this one liner and I can't seem >to figure out where I go for this. You build a wrapper module that does just this for you. See Python->Mac->Lib->findertools.py for an example of this for the finder. This gives a syntax which is similar to Applescript, i.e. in applescript you have Tell application "finder" to sleep in Python its findertools.sleep() A word of caution. Python only allocates/can use one transaction number per session. So if your script calls do_script more than once it will fail. So far I have only found this to be a problem scripting Hypercard, where there are lots of alternatives, but YMMV -- Bill Bedford mailto://billb@mousa.demon.co.uk "So we're surrounded by absolutely nothing. There's a word for it. It's what you get when there's nothing left and everything's been used up." - "Yes. I think it's called the bill." From savageb@pacbell.net Mon Dec 13 17:49:28 1999 From: savageb@pacbell.net (Bob Savage) Date: Mon, 13 Dec 1999 09:49:28 -0800 Subject: [Pythonmac-SIG] setting up python In-Reply-To: <3852D39F.97CF641A@s.netic.de> Message-ID: > hope these newbieish questions arent inappropriate for the list: Not at all. > i have installed python 1.52c1 (had the beta before that) some days ago. i had > done some scripting involving the string and os modules and those work. > however, today i tried doubleclicking some demos and the tkinter demos didnt > work: they cant find the Tkinter module for some reason. it lives in the > tk-lib in the lib and the lib *is* in the pythonpath (i checked it). do i have > to separately put the path to lib:tk-lib there? i wanna be careful with those > paths (pathes? path'th?) cause i dont want to foul anything up.. thought i'd > rather ask. I think someone mentioned that one of the TK files got placed in another folder (PIL?) by accident. So you could either move the file to the TKinter Directory, or include the other directory in your path. > another question (maybe thats really a piddle question, dunno..): > i installed piddle and put it in the pythonpath. some of the testing stuff > gives me: cant find module 'w'. i dont know what that module is and if it > belongs to piddle or not.. This is because 'w' is tied up with the IDE in som way. You will need to call piddle-QuickDraw stuff from within the IDE to get it to work. > some of the piddle testing stuff that writes pdf does work and writes it to > python.out until the window kindof overflows and starts flashing in a wild > way. i guess i should redirect the output.. is there something mac-pythonish > about doing that or should i read about it in the general docs? Sorry, I don't know anything about this. Maybe you should take it to the piddle list. Bob From savageb@pacbell.net Mon Dec 13 17:55:10 1999 From: savageb@pacbell.net (Bob Savage) Date: Mon, 13 Dec 1999 09:55:10 -0800 Subject: [Pythonmac-SIG] What to do about missing toolbox routines In-Reply-To: <19991212213237.A0798D52C5@oratrix.oratrix.nl> Message-ID: > 1. Upon first call of a toolbox method check whether it actually > exists and raise an exception if it doesn't. I would prefer this to crashing. Of course I "haven't been bitten", but I think this is more in line with the way Python typically works (that is no matter how stupid a thing it is I do, I get a traceback). Bob From savageb@pacbell.net Mon Dec 13 18:13:15 1999 From: savageb@pacbell.net (Bob Savage) Date: Mon, 13 Dec 1999 10:13:15 -0800 Subject: [Pythonmac-SIG] MacOS X Server installation documentation In-Reply-To: <19991210131738.592C5370CF2@snelboot.oratrix.nl> Message-ID: Well, I confirmed that the installation method I used does *not* have a thread module (attempts to import "thread" and "threading" both fail with "No module named thread" errors). Unfortunately attempting to get threading support to compile is beyond my capabilities. There is a new release of MOSXS expected within the month (Macworld SF?), but according to today's Stepwise newsletter, it is unlikely to include support for Carbon or an updated Darwin, underpinning, so I don't think the situation wrt Python will be changing soon. Bob From jwblist@olympus.net Tue Dec 14 07:52:20 1999 From: jwblist@olympus.net (John W Baxter) Date: Mon, 13 Dec 1999 23:52:20 -0800 Subject: [Pythonmac-SIG] What to do about missing toolbox routines In-Reply-To: <19991213113520.DC728370CF2@snelboot.oratrix.nl> References: <19991213113520.DC728370CF2@snelboot.oratrix.nl> Message-ID: At 12:35 +0100 12/13/99, Jack Jansen wrote: >> Alternative 3: export boolean hasToolboxFoo for every Foo which is weak >> linked (or every such call for which there isn't a Gestalt call which will >> detect presence/absence). That's a rather verbose name...since we're >> looking at modules it could be perhaps reduced to hasFoo without name >> collision problems. > >Hmm, that's an interesting angle! I'll think about this a bit more, it may be >that a different interface (for instance a is_implemented("ToolBoxCallName") >method) might be easier to implement (and cause less namespace clutter), >though. The is_implemented("ToolBoxCallName") looks better than "my" individual booleans. Whether it's better than alternative 1 is another question (which pretty much goes to whether one prefers exceptions after the fact to testing before...this one prefers exceptions, partly because pre-flighting can be accomplished using them). --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jack@oratrix.nl Tue Dec 14 10:06:41 1999 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 14 Dec 1999 11:06:41 +0100 Subject: [Pythonmac-SIG] just one apple event In-Reply-To: Message by Bill Bedford , Mon, 13 Dec 1999 11:00:03 +0000 , Message-ID: <19991214100642.7D9EA370CF2@snelboot.oratrix.nl> > A word of caution. Python only allocates/can use one transaction > number per session. So if your script calls do_script more than once > it will fail. So far I have only found this to be a problem scripting > Hypercard, where there are lots of alternatives, but YMMV Bill, this message has a serious sound to it, but that may be because I don't understand it:-) Should Python allocate more transaction numbers? Can you give an Inside Mac (or other) reference for how this should be done? -- 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 Dec 15 10:34:55 1999 From: etienne@alias.it (etienne antoniutti di muro) Date: Wed, 15 Dec 1999 11:34:55 +0100 Subject: [Pythonmac-SIG] Python IDE Message-ID: <38576ECF.AA87C61@alias.it> List members, i'd like to use full IDE functionality with the Python 1.5.2 ditribution BUILT from source. I've tried to merge IDE script of the binary distribution with the Python Interpreter i built on my own, but with no success.... any suggestion? where do i find the IDE sources? or how do i fulfil that merging? thanks etienne From billpy@mousa.demon.co.uk Wed Dec 15 13:56:38 1999 From: billpy@mousa.demon.co.uk (Bill Bedford) Date: Wed, 15 Dec 1999 13:56:38 +0000 Subject: [Pythonmac-SIG] just one apple event In-Reply-To: <19991214100642.7D9EA370CF2@snelboot.oratrix.nl> References: <19991214100642.7D9EA370CF2@snelboot.oratrix.nl> Message-ID: At 11:06 am +0100 14/12/99, Jack Jansen wrote: >> A word of caution. Python only allocates/can use one transaction >> number per session. So if your script calls do_script more than once >> it will fail. So far I have only found this to be a problem scripting >> Hypercard, where there are lots of alternatives, but YMMV > > >Bill, >this message has a serious sound to it, but that may be because I don't >understand it:-) I know the feeling :-) > >Should Python allocate more transaction numbers? Can you give an Inside Mac >(or other) reference for how this should be done? I've had a look through Inside Mac: Interactive Communications and there are a number of passages like this. (page 3-29) > You can specify two other attributes with the AECreateAppleEvent >function: the > reply ID and the transaction ID. For the reply ID attribute, you >usually specify the >' kAutoGenerateReturnID' constant to the AECreateAppleEvent function. This > constant ensures that the Apple Event Manager generates a unique >return ID for the > reply Apple event returned from the server. For the transaction ID >attribute, you usually > specify the 'kAnyTransactionID' constant, which indicates that this >Apple event is not > one of a series of interdependent Apple events. And this is what Python does class TalkTo() has def newevent(self, code, subcode, parameters = {}, attributes = {}): """Create a complete structure for an apple event""" event = AE.AECreateAppleEvent(code, subcode, self.target, AppleEvents.kAutoGenerateReturnID, AppleEvents.kAnyTransactionID) packevent(event, parameters, attributes) return event which looks OK. The problem is the actual appleevent. Capturing the same event from Applescript and Python with CaptureAE you get with applescript: Process("HyperCard").SendAE "WILD,GO ,'----':obj {form:name, want:type(cSTK), seld:"Suppliers Invoices", from:'null'()}, &subj:'null'()" And with Python Process("HyperCard").SendAE "WILD,GO ,'----':obj {form:name, want:type(cSTK), from:'null'(), seld:"Suppliers Invoices"}, &tran:18904" Python should be passing a null pointer but isn't. My guess that there is a problem with the type of transactionID in the C code -- it should be a long int Is this serious? I don't really think so -- most applications ignore the transactionID. It is just a few like Hypercard that seem to check it and throw errors when they don't like what they find. -- Bill Bedford mailto://billb@mousa.demon.co.uk SQUEAK. From dante@oz.net Thu Dec 16 01:28:23 1999 From: dante@oz.net (Dante) Date: Wed, 15 Dec 1999 17:28:23 -0800 Subject: [Pythonmac-SIG] MiniAEFrame example? Message-ID: Are there any examples using MiniAEFrame out there? thanks, Dante _________________________________________________________ Dante - dante@oz.net - #FightThePower on Openprojects From jack@oratrix.nl Thu Dec 16 11:24:13 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 16 Dec 1999 12:24:13 +0100 Subject: [Pythonmac-SIG] MiniAEFrame example? In-Reply-To: Message by Dante , Wed, 15 Dec 1999 17:28:23 -0800 , Message-ID: <19991216112414.4DED9370CF2@snelboot.oratrix.nl> > Are there any examples using MiniAEFrame out there? The module itself has a tiny example, and MiniAEFrame is also used in the CGI example. But if someone wants to take the waste-based editor from the waste.html example and add scripting to that using MiniAEFrame that would make a really powerful example... -- 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 Thu Dec 16 16:04:46 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 16 Dec 1999 17:04:46 +0100 Subject: [Pythonmac-SIG] Python on Japanese MacOS 8.6 In-Reply-To: Message by KAWASAKI , Fri, 17 Dec 1999 00:26:01 +0900 , Message-ID: <19991216160446.80110370CF2@snelboot.oratrix.nl> Has anyone used Python on a Japanese version of MacOS (or any other version of MacOS that has non-roman script), and what were the results? fkawasak@po.twin.ne.jp has the problem that the interpreter works fine when started "by hand", but if you drag/drop or doubleclick a script it fails miserably. I'm now suspecting that some of the code that handles pathnames may be roman-script-centric or something like that, so I'd like to hear of other peoples results with such a setup. -- 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 noboru.yamamoto@kek.jp Fri Dec 17 10:09:34 1999 From: noboru.yamamoto@kek.jp (Noboru Yamamoto) Date: Fri, 17 Dec 1999 19:09:34 +0900 Subject: [Pythonmac-SIG] Re: Python on Japanese MacOS 8.6 References: <19991216170027.1DFE21CEFD@dinsdale.python.org> Message-ID: <385A0BCD.F9294A87@kek.jp> > > Message: 9 > To: pythonmac-sig@python.org > Cc: KAWASAKI > Date: Thu, 16 Dec 1999 17:04:46 +0100 > From: Jack Jansen > Subject: [Pythonmac-SIG] > > Has anyone used Python on a Japanese version of MacOS (or any other version of > MacOS that has non-roman script), and what were the results? > > fkawasak@po.twin.ne.jp has the problem that the interpreter works fine when > started "by hand", but if you drag/drop or doubleclick a script it fails > miserably. I'm now suspecting that some of the code that handles pathnames may > be roman-script-centric or something like that, so I'd like to hear of other > peoples results with such a setup. > -- > 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 > > End of Pythonmac-SIG Digest_______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://www.python.org/mailman/listinfo/pythonmac-sig I have similar problem on our PowerMac9500 running MacOS J-8.5 with MacPython1.5.2c1. Double clicking or dropping a python script onto Python Interpreter starts Python Interpreter but the script is not executed. On the same computer, MacPython 1.5.1 works OK. Dropping a python script onto Python starts execution of the scripts. PowerMacG3 running MacOS J-8.6 with MacPython 1.5.2c1 does not have such a problem, however. MacPython 1.5.2c1 on my iMac(Rev.B) running MacOS9-J also works without any problem. On PowerMacG3 and iMac, MacPython1.5.1 was installed and used before installing 1.5.2c1. On PowerMac9500, no Python interpreter was installed before 1.5.2c1. Does it make difference? Noboru Yamamoto KEKB control group KEK ( High Energy Accelerator Research Organization) JAPAN From jack@oratrix.nl Fri Dec 17 17:18:40 1999 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 17 Dec 1999 18:18:40 +0100 Subject: [Pythonmac-SIG] Navigation services Message-ID: <19991217171840.DB137370CF2@snelboot.oratrix.nl> For the people who track the CVS archive: I've just checked in a full interface to Navigation Services. I was first looking at extending Joe's stuff with a few things, but it turned out that for GRiNS I need so much of the full functionality that I bit the bullet and just implemented the whole thing lokc, stock and barrel, including all the callbacks, option records, etc etc etc. If you check this out please let me know whether it works, and/or what is missing. -- 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 Fri Dec 17 23:17:03 1999 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 18 Dec 1999 00:17:03 +0100 Subject: [Pythonmac-SIG] Democracy time again: StandardGetFile and friends Message-ID: <19991217231708.9B339EDD20@oratrix.oratrix.nl> It's feedback time again! Now that I have these wonderful Navigation stuff it would be nice if all programs could use it without having to bother with the new API, and possibly even without changing a line of code, by revectoring calls to macfs.StandardGetFile and friends to the Navigation stuff (if it is available on the current machine). I see a couple of possibilities, let me know what you think: 0. Don't bother, let people rewrite their code. 1. create a Python module macfsn that contains a StandardGetFile implemented through Nav and let people change their source code a tiny little bit. 2. Like 1, but go one step further: rename macfs to _macfs and call the module from 1 macfs. Also export everything else from macfs. 3. Like 1, but put magic code in the macfs C module that will try to import the macfsn module (if Nav is available) and replace the builtin StandardGetFile with the Python one. 42. Implement all the compat code in C. (As to the numbering scheme: one-digit numbers will possibly be implemented by me, for other choices someone else will have to step in:-). -- 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 tschinke@swissonline.ch Sun Dec 19 15:43:35 1999 From: tschinke@swissonline.ch (Vincenzo Tschinke) Date: Sun, 19 Dec 1999 16:43:35 +0100 Subject: [Pythonmac-SIG] Problem with arrays of arrays Message-ID: Hi! I am doing some basic molecular connectivity operation (graphs). Trying to convert a list of bonds (list of edges) into a connectivity table (for each vertex [atom], list of connected vertices), by filling an array of arrays, I got the right or wrong result depending on how I define the initial arrays. If I define an array of N emtpy arrays as array_of_empties = N * [[]] I get the *wrong* result. If I use the more exotic definition array_of_empties = map ( lambda x : [] , range( N )) I get the *right* result. Note that after being created, such two arrays compare as equal. Please see the listing below. Is there anything wrong with the first definition, or do we have a Python bug here? =========================================================================== Python 1.5.2b1 (#47, Jan 13 1999, 15:14:59) [CW PPC w/GUSI w/MSL] >>> ee=[[1,2],[1,3],[1,4]] # 3 edges : 3 vert. connected to centr. vertex >>> ee [[1, 2], [1, 3], [1, 4]] >>> aa=4*[[]] # array of four empty arrays >>> AA=map(lambda x : [], range(4)) # same as above >>> aa==AA # arrays are equal !!! 1 >>> for p in ee: # build table of connected verteces ... i=p[0] ... j=p[1] ... aa[i-1].append(j) ... aa[j-1].append(i) ... AA[i-1].append(j) ... AA[j-1].append(i) ... >>> aa # wrong result !!! [[2, 1, 3, 1, 4, 1], [2, 1, 3, 1, 4, 1], [2, 1, 3, 1, 4, 1], [2, 1, 3, 1, 4, 1]] >>> AA # correct result [[2, 3, 4], [1], [1], [1]] >>> aa==AA 0 >>> ======================= Vincenzo Tschinke Kernmattstr. 24 CH-4102 Binningen Switzerland +4161 422 1991 (T+F) tschinke@swissonline.ch ======================= From orla_redbird@crosswinds.net Mon Dec 20 04:55:52 1999 From: orla_redbird@crosswinds.net (Gordon Worley) Date: Sun, 19 Dec 1999 23:55:52 -0500 (EST) Subject: [Pythonmac-SIG] ODP MacPython Category Message-ID: I crated this some time ago, but the thought never entered my mind until= recently that I should solicit links on this list. Well, now I am. Please= go over to and add your links. The cat is looking very skimpy at the= moment, so maybe everyone can help me plump it before the new year (or just= whenever you feel like submiting your links to the directory). Thanks for any submitted links. I'll add them as soon as possible. - Gordon Worley http://www.crosswinds.net/~orla_redbird/ mailto:orla_redbird@crosswinds.net From scottrharris@earthlink.net Tue Dec 21 04:22:14 1999 From: scottrharris@earthlink.net (Scott Harris) Date: Mon, 20 Dec 1999 23:22:14 -0500 Subject: [Pythonmac-SIG] Toolbox, Quickdraw, and Python References: <19991220170025.DE3921CE05@dinsdale.python.org> Message-ID: <385F0077.147BDD79@earthlink.net> Does anyone have a good example of using toolbox calls with Python they can direct me to or send me? I'd like to see an example of opening a window and drawing into it with some Quickdraw routines. I've mentioned this on the group before, but my goal is to get at least a subset of QuickDraw3D working with Python. However, I'm much more interested in the number crunching my application does so I only have a moderate level of skill when it comes to the Mac toolbox and Python. Any help would be greatly appreciated! -Scott Harris From steve@spvi.com Wed Dec 22 15:27:17 1999 From: steve@spvi.com (Steve Spicklemire) Date: Wed, 22 Dec 1999 10:27:17 -0500 (EST) Subject: [Pythonmac-SIG] two questions..... Message-ID: <199912221527.KAA17461@acer.spvi.com> Thanks for the help with sending keystrokes. Now I have two more problems. ;-) 1) Performance. My solution works.... very slowly. I have a MacPython frozen application that uses ctb to monitor the serial port for incoming codes from an IR remote control decoder I built. When it gets a code it converts it to a 'key press' and sends it as an AppleEvent to AkuaSweets_InterfaceSweet. If you have ideas about this... code is posted below. 2) Performance. Well.. this is more about my attempt to sort out (1). I thought about building a module that doesn't use AppleEvents at all. (I'm not sure that AppleEvents are the problem... but I need to get this working of other reasons anyway...) I went out this morning and got the latest stuff from CVS (Python and MacPython). When I try to build PythonCore.prj I'm getting (CW5): Link Error : export symbol '_PyImport_LoadDynamicModule' is undefined Link Error : export symbol '__reopen' is undefined Link Error : CFM68K_Startup.c: '__reopen' is undefined or is not an exportable object. Link Error : CFM68K_Startup.c: '_PyImport_LoadDynamicModule' is undefined or is not an exportable object. Link Error : venusMOS:Applications:Development:CWGUSI:src:GUSIMSLFile.cp: '__num_to_file' referenced from 'GUSISetupMSLSIOUX()' is undefined. Link Error : venusMOS:Applications:Development:CWGUSI:src:GUSIMSLFile.cp: '__num_to_file' referenced from 'fwalk' is undefined. Link Error : import.c: '_PyImport_DynLoadFiletab' referenced from '_PyImport_DynLoadFiletab' [DataPointer] is undefined. What version of GUSI are folks using with these projects? thanks! -steve P.S. For those still reading here are the relevant snippets of code: .... class AkuaInterface(Akua_Interface_Sweets, Required_Suite.Required_Suite, \ Standard_Suite.Standard_Suite, aetools.TalkTo): """A class that can talk to Akua""" pass .... class macIR_App(FrameWork.Application): "Application class for macIR.py" .... def idle(self, event): "Idle routine - process serial events.." self.main_dialog.process() class MyDialog(FrameWork.DialogWindow): "Main dialog window for macIR" def __init__(self, parent): FrameWork.DialogWindow.__init__(self, parent) self.ctbTool = ctb.CMNew('Serial Tool', None) self.opened = 0 self.openSerial() self.talker = AkuaInterface(SIGNATURE) self.currentKeys = '' .... def process(self): """ we have time... process events...""" self.ctbTool.Idle() d, dummy = self.ctbTool.Read(1000, ctb.cmData, 1) if d: # then process the code d.... and send it to self.talker .... main() anyway.... there is a significant delay after hitting the remote and getting a keydown in the frontmost app. I'm wondering if there is any better way to get 'hit' with idle events. Any thoughts are appreciated. From steve@spvi.com Wed Dec 22 16:17:47 1999 From: steve@spvi.com (Steve Spicklemire) Date: Wed, 22 Dec 1999 11:17:47 -0500 (EST) Subject: [Pythonmac-SIG] two questions..... In-Reply-To: <199912221527.KAA17461@acer.spvi.com> (message from Steve Spicklemire on Wed, 22 Dec 1999 10:27:17 -0500 (EST)) References: <199912221527.KAA17461@acer.spvi.com> Message-ID: <199912221617.LAA17846@acer.spvi.com> OK. I've just been reading the FrameWork.py source and I see the MacSchedParams stuff.. I'll play with this a little. It looks like the default parameters are pretty conservative.. and I might get better performance by tweaking these. Any other ideas... still welcome! (esp Re: building current sources...) thanks, -steve From jack@oratrix.nl Wed Dec 22 16:25:01 1999 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 22 Dec 1999 17:25:01 +0100 Subject: [Pythonmac-SIG] two questions..... In-Reply-To: Message by Steve Spicklemire , Wed, 22 Dec 1999 10:27:17 -0500 (EST) , <199912221527.KAA17461@acer.spvi.com> Message-ID: <19991222162501.BBA48370CF2@snelboot.oratrix.nl> > I'm getting (CW5): > > Link Error : export symbol '_PyImport_LoadDynamicModule' is undefined This is solved by rebuilding the .exp file. The details are in :Mac:Demo:building.html. > Link Error : export symbol '__reopen' is undefined > > Link Error : CFM68K_Startup.c: '__reopen' is undefined or is not an exportable object. > > Link Error : CFM68K_Startup.c: '_PyImport_LoadDynamicModule' is undefined or is not an exportable object. > > Link Error : venusMOS:Applications:Development:CWGUSI:src:GUSIMSLFile.cp: '__num_to_file' referenced from 'GUSISetupMSLSIOUX()' is undefined. > > Link Error : venusMOS:Applications:Development:CWGUSI:src:GUSIMSLFile.cp: '__num_to_file' referenced from 'fwalk' is undefined. > > Link Error : import.c: '_PyImport_DynLoadFiletab' referenced from '_PyImport_DynLoadFiletab' [DataPointer] is undefined. > > What version of GUSI are folks using with these projects? These are indeed incompatabilities between your version of CWGUSI and CW Pro 5. For the time being I've put the working CWGUSI (a modified 1.8.5, I think) from my disk in ftp://ftp.cwi.nl/pub/jack/python/mac/CWGUSI-for-Python152.hqx . We'll go to GUSI 2.0 for the next release, I hope. -- 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 giorgio@dimi.uniud.it Wed Dec 22 17:06:01 1999 From: giorgio@dimi.uniud.it (Giorgio Brajnik) Date: Wed, 22 Dec 1999 18:06:01 +0100 (MET) Subject: [Pythonmac-SIG] [Q] how to disable stderr/stdout console? Message-ID: <199912221706.SAA03636@ten.dimi.uniud.it> Hi there. I've got this problem when building an application that embeds python. My C++ program calls PyMac_Initialize(), and as a result of this a blank console window is opened. How should I do to get rid of it at the very beginning? Some pythonmac documentation says: Embedding Python on the mac is pretty similar to embedding it on other platforms, but a few points need mentioning: You call PyMac_Initialize() in stead of Py_Initialize(). The prototype is in macglue.h. This call initializes the toolbox, GUSI (if needed), sets up the correct resource files and calls Py_Initialize. You have to be consequent in your use of GUSI. If the library uses it so should your program and vice versa. The console-behaviour (close-on-exit, etc) is controlled by Python, but you are of course free to change that after calling PyMac_Initialize(). and it is precisely this latter thing that I want to do. How? Thanks a lot Giorgio Brajnik ______________________________________________________________________ Dip. di Matematica e Informatica | voice: +39 (0432) 55.8445 Universita` di Udine | fax: +39 (0432) 55.8499 Via delle Scienze, 206 | email: giorgio@dimi.uniud.it Loc. Rizzi -- 33100 Udine -- ITALY | http://www.dimi.uniud.it/~giorgio From steve@spvi.com Wed Dec 22 18:37:25 1999 From: steve@spvi.com (Steve Spicklemire) Date: Wed, 22 Dec 1999 13:37:25 -0500 (EST) Subject: [Pythonmac-SIG] two questions..... In-Reply-To: <19991222162501.BBA48370CF2@snelboot.oratrix.nl> (message from Jack Jansen on Wed, 22 Dec 1999 17:25:01 +0100) References: <19991222162501.BBA48370CF2@snelboot.oratrix.nl> Message-ID: <199912221837.NAA18536@acer.spvi.com> One more quickie.... I'm trying to do some primitive profiling to see what the #&^#$ is taking all the time. I try to use time.time() but on the Mac for some reason it's resolution is 1.0 sec! Is there a more fine-grain timer out there that I could (easily?) use? thanks, -steve From jack@oratrix.nl Thu Dec 23 09:42:45 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 23 Dec 1999 10:42:45 +0100 Subject: [Pythonmac-SIG] [Q] how to disable stderr/stdout console? In-Reply-To: Message by Giorgio Brajnik , Wed, 22 Dec 1999 18:06:01 +0100 (MET) , <199912221706.SAA03636@ten.dimi.uniud.it> Message-ID: <19991223094331.D712C370CF2@snelboot.oratrix.nl> > The console-behaviour (close-on-exit, etc) is controlled by > Python, but you are of course free to change that after calling > PyMac_Initialize(). > > and it is precisely this latter thing that I want to do. How? Through the Sioux options struct. The MetroWerks documentation should tell you how to do this (and, actually, I think the header file sioux.h has almost all the needed information). -- 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 Thu Dec 23 10:08:51 1999 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 23 Dec 1999 11:08:51 +0100 Subject: [Pythonmac-SIG] two questions..... In-Reply-To: Message by Steve Spicklemire , Wed, 22 Dec 1999 13:37:25 -0500 (EST) , <199912221837.NAA18536@acer.spvi.com> Message-ID: <19991223100851.8C912370CF2@snelboot.oratrix.nl> > > One more quickie.... I'm trying to do some primitive profiling to see > what the #&^#$ is taking all the time. I try to use time.time() but > on the Mac for some reason it's resolution is 1.0 sec! Is there > a more fine-grain timer out there that I could (easily?) use? MacOS.GetTicks() gives the time in 1/60th second ticks since startup. But be aware that it'll wrap in a couple of weeks 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 giorgio@dimi.uniud.it Fri Dec 24 18:18:59 1999 From: giorgio@dimi.uniud.it (Giorgio Brajnik) Date: Fri, 24 Dec 1999 19:18:59 +0100 (MET) Subject: [Pythonmac-SIG] [Q] how to disable stderr/stdout console? In-Reply-To: <19991223094331.D712C370CF2@snelboot.oratrix.nl> (message from Jack Jansen on Thu, 23 Dec 1999 10:42:45 +0100) References: <19991223094331.D712C370CF2@snelboot.oratrix.nl> Message-ID: <199912241818.TAA18504@ten.dimi.uniud.it> >>>>> On Thu, 23 Dec 1999 10:42:45 +0100, Jack Jansen said: >> The console-behaviour (close-on-exit, etc) is controlled by >> Python, but you are of course free to change that after calling >> PyMac_Initialize(). >> >> and it is precisely this latter thing that I want to do. How? Jack> Through the Sioux options struct. The MetroWerks Jack> documentation should tell you how to do this (and, actually, Jack> I think the header file sioux.h has almost all the needed Jack> information). Thank you, Jack. We did not manage to solve the entire problem, yet. But we'll keep trying, following your suggestion. On the other hand, don't you think that initialization of python should allow more freedom to the api programmer? Perhaps by leaving as option the call to init_mac_world() ? Giorgio Brajnik ______________________________________________________________________ Dip. di Matematica e Informatica | voice: +39 (0432) 55.8445 Universita` di Udine | fax: +39 (0432) 55.8499 Via delle Scienze, 206 | email: giorgio@dimi.uniud.it Loc. Rizzi -- 33100 Udine -- ITALY | http://www.dimi.uniud.it/~giorgio From js@ac-copy.net Sat Dec 25 14:18:37 1999 From: js@ac-copy.net (Joachim Schmitz) Date: Sat, 25 Dec 1999 15:18:37 +0100 (CET) Subject: [Pythonmac-SIG] Re: [ANNOUNCE] PySol 3.10 - a solitaire game collection In-Reply-To: <19991222015859.A9045@laetitia.oberhumer.com> Message-ID: Hi, did anyone successfully run it on an iMac. After loading about 85 % the loading stops with an "not enough memory error" ? On Wed, 22 Dec 1999, Markus F.X.J. Oberhumer wrote: > -----BEGIN PGP SIGNED MESSAGE----- > > > PySol - a Solitaire Game Collection > Version 3.10 > > http://wildsau.idv.uni-linz.ac.at/mfx/pysol.html > > Copyright (C) 1998, 1999 Markus F.X.J. Oberhumer > > > > What is PySol ? > =============== > > PySol is an exciting collection of 128 solitaire card games. > > Among the supported games are classics like Aces Up, Baker's Game, > Canfield, FreeCell, Forty Thieves, Golf, Klondike, Monte Carlo, > Osmosis, Pyramid, Scorpion, Spider, Yukon, and many more... > > PySol may be freely distributed under the terms of the GNU GPL. > > PySol aims to be Commercial Quality Freeware. > > > Why yet another solitaire game ? > ================================ > > Here are some highlights of PySol: > > - currently supports 128 (!) distinct solitaire variants > - based upon an extensible solitaire engine > - very nice look and feel including multiple cardsets > and background table tiles > - unlimited undo & redo > - load & save games > - player statistics and log files > - hint system > - demo games > - support for user written plug-ins - add your own solitaire variants > - integrated HTML help browser > - lots of documentation > - fully portable across Unix/X11, Windows 95/98/NT and MacOS > - written in 100% pure Python > - just run it - no need to compile anything > - freely available > - distributed under the GNU GPL with full source code > > > Yeah, I know. But what's new ? > ============================== > > * Implemented 17 new games. > > * Added sound support including samples and background MP3/MOD music. > Sound is implemented by a rather generic server (a C program) using > the SDL library for low-level mixing and playing. > > * Wrote some really fancy tree dialogs - Python programmers will > definitely love these :-) > > * Added 19 great cardsets to pysol-cardsets. Many thanks to T. Kirk. > > > Cool. Where can I get it ? > ========================== > > Point your browser to http://wildsau.idv.uni-linz.ac.at/mfx/pysol.html > The PySol Gallery is awaiting your visit as well. > > > What do I need to start playing ? > ================================= > > PySol requires Python 1.5.2 and Tcl/Tk 8.0.5. Both packages are > freely available for Unix, Windows 95/98/NT and Macintosh. > > BTW, there is no need to compile anything since the whole program is just > a Python script. Just run it, and that's all. > > > Contributions > ============= > > I'm looking for people who want to contibute new games, provide > additional graphics, scan cardset packs, improve the docs, etc. > Please see the README in the distribution about details. > > > License terms > ============= > > PySol is Copyright (C) 1998, 1999 Markus Franz Xaver Johannes Oberhumer > > PySol is distributed under the terms of the GNU General Public License (GPL). > See the file COPYING. > > > Have fun, > Markus > > http://wildsau.idv.uni-linz.ac.at/mfx/pysol.html > > > > -----BEGIN PGP SIGNATURE----- > Version: 2.6.3ia > Charset: noconv > > iQCVAwUBOGAYJ210fyLu8beJAQH9EgQAsRwAPJHhEm1aMN9C+FVbhcDHrkqOUOmT > WrD7sJRtvFpFfZ72GrcYpczgmB3tjwJsfh2C4dOtajrBGdIZuCh5z+f7aHnp77n7 > oOPKxmpmQzlq/l5t2hlhewbE2dXFMh8+dbbygzfGVgORs0SbKi8CxTQFjzoZPy4t > p6TiDKXl9bw= > =5B4i > -----END PGP SIGNATURE----- > > -- > http://www.python.org/mailman/listinfo/python-list > Mit freundlichen Grüßen Joachim Schmitz WWW-Consultant email: js@ac-copy.net tel: +49-241-89491-0 fax: +49-241-89491-29 From just@letterror.com Mon Dec 27 15:54:56 1999 From: just@letterror.com (Just van Rossum) Date: Mon, 27 Dec 1999 16:54:56 +0100 Subject: [Pythonmac-SIG] Re: [ANNOUNCE] PySol 3.10 - a solitaire game collection In-Reply-To: References: <19991222015859.A9045@laetitia.oberhumer.com> Message-ID: At 3:18 PM +0100 12/25/99, Joachim Schmitz wrote: >did anyone successfully run it on an iMac. After loading about 85 % the >loading stops with an "not enough memory error" ? The trick is to give BuildApplet a *lot* of memory, then give the resulting applet about 12 megs of memory. This worked for me. (The trouble is caused by the fact that PySol is one huge source file, and Python's parser/compiler eats a lot of memory when working with large source files. *Running* PySol is not the problem, compiling is.) Just From lists@kassube.de Mon Dec 27 17:19:01 1999 From: lists@kassube.de (Nils Kassube) Date: Mon, 27 Dec 1999 18:19:01 +0100 Subject: [Pythonmac-SIG] Re: [ANNOUNCE] PySol 3.10 - a solitaire game collection Message-ID: just@letterror.com (Just van Rossum) wrote: > *Running* PySol is not the problem, compiling is.) Some widgets do not display correctly on my system. However, it looks like it's Tk's problem, not Python's. Cheers, Nils -- nika@kassube.de (preferred) 4kassube@informatik.uni-hamburg.de From jack@oratrix.nl Tue Dec 28 16:23:48 1999 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 28 Dec 1999 17:23:48 +0100 Subject: [Pythonmac-SIG] [Q] how to disable stderr/stdout console? In-Reply-To: Message by Giorgio Brajnik , Fri, 24 Dec 1999 19:18:59 +0100 (MET) , <199912241818.TAA18504@ten.dimi.uniud.it> Message-ID: <19991228162353.1CEC5EDD20@oratrix.oratrix.nl> Recently, Giorgio Brajnik said: > On the other hand, don't you think that initialization of python > should allow more freedom to the api programmer? Perhaps by leaving as > option the call to init_mac_world() ? I was already going to change this, by adding a do_init_toolbox argument to PyMac_Initialize(), but then I remembered (or seem to remember:-) that multiple toolbox initializations shouldn't do any harm. And as PyMac_Initialize needs (some of) the toolboxes to be initialized the only option your program has is to initialize them earlier, in which case the init_mac_world() call in PyMac_Initialize is a no-op. -- 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 gandreas@visi.com Tue Dec 28 16:37:55 1999 From: gandreas@visi.com (Glenn Andreas) Date: Tue, 28 Dec 1999 10:37:55 -0600 Subject: [Pythonmac-SIG] [Q] how to disable stderr/stdout console? In-Reply-To: <19991228162353.1CEC5EDD20@oratrix.oratrix.nl> References: <19991228162353.1CEC5EDD20@oratrix.oratrix.nl> Message-ID: At 5:23 PM +0100 12/28/99, Jack Jansen wrote: >Recently, Giorgio Brajnik said: > > On the other hand, don't you think that initialization of python > > should allow more freedom to the api programmer? Perhaps by leaving as > > option the call to init_mac_world() ? > >I was already going to change this, by adding a do_init_toolbox >argument to PyMac_Initialize(), but then I remembered (or seem to >remember:-) that multiple toolbox initializations shouldn't do any >harm. And as PyMac_Initialize needs (some of) the toolboxes to be initialized >the only option your program has is to initialize them earlier, in >which case the init_mac_world() call in PyMac_Initialize is a no-op. >-- Unless somebody wants to write a faceless background only application that uses Python, since BOAs don't call all the toolbox init calls (they don't call InitMenu() or InitWindow(), IIRC). And we want Python and BOAs to get along, after all (sorry, couldn't resist the pun). Glenn Andreas gandreas@delver.com Author of Macintosh games: Theldrow 2.3, Blobbo 1.0.2, Cythera 1.0.2 Be good, and you will be lonesome From skip@mojam.com (Skip Montanaro) Tue Dec 28 22:58:34 1999 From: skip@mojam.com (Skip Montanaro) (Skip Montanaro) Date: Tue, 28 Dec 1999 16:58:34 -0600 Subject: [Pythonmac-SIG] MailMan or Pipermail bug or just pilot error? Message-ID: <199912282258.QAA04135@dolphin.mojam.com> I just joined the PythonMac SIG and decided to browse the list archives. I noticed that the most recent archives at http://www.python.org/pipermail/pythonmac-sig/ show 2009-December as the current month. Since this rollover stuff happens automatically my presumption is it's a bug in either MailMan or Pipermail. Skip Montanaro | http://www.mojam.com/ skip@mojam.com | http://www.musi-cal.com/ 847-971-7098 | Python: Programming the way Guido indented... From bwarsaw@cnri.reston.va.us (Barry A. Warsaw) Wed Dec 29 00:17:15 1999 From: bwarsaw@cnri.reston.va.us (Barry A. Warsaw) (Barry A. Warsaw) Date: Tue, 28 Dec 1999 19:17:15 -0500 (EST) Subject: [Pythonmac-SIG] Re: [Mailman-Users] MailMan or Pipermail bug or just pilot error? References: <199912282258.QAA04135@dolphin.mojam.com> Message-ID: <14441.21259.372003.289341@anthem.cnri.reston.va.us> >>>>> "SM" == Skip Montanaro writes: SM> I just joined the PythonMac SIG and decided to browse the list SM> archives. I noticed that the most recent archives at SM> http://www.python.org/pipermail/pythonmac-sig/ SM> show 2009-December as the current month. Since this rollover SM> stuff happens automatically my presumption is it's a bug in SM> either MailMan or Pipermail. Actually what's happening is that Pipermail believes the Date: field given in the original message. Take a look at the flat text file and you'll see that fkawasak's message contains the bogus date (maybe he was playing y2k conformance testing). The lists have an option to ignore the Date: claim and use the date when Mailman resends it. Assuming that works, maybe it should be the default. I doubt anybody ever changes it (I surely haven't for any of my lists). -Barry From skip@mojam.com Wed Dec 29 05:08:29 1999 From: skip@mojam.com (Skip Montanaro) Date: Tue, 28 Dec 1999 23:08:29 -0600 Subject: [Pythonmac-SIG] Library "too new"? Message-ID: <3869974C.1396902D@mojam.com> What's this mean? >>> import DateTime ... ImportError: PythonCore: An import library was too new for a client. This is using the precompiled mxDateTime module that comes with the mxDateTime package. I'd search for the error in the archives (it's probably come up before), but search.python.org is apparently down for the holidays. Searching at Google for "pythonmac import library" didn't turn up anything useful. Thx, Skip Montanaro skip@mojam.com From skip@mojam.com (Skip Montanaro) Thu Dec 30 15:57:58 1999 From: skip@mojam.com (Skip Montanaro) (Skip Montanaro) Date: Thu, 30 Dec 1999 09:57:58 -0600 (CST) Subject: [Pythonmac-SIG] Cooperative threading on Mac (was: playing well with others (newbie question)) In-Reply-To: <83rvrl$heu$0@216.39.162.232> References: <83rvrl$heu$0@216.39.162.232> Message-ID: <14443.33030.855942.89887@dolphin.mojam.com> (I've redirected this from the main list to the PythonMac-SIG.) Michael> I'm stuck with the following problem with python 1.5.2c1 on Michael> MacOS 8.6: Michael> while 1: Michael> pass Michael> grinds my system to a halt. In other languages there are Michael> commands that give away cycles to the rest of the system and Michael> thus "playing well with others." Is there some similar command Michael> in python? Something to replace that pass with that allows me Michael> to do other things with my system? The code that implements pass in ceval.c could easily be modified to periodically call whatever Mac toolbox function is used to release the processor. Unfortunately, the Mac-specific source code seems not to be under CVS control, so while I can see some tantalizing hints of what needs doing in the source on my Linux machine, I can't suggest anything specific. I'm sure Jack or someone else will know precisely what needs doing. Skip Montanaro | http://www.mojam.com/ skip@mojam.com | http://www.musi-cal.com/ 847-971-7098 | Python: Programming the way Guido indented... From jack@oratrix.nl Fri Dec 31 15:21:48 1999 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 31 Dec 1999 16:21:48 +0100 Subject: [Pythonmac-SIG] [Q] how to disable stderr/stdout console? In-Reply-To: Message by Glenn Andreas , Tue, 28 Dec 1999 10:37:55 -0600 , Message-ID: <19991231152154.220FEEDD20@oratrix.oratrix.nl> Recently, Glenn Andreas said: > >I was already going to change this, by adding a do_init_toolbox > >argument to PyMac_Initialize(), but then I remembered (or seem to > >remember:-) that multiple toolbox initializations shouldn't do any > >harm. And as PyMac_Initialize needs (some of) the toolboxes to be initialize > d > >the only option your program has is to initialize them earlier, in > >which case the init_mac_world() call in PyMac_Initialize is a no-op. > > Unless somebody wants to write a faceless background only application > that uses Python, since BOAs don't call all the toolbox init calls > (they don't call InitMenu() or InitWindow(), IIRC). Ah... I experimented with FBAs in Python for a while, but I never got them to work. This may be the reason why. I think this could be fixed by splitting the toolbox init calls in two sets: one to be done always, at the same place where currently everything is initialized, and one for the menu/window/etc init calls, to be done after reading the preferences but before popping the optional startup dialog. That way we can add a (per-application) preference flag "don't init windowing toolboxes", which could be set for FBA's (or by programs using embedded Python). I'll put it on my todo list, but it's low-priority, so if someone wants it quick: please donate code. -- 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 Fri Dec 31 15:44:25 1999 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 31 Dec 1999 16:44:25 +0100 Subject: [Pythonmac-SIG] Library "too new"? In-Reply-To: Message by Skip Montanaro , Tue, 28 Dec 1999 23:08:29 -0600 , <3869974C.1396902D@mojam.com> Message-ID: <19991231154430.5D3C1EDD20@oratrix.oratrix.nl> Recently, Skip Montanaro said: > What's this mean? > > >>> import DateTime > ... > ImportError: PythonCore: An import library was too new for a client. > > This is using the precompiled mxDateTime module that comes with the > mxDateTime package. MacPython dynamic modules aren't portable between releases. The machinery is there, but because PythonCore also contains the whole C library the version number has to be upped not only for python API version number changes but also for new C libraries. The error message comes from the MacOS dynamic loader, which actually _checks_ that a dll is compatible with the version used during compilation (unlike some Other OS that shall remain nameless, which happily lets your application crash lateron:-) Or, in short: the message means exactly what it says:-) -- 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 Fri Dec 31 15:50:16 1999 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 31 Dec 1999 16:50:16 +0100 Subject: [Pythonmac-SIG] Cooperative threading on Mac (was: playing well with others (newbie question)) In-Reply-To: Message by Skip Montanaro , Thu, 30 Dec 1999 09:57:58 -0600 (CST) , <14443.33030.855942.89887@dolphin.mojam.com> Message-ID: <19991231155021.DCC1AEDD20@oratrix.oratrix.nl> Recently, Skip Montanaro said: > > (I've redirected this from the main list to the PythonMac-SIG.) > > Michael> I'm stuck with the following problem with python 1.5.2c1 on > Michael> MacOS 8.6: > > Michael> while 1: > Michael> pass > > Michael> grinds my system to a halt. In other languages there are > Michael> commands that give away cycles to the rest of the system and > Michael> thus "playing well with others." Is there some similar command > Michael> in python? Something to replace that pass with that allows me > Michael> to do other things with my system? > > The code that implements pass in ceval.c could easily be modified to > periodically call whatever Mac toolbox function is used to release the > processor. That code is indeed in place (unless you specifically disable it by calling MacOS.SchedParams() with various arguments to turn it off). You can also use SchedParams() to change the actual allocation of cycles to others when Python is in foreground or background (default is pretty greedy in the foreground, not greedy in the background). There does seem to be a bug in the current release, though, that I haven't seen before: when you switch to a background application this causes Python to monopolize the CPU for 15 seconds (not even the clock runs). After that everything is as sketched above. I will investigate what is going on. > Unfortunately, the Mac-specific source code seems not to be > under CVS control, so while I can see some tantalizing hints of what needs > doing in the source on my Linux machine, I can't suggest anything specific. MacPython is under CVS, see the homepage (http://www.cwi.nl/~jack/macpython.html) for details. -- 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 steve@spvi.com Fri Dec 31 20:36:12 1999 From: steve@spvi.com (Steve Spicklemire) Date: Fri, 31 Dec 1999 15:36:12 -0500 (EST) Subject: [Pythonmac-SIG] Director Xtra "Xpython" for MAC + Time Manager module Message-ID: <199912312036.PAA03141@acer.spvi.com> Just in time for the new millennium... there is a new stab at a Python Xtra for Director and a "Time Manager" module for MacPython. For some reason I can't get these to work with 1.5.2c1 anymore, since I built with the CVS sources, but they *do* work with the Python I built with CVS. In any case I've put the whole lot up at: http://opensource.spvi.com and you can check it out there. Please let me know if any of this stuff works, doesn't or whatever. Thanks also to Jack and Peter for all their help sorting out my various build problems. I'd like to get to the point where I can build something (like a dynamically linkable module) that can be used with 1.5.2b1, 1.5.2cx and 1.5.2c+ without a recompile ;-(. take care, -steve