From jack@oratrix.nl Sat Jan 1 23:30:50 2000 From: jack@oratrix.nl (Jack Jansen) Date: Sun, 02 Jan 2000 00:30:50 +0100 Subject: [Pythonmac-SIG] Automatic disposing of toolbox objects Message-ID: <20000101233055.3F50AEDD20@oratrix.oratrix.nl> Currently some toolbox objects (like windows) are automatically disposed when the Python object loses its last reference, while others (like resources/handles) are not, and have to be manually disposed. The reasons for this are mainly historic, although there is some practical reason too: the Res.Resource object can be a handle or a resource, and these have to be disposed of in different ways. Moreover, often you get passed a handle by some other part of the system that isn't yours, so you definitely shouldn't dispose it. Windows are different: as you usually create them yourself disposing them upon cleanup of the Python object is usually fine. But, of course, I'm now finally running into problems with this: since I've been adding all this appearance stuff it is pretty possible to get a Python object referring to, say, a List that is part of a list control. Disposing this list upon release of the Python object will come as a surprise (read: bus error:-) to the Control Manager. I can hack my way around this (of course:-), but this whole automatic disposal vs. manual disposal mess has bothered me for years, so maybe it's time to do something about it. So please shine your light on the following ideas (and, of course, feel free to come up with better ones): - Add a "disposer" field to all the toolbox objects. This is a (C) routine to be called on the underlying object or NULL. There would be a Python call on the object to allow you to set/reset (or, in case of resources, set-to-DisposeHandle/set-to-ReleaseResource/reset) the field. The toolbox modules would make an educated guess as to what to initialize the field to, but you could always override it from Python. - Take the whole idea a bit further, notice that all the toolbox PyObjects are the same in C (a struct with a handle), and create an API that allows for in-place(!) modification of the PyObject object type. Then we'd have List objects (not LDispose()d on release of the Python object) and ManagedList objects (which are LDisposed), etc. Moreover, we could solve the Handle/Resource problem, more easily convert Handles to Lists/Icons/etc. The tricky bit here is that the PyObject type field has to be modified, and while I can't think of any obvious problems with this I'm not sure about it. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From abrahams@mediaone.net Sun Jan 2 04:02:48 2000 From: abrahams@mediaone.net (Dave Abrahams) Date: Sat, 01 Jan 2000 23:02:48 -0500 Subject: [Pythonmac-SIG] Building Mac Python from source Message-ID: <200001020402.XAA20317@chmls06.mediaone.net> From Mac/Demo/building.html in the Mac distribution: "This document explains how to build MacPython from source. This is necessary if you want to write extension modules for 68K Python, and is also necessary if you want to make modifications to the Python core. Building Python is not something to be undertaken lightly, you need a reasonable working knowledge of the CodeWarrior development environment, a good net connection and probably quite some time too. The information density in this file is high, so you should probably print it and read it at your leasure. Most things are explained only once (and ^^^^^^^ [sic] probably in the wrong place:-). I am very interested in feedback on this document, send your comments to the Mac Python Special Interest Group. " Since you're interested in feedback: the distribution can't be built out-of-the-box with any of the last 3 revisions of CodeWarrior (we're up to Pro5.3, now). This is problematic for an open-source project, since old versions of CodeWarrior can't be bought ;) -Dave From steve@spvi.com Sun Jan 2 15:03:41 2000 From: steve@spvi.com (Steve Spicklemire) Date: Sun, 2 Jan 2000 10:03:41 -0500 (EST) Subject: [Pythonmac-SIG] Building Mac Python from source In-Reply-To: <200001020402.XAA20317@chmls06.mediaone.net> (abrahams@mediaone.net) References: <200001020402.XAA20317@chmls06.mediaone.net> Message-ID: <200001021503.KAA11971@acer.spvi.com> Hi Dave, The current CVS sources are buildable. I would suggest you go there. It sounds like Jack is in the middle of big changes, but I'm sure that he will prepare another release when he gets a chance. Jack.. is there any way the troops in the field can pitch in with that? I need to sort out why my shared libs will only run with my CVS build of MacPython, and not the current release. Something about version checking at runtime... too many things.. too little time! -steve >>>>> "Dave" == Dave Abrahams writes: [snippage....] Dave> Since you're interested in feedback: the distribution can't Dave> be built out-of-the-box with any of the last 3 revisions of Dave> CodeWarrior (we're up to Pro5.3, now). This is problematic Dave> for an open-source project, since old versions of Dave> CodeWarrior can't be bought ;) Dave> -Dave From jack@oratrix.nl Mon Jan 3 09:18:53 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 03 Jan 2000 10:18:53 +0100 Subject: [Pythonmac-SIG] Building Mac Python from source In-Reply-To: Message by "Dave Abrahams" , Sat, 01 Jan 2000 23:02:48 -0500 , <200001020402.XAA20317@chmls06.mediaone.net> Message-ID: <20000103091922.33412370CF2@snelboot.oratrix.nl> > Since you're interested in feedback: the distribution can't be built > out-of-the-box with any of the last 3 revisions of CodeWarrior (we're up to > Pro5.3, now). This is problematic for an open-source project, since old > versions of CodeWarrior can't be bought ;) Could you give the symptoms? The projects in the source distribution are CW Pro 5.0, so any of 5.X should build them (possibly after conversion to the new format). If you have 5.0 and you check out the projects from the repository you may have a problem, as they are 5.3. But if you have 5.0 you are entitled to free upgrades anyway, so there isn't really a reason not to move to 5.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 dpennell@guardnet.com Mon Jan 3 20:00:19 2000 From: dpennell@guardnet.com (David Pennell) Date: Mon, 3 Jan 2000 12:00:19 -0800 Subject: [Pythonmac-SIG] Re:pysol, TK Message-ID: >Date: Mon, 27 Dec 1999 18:19:01 +0100 >From: Nils Kassube >Subject: Re: [Pythonmac-SIG] Re: [ANNOUNCE] PySol 3.10 - a solitaire game >collection > > >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 Tk for Mac? I have always had one problem with using TK with Python on the Mac - The window never closes on the app/script using TK - using ^D or Quit or anything. The whole combo of python interpreter and Wish has to be forced-quit. This problem, however, never came up running pure TCL/TK programs. In fact, no Wish or tclsh glitches found so far. For this reason, I think the window-won't-close, app-won't-stop problem is a Python for Mac problem. Pysol 2.14 had additional problems for me on the Mac that it didn't in X-Windows (I use MacX): Save, Open and Close didn't work. My guess was these were also python for mac problems. When I use perl on the Mac, I don't use TCL/TK (I use MacPerl window modules), so I wouldn't have a chance to see if TK for the Mac has any general bugs when being called by other programs. Also, I think all the widgets that work at all on pysol are displaying okay for me. Are there known problems with Tcl/Tk on the Mac? David Pennell using Python 1.52c1, Tcl 8.1a2, Tk 8.1a2, on both iMac and Power Macintosh 7600/132, both running Mac OS8.6 Pysol version: 2.14 From dpennell@guardnet.com Mon Jan 3 20:17:14 2000 From: dpennell@guardnet.com (David Pennell) Date: Mon, 3 Jan 2000 12:17:14 -0800 Subject: [Pythonmac-SIG] New pysol Message-ID: Just one more note: Pysol 3.0 seems to have fixed most of the bugs (on the Macintosh, but not X-Windows) that I experienced before. By the way, how do you use the sounds? D. Pennell From orla_redbird@crosswinds.net Tue Jan 4 01:00:42 2000 From: orla_redbird@crosswinds.net (Gordon Worley) Date: Mon, 3 Jan 2000 20:00:42 -0500 Subject: [Pythonmac-SIG] Win32 Python book Message-ID: I was just over at O'Reilly's site and noticed that in beta is a Win32= Python book . Since over at= the PSA bookstore there are now sever new titles, the time may be ripe for= a MacPython book. Personally, I am more in need of such a book than able= to write one (I can program in Python fine, but using Mac specific= resources that are not also Python specific (i.e. calling toolboxes= directly, apple events, etc.)), so I just thought I would throw out the= idea that maybe someone should write such a book. The incentive here is= that, unlike normal documentation, a book offers the promis of profits,= although results may vary. I realize that such a task would be quite an= undertaking, but I'm sure there are many people like me that need help on= learning how to take advantage of Mac specific resources so that our Python= scripts can look extra cool on our favorite OS. - Gordon Worley http://www.crosswinds.net/~orla_redbird/ mailto:orla_redbird@crosswinds.net From savageb@pacbell.net Tue Jan 4 07:40:23 2000 From: savageb@pacbell.net (savageb) Date: Mon, 03 Jan 2000 23:40:23 -0800 Subject: [Pythonmac-SIG] Win32 Python book In-Reply-To: Message-ID: > the time may be ripe for a MacPython book. I don't know if the time is ripe or not, but I am interested in something that deals more with mac-specific aspects of programming with Python. I don't have any experience with the mac toolbox so I shy away from most of the mac-specific modules. It would also be good to have someone run down the list of things someone might want to do with pointers indicating the best options available (like "If you wanna do database work on the mac here are your options...", and "You can't use thread but make sure you look into select", or whatever). Best to all in the New Year. Bob BTW, Since I live in the SF Bay area, I'll be going to MacWorld. If I see anything that seems relevant to Python, I'll report it back to the list by the end of the week. From jack@oratrix.nl Tue Jan 4 10:00:20 2000 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 04 Jan 2000 11:00:20 +0100 Subject: [Pythonmac-SIG] Win32 Python book In-Reply-To: Message by savageb , Mon, 03 Jan 2000 23:40:23 -0800 , Message-ID: <20000104100126.89216370CF2@snelboot.oratrix.nl> I would be more than happy to provide any and all support needed to someone who wants to write the book, but I definitely don't have the time to do it myself... -- 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 joel.reed@digitalswamp.net Tue Jan 4 10:42:41 2000 From: joel.reed@digitalswamp.net (Joel Reed) Date: Tue, 04 Jan 2000 03:42:41 -0700 Subject: [Pythonmac-SIG] MacPython post MacOS X... Message-ID: I am fairly new to Python and very new to "MacPython". With MacOSX (client/server[client-based]) coming fairly soon what is this going to mean for "MacPython"? If anything? My understanding of "MacPython" is that it is a port of the standard Unix Python with additional Mac extensions (AE. toolbox, etc.) Will Python on the Mac become "Standard Python" -> Unix (BSD based) with "Python Mac extensions" -> Carbon/Classic based. Or will it be a duplicate distribution Unix/BSD distro keeps to itself and MacPython keeps to itself? It seems with respect to some of the current threads on this list it would be beneficial to have the standard stuff based in the Unix/BSD environment and the Mac extensions carbon based, seeing as how Python complies pretty much out of the box on the current MacOS X Server. It seems then this would eliminate some of the CodeWarrior version headache. Maybe this isn't really an issue and I missed a boat somewhere? I'm fairly new to the list and I'm sorry if this issue has already been raised. Joel Reed -- -= joel d. reed =- email :::... joel.reed@digitalswamp.net ...::: www :::... http://www.digitalswamp.net ...::: im :::... joeldreed ...::: From jack@oratrix.nl Tue Jan 4 11:14:27 2000 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 04 Jan 2000 12:14:27 +0100 Subject: [Pythonmac-SIG] MacPython post MacOS X... In-Reply-To: Message by Joel Reed , Tue, 04 Jan 2000 03:42:41 -0700 , Message-ID: <20000104111428.3A40D370CF2@snelboot.oratrix.nl> > I am fairly new to Python and very new to "MacPython". With MacOSX > (client/server[client-based]) coming fairly soon what is this going to mean > for "MacPython"? If anything? My understanding of "MacPython" is that it is > a port of the standard Unix Python with additional Mac extensions (AE. > toolbox, etc.) Will Python on the Mac become "Standard Python" -> Unix (BSD > based) with "Python Mac extensions" -> Carbon/Classic based. Or will it be a > duplicate distribution Unix/BSD distro keeps to itself and MacPython keeps > to itself? My feeling is that indeed the MaxOSXPython core will be based on standard Unix Python with toolbox modules added. Initially there will probably be both an MacOSXPython and MacPython, of which the latter will run on both OSX and MacOS<=9 and the former only on OSX, and eventually the old MacPython will probably fade away. Most of the lib stuff (and probably some of the core stuff, depending on how things like preference files are solved in MOSX, in the unix or the mac way). > It seems with respect to some of the current threads on this list it would > be beneficial to have the standard stuff based in the Unix/BSD environment > and the Mac extensions carbon based, seeing as how Python complies pretty > much out of the box on the current MacOS X Server. It seems then this would > eliminate some of the CodeWarrior version headache. There isn't really all that much of a headache, it's more of a feature really (as I seem to keep stressing all the time). Compare this to the Linux situation, where your Python will appear to run but suddenly act mysteriously or die because you happen to have a different glibc version than what Python was compiled with. Not to mention Windows, where the situation is lots lots worse because there are numerous libraries on which PythonWin depends. Whether this feature survives the MacOSX transition I don't know. If MacOSX's binary format is PEF-based it probably will, if it is XCOFF-based or something else it probably won't. -- 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 robin@alldunn.com Fri Jan 7 04:51:18 2000 From: robin@alldunn.com (Robin Dunn) Date: Thu, 6 Jan 2000 20:51:18 -0800 Subject: [Pythonmac-SIG] Mac version of wxPython? References: <200001061700.JAA15706@smtp2.jps.net> <3874E1E7.1CA2B8A5@jps.net> <01cc01bf587b$defa71c0$1a25d2d1@jenkondev.com> <387530EE.456591C0@jps.net> Message-ID: <007701bf58ca$d7a29de0$0301a8c0@easystreet.com> > > By the way, Robin, since you brought up the Mac, and have been talking > about money, what do you suppose it would cost for you to produce (and > support) a Mac version of wxPython? Okay, Let me open up this "race" to everybody. The first person or company to deliver to my doorstep a PowerMac (used is okay) powerful enough for software development, and appropriate compiler and other software tools will win the following prizes: My undying gratitude and a 1 year full support contract once the Mac version is in a usable state. Drivers, start your engines! -- Robin Dunn Software Craftsman robin@AllDunn.com http://AllDunn.com/robin/ http://AllDunn.com/wxPython/ Check it out! From giorgio@dimi.uniud.it Fri Jan 7 17:52:54 2000 From: giorgio@dimi.uniud.it (Giorgio Brajnik) Date: Fri, 7 Jan 2000 18:52:54 +0100 (MET) Subject: [Pythonmac-SIG] [Q] how to disable stderr/stdout console? In-Reply-To: message from Jack Jansen on Fri, 31 Dec 1999 16:21:48 +0100 Message-ID: <200001071752.SAA02998@ten.dimi.uniud.it> Hi. I did some quick & dirty experimentations and found out that my problems disappeared when I rebuild the pythoncore lib. after commenting out a line of code in the CWGUSI, and specifically: in file GUSIDispatch.cp the line containing GUSISetup() of the SIOUX sockets With this change the python interpreter does not work any more by itself (but the pytghon IDE does), and when you embed python in a mac application built with MacApp you don't get any unwanted interefernce in focus and events control. Thanks to everybody (and especially to Jack) for the support. 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 Andrew@TheSoftwareSmith.Com.Au Sat Jan 8 00:58:01 2000 From: Andrew@TheSoftwareSmith.Com.Au (Andrew Smith) Date: Sat, 8 Jan 2000 11:58:01 +1100 Subject: [Pythonmac-SIG] Mac Python & PostgreSQL? Message-ID: Hi, Is there a module (such as Pygres) for interfacing Mac Python to the PostgreSQL DBMS? Would prefer to use PostgreSQL rather than m*SQL if possible. If no one is working on such a beast I'd be willing to attempt porting the psql client library and pygres myself. Alternatively can it be done using JPython? Does anyone have experience of using Python to build (cross platform) thin clients for database access (as opposed to using a web browser and php server side scripts)? Cheers, Andrew Smith The Software Smith: Custom Databases for Macintosh, Windows and Linux From savageb@pacbell.net Sun Jan 9 00:52:13 2000 From: savageb@pacbell.net (savageb) Date: Sat, 08 Jan 2000 16:52:13 -0800 Subject: [Pythonmac-SIG] No big news from MacWorld Message-ID: Well, I went to MacWorld, and from a python perspective was not able to find anything out. I didn't find anyone to talk to about Darwin, and although there were announcements made about MacOSX's new User Interface (worth checking out if you haven't already http://www.apple.com/ ) there was noone available to ask questions of. An okay MacWorld, the MOSX GUI was beautiful, and there was a demonstration of applications that had not been updated for carbon and that had been updated that both seemed to work fine, but that's not big news either. I've sent email to one of the new outside developers that was added to the Darwin team, indicating that there is interest in a Python port that includes shared libraries and threads (that would preferably be included in the default install), but never got any word back from him. Guess we'll have to wait for more information (May is WWDC, and "Spring" was given as the final beta's target -- after that maybe MacWorld NY as "Summer" was give as the ship date). my best to all... Bob From jack@oratrix.nl Mon Jan 10 20:53:57 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 10 Jan 2000 21:53:57 +0100 Subject: [Pythonmac-SIG] Re: Macintosh Python In-Reply-To: Message by Benjamin Schollnick , Sun, 09 Jan 2000 11:23:59 -0500 , <3878B61F.7D6BE6E@rochester.rr.com> Message-ID: <20000110205402.95961EDD20@oratrix.oratrix.nl> Folks, can anyone help Benjamin with a date/time setting routine? I assume it can be done with calldll, but I'm not familiar with the date and time APIs, so if it needs to be a standard module (and noone feels inclined to build a C wrapper around it) please tell me where to look. Recently, Benjamin Schollnick said: > I'm working on the latest version of the Python Time Server, > http://sourceforge.net/project/?group_id=1112, > and the next step is to add support for the Macintosh, both in > text/console mode and GUI (Tkinter)..... > > Now, I perfectly admit, even though I admin the Mac's at work I > haven't had a chance to go through the > Mac library documentation..... Sorry, otherwise I probably wouldn't have > to bother you.... > > But is their a documented method to change the Date/Time in > MacPython? If not, can I petition to have > some method added? Yet alone, is it even possible for it to work, after > all normally you have to go thru the > control panels...... > > Any reply or pointers you can give me would be appreciated..... Now > I get to really learn tkinter because I'll > be making a GUI front end..... >g< > > - Benjamin > > -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From joe@strout.net Mon Jan 10 23:02:39 2000 From: joe@strout.net (Joseph J. Strout) Date: Mon, 10 Jan 2000 15:02:39 -0800 Subject: [Pythonmac-SIG] Re: Macintosh Python In-Reply-To: <20000110205402.95961EDD20@oratrix.oratrix.nl> References: <20000110205402.95961EDD20@oratrix.oratrix.nl> Message-ID: At 9:53 PM +0100 1/10/00, Jack Jansen wrote: >can anyone help Benjamin with a date/time setting routine? I assume it >can be done with calldll, but I'm not familiar with the date and time >APIs, so if it needs to be a standard module (and noone feels inclined >to build a C wrapper around it) please tell me where to look. One call: void SetDateTime(long secs); ...where 'secs' is the usual seconds since 1/1/1904. This should be in OSUtils.h. Cheers, -- Joe ,------------------------------------------------------------------. | Joseph J. Strout Biocomputing -- The Salk Institute | | joe@strout.net http://www.strout.net | `------------------------------------------------------------------' From PClaerhout@CREO.BE Tue Jan 11 16:31:45 2000 From: PClaerhout@CREO.BE (Pieter Claerhout) Date: Tue, 11 Jan 2000 17:31:45 +0100 Subject: [Pythonmac-SIG] Compiling Python modules using MPW Message-ID: <2B1262E83448D211AE4B00A0C9D61B03BA704B@MSGEURO1> Hello, are there any instructions on how to compile Python modules using Macintosh Programmers Workshop (if that is possible of course)? Has anyone did this before? Kind regards, Pieter Pieter Claerhout - PClaerhout@creo.be Response Center - Applications Support Creo Europe - Excelsiorlaan 21 - 1930 Zaventem - Belgium Tel: +32 (2) 711 14 00 - Fax: +32 (2) 720 96 71 From PClaerhout@CREO.BE Tue Jan 11 16:34:22 2000 From: PClaerhout@CREO.BE (Pieter Claerhout) Date: Tue, 11 Jan 2000 17:34:22 +0100 Subject: [Pythonmac-SIG] Python and RealBasic Message-ID: <2B1262E83448D211AE4B00A0C9D61B03BA704C@MSGEURO1> Hello, Has anyone ever used Python in conjunction with RealBasic? I was perfectly able to include the PythonCore lib in my project, but now, I need to define entry points in there? I tried some, but I couldn't get it to work? Any suggestions? Kind regards, Pieter Pieter Claerhout - PClaerhout@creo.be Response Center - Applications Support Creo Europe - Excelsiorlaan 21 - 1930 Zaventem - Belgium Tel: +32 (2) 711 14 00 - Fax: +32 (2) 720 96 71 From jhrsn@pop.pitt.edu Tue Jan 11 18:00:41 2000 From: jhrsn@pop.pitt.edu (Jim Harrison) Date: Tue, 11 Jan 2000 13:00:41 -0500 Subject: [Pythonmac-SIG] Python and RealBasic In-Reply-To: <2B1262E83448D211AE4B00A0C9D61B03BA704C@MSGEURO1> Message-ID: on 1/11/00 11:34 AM, Pieter Claerhout at PClaerhout@CREO.BE wrote: > Has anyone ever used Python in conjunction with RealBasic? There is a somewhat quirky effort to create an IDE with a visual interface builder for python on the Mac, using REALbasic. Information is at . Jim Harrison University of Pittsburgh From jack@oratrix.nl Wed Jan 12 09:56:29 2000 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 12 Jan 2000 10:56:29 +0100 Subject: [Pythonmac-SIG] SIG update on Python conference Message-ID: <20000112095630.26C2836E440@snelboot.oratrix.nl> Folks, I'm not going to the Python conference, but if someone else does, and is interested in telling what we've been up to the last year: please contact Barry. ------- Forwarded Message From: bwarsaw@python.org (Barry Warsaw) Subject: [List-Owners] SIG updates Dear SIG admins, We will have some time in the morning session on Developers Day http://www.python.org/workshops/2000-01/devday.html for SIG progress reports. I've got 4 volunteers already, and about 90 minutes to fill, so I'd like to know if any of you would like to give about a 10 minute update on the progress of your SIG. Please email me if you'd like to reserve a spot in the morning session, or if you have any other questions. If you aren't coming to the conference, please send a message to your SIG to see if any of the participants would like to give the update. ------- End of Forwarded Message From p.agapow@ic.ac.uk Thu Jan 13 09:14:25 2000 From: p.agapow@ic.ac.uk (Paul-Michael Agapow) Date: Thu, 13 Jan 2000 09:14:25 +0000 Subject: [Pythonmac-SIG] Embedding on Mac (recently?) Message-ID: Has anyone embedded Python as an internal scripting language in a Mac application recently? There was some traffic on the list about this exact issue but that was quite some time ago. I've got a simulation package (macro-evolution for those that are interested) that I'd like users to be able to program up scenarios for and Python seems like the tool of choice. Any available examples or source code? Thanks p-m -- Paul-Michael Agapow (p.agapow@ic.ac.uk), Dept. Biology, Imperial College From just@letterror.com Thu Jan 13 11:39:27 2000 From: just@letterror.com (Just van Rossum) Date: Thu, 13 Jan 2000 12:39:27 +0100 Subject: [Pythonmac-SIG] Embedding on Mac (recently?) In-Reply-To: Message-ID: At 9:14 AM +0000 13-01-2000, Paul-Michael Agapow wrote: >Has anyone embedded Python as an internal scripting language in a Mac >application recently? I have a big C project which embeds MacPython. But I must admit that I'm not up-to-date with the CVS tree, but am using a version slightly newer than 1.5.2c. >There was some traffic on the list about this exact >issue but that was quite some time ago. I've got a simulation package >(macro-evolution for those that are interested) that I'd like users to be >able to program up scenarios for and Python seems like the tool of choice. >Any available examples or source code? Look at the Extending & embedding doco, as well as the C/C++ API reference. Both are available at http://www.python.org/doc/. The easiest setup for embedding MacPython is to build upon a standard distribution. This takes almost nothing: include PythonCore shared lib in your project, plus possibly some of the preferences resources. All set! You don't even need the source distribution to do this, just make sure you installed the dev-kit. This is very easy from a developers' standpoint, but it's not so great for end users, since they'll be confronted with installing Python and the headaches that may arise when that goes wrong... So in the end it might be better to include the Python interpreter statically, which I've also done in the past, by compiling Python as a static library from the source. The PythonCore CW project files or the Standalone project files could be used as an example. Shouldn't be too hard either, althought it definitely takes more effort than the shared lib method. Hope this helps, Just From jack@oratrix.nl Thu Jan 13 12:08:56 2000 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 13 Jan 2000 13:08:56 +0100 Subject: [Pythonmac-SIG] Embedding on Mac (recently?) In-Reply-To: Message by Just van Rossum , Thu, 13 Jan 2000 12:39:27 +0100 , Message-ID: <20000113120858.E8F2736E440@snelboot.oratrix.nl> There's one issue you have to think of when embedding macPython: you have to call PyMac_Initialize in stead of Py_Initialize. This is documented somewhere, but I can't remember where, right this moment, so I thought I'd mention it. -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From baked@attglobal.net Fri Jan 14 02:52:00 2000 From: baked@attglobal.net (Paul Baker) Date: Thu, 13 Jan 2000 18:52:00 -0800 Subject: [Pythonmac-SIG] Best Way to Copy Resource Fork Data? Message-ID: <4.2.2.20000113183717.00ad7a28@pop5.attglobal.net> I'm looking for suggestions on the best way to copy the resource fork data from one file to another. Currently, I am using the following (in a nutshell): file1 = ('Macintosh HD:TEST.EPS') file2 = ('Macintosh HD:TEST2.EPS') x = MacOS.openrf(file2, 'w') y = MacOS.openrf(file1, 'w') input = y.read(1000000) # <---- This is the problem part! x.write(input) x.close y.close If I do the following for the problem line: input = y.read() then I get a the following TypeError: TypeError: function requires exactly 1 argument; 0 given I'm pretty new to Python and this is my first attempt at using it on a Mac so I'm sure there is a better way to do this (I hope!). Any help will be greatly appreciated. Thanks Paul From jack@oratrix.nl Fri Jan 14 10:17:50 2000 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 14 Jan 2000 11:17:50 +0100 Subject: [Pythonmac-SIG] Best Way to Copy Resource Fork Data? In-Reply-To: Message by Paul Baker , Thu, 13 Jan 2000 18:52:00 -0800 , <4.2.2.20000113183717.00ad7a28@pop5.attglobal.net> Message-ID: <20000114101750.6C6A136E440@snelboot.oratrix.nl> > file1 = ('Macintosh HD:TEST.EPS') > file2 = ('Macintosh HD:TEST2.EPS') > x = MacOS.openrf(file2, 'w') > y = MacOS.openrf(file1, 'w') > > input = y.read(1000000) # <---- This is the problem part! > x.write(input) Well, you're mixing up your x'es, y's and open everything with "w" mode... The following should work: x = MacOS.openrf(file1, "rb") y = MacOS.openrf(file2, "wb") while 1: data = x.read(100000) if not data: break y.write(data) The rb/wb aren't strictly needed, r/w is ok, but this is clearer from a documentation point of view. Resource forks don't support reads without argument (too difficult to implement), hence the loop. And you might also want to look in the macostools module, if you're trying to copy both forks of a file there's a routine in there that already does this, and it also copies the relevant parts of the finder info, etc. -- 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 Jan 14 23:26:12 2000 From: managan@llnl.gov (Rob Managan) Date: Fri, 14 Jan 2000 15:26:12 -0800 Subject: [Pythonmac-SIG] DistUtils Message-ID: If anyone is looking for a project to fill their spare time you might consider porting the distutils project to the Mac. It is a python utility to uniformly install packages and modules. Now that CodeWarrior has an XML based project file we should actually be able to implement this! *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan LLNL ph: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From cwebster@nevada.edu Sat Jan 15 19:07:04 2000 From: cwebster@nevada.edu (Corran Webster) Date: Sat, 15 Jan 2000 11:07:04 -0800 Subject: [Pythonmac-SIG] Compiling Python modules using MPW In-Reply-To: <2B1262E83448D211AE4B00A0C9D61B03BA704B@MSGEURO1> Message-ID: At 5:31 PM +0100 11/1/00, Pieter Claerhout wrote: > Hello, > > are there any instructions on how to compile Python modules > using Macintosh Programmers Workshop (if that is possible > of course)? Has anyone did this before? There was a discussion about this some months back - I have had a considerable amount of success, but there is a possibility of conflicts between the MPW and CodeWarrior libraries (I haven't encountered any, but that doesn't mean they aren't there). I wrote up a HOWTO which you can find at: http://www.nevada.edu/~cwebster/Python/MPWHOWTO/MPWHOWTO.html This should be more than enough to get you started. Let me know if you find it helpful. Best regards, Corran From jack@oratrix.nl Sat Jan 15 22:31:49 2000 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 15 Jan 2000 23:31:49 +0100 Subject: [Pythonmac-SIG] MacPython on Japanese MacOS not reacting to double-clicked docs Message-ID: <20000115223154.2055CEDD20@oratrix.oratrix.nl> In the continuing saga of trying to find out why some Japanese MacPython users have a problem that double-clicking a Python script does launch the interpreter, but doesn't start the script I have a new idea, prompted by Noboru Yamamoto: maybe the finder sends a different AppleEvent than the standard "Open Document" or "Open Application", or an additional one. This could well confuse code that builds argv, which would result in the observed behaviour. Does anyone happen to know whether this could be the case? Alternatively, could someone who has a system that exhibits the problem modify a copy of the MiniAEServer module to accept ****/**** appleevents, print all the incoming appleevents, turn the script into an applet and drop a file on it? -- Jack Jansen | ++++ stop the execution of Mumia Abu-Jamal ++++ Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++ www.oratrix.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm From jack@oratrix.nl Sat Jan 15 23:01:35 2000 From: jack@oratrix.nl (Jack Jansen) Date: Sun, 16 Jan 2000 00:01:35 +0100 Subject: [Pythonmac-SIG] DistUtils In-Reply-To: Message by Rob Managan , Fri, 14 Jan 2000 15:26:12 -0800 , Message-ID: <20000115230140.BDF28EDD20@oratrix.oratrix.nl> Recently, Rob Managan said: > If anyone is looking for a project to fill their spare time you might > consider porting the distutils project to the Mac. It is a python > utility to uniformly install packages and modules. Now that > CodeWarrior has an XML based project file we should actually be able > to implement this! Wow, I hadn't noticed the xml import/export yet! Another project I'd like done, probably smaller than porting distutils: a utility that generates the .prj file if you create a new extension module. Currently you have to take xxmodule.prj, and replace the name "xx" by your module name in about 6 places (2 target names, 2 resulting slb names, the source filename, the .exp filename, the initxx name in the .exp file, I think that's the lot), and this is too easy to get wrong. A simple script that asks for a module name and does this for you would be really handy. -- 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 seanh@unforgettable.com Sun Jan 16 20:31:12 2000 From: seanh@unforgettable.com (Sean Hummel ) Date: Sun, 16 Jan 2000 20:31:12 +0000 (GMT) Subject: [Pythonmac-SIG] Embedding on Mac (recently?) In-Reply-To: Message-ID: I actually did this a while back for my father. I wanted to write him a game which used python to control the sprites. This worked reasonably well, however I didn't ever figure out how to get an uncompiled python file to load, compile, and run. Instead I had to use a precompiled file for this purpose. I jsut basically took SpriteWorld and made Python plugins for each of the object types. Because Sprites, do much of their own thinking, and because the machines of today are so much faster, the fact that Python is pretty slow, didn't make much difference. On Thu, 13 Jan 2000, Paul-Michael Agapow wrote: > > Has anyone embedded Python as an internal scripting language in a Mac > application recently? There was some traffic on the list about this exact > issue but that was quite some time ago. I've got a simulation package > (macro-evolution for those that are interested) that I'd like users to be > able to program up scenarios for and Python seems like the tool of choice. > Any available examples or source code? > > Thanks > > p-m > > > -- > Paul-Michael Agapow (p.agapow@ic.ac.uk), Dept. Biology, Imperial College > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://www.python.org/mailman/listinfo/pythonmac-sig > From p.agapow@ic.ac.uk Mon Jan 17 17:25:04 2000 From: p.agapow@ic.ac.uk (Paul-Michael Agapow) Date: Mon, 17 Jan 2000 17:25:04 +0000 Subject: [Pythonmac-SIG] Embedding on Mac (recently?) In-Reply-To: <20000117170025.0722B1CE2F@dinsdale.python.org> Message-ID: Thanks to all those who replied to my plea on the above topic - I have a little hacking ahead of me. (Especially as I don't want to get the users to run Python to run my simulation. Easier for the developers as Just observes, but not so for the user. I suspect it would only cause more problems for me in the end.) Are there are any non-trivial programs with embedded Python about that the source is available for? I'm interested in the principles (approach) as much as the practice (syntax), so I can start thinking about how the C++ section should be styled. Thanks again p-m -- Paul-Michael Agapow (p.agapow@ic.ac.uk), Dept. Biology, Imperial College From just@letterror.com Mon Jan 17 17:38:05 2000 From: just@letterror.com (Just van Rossum) Date: Mon, 17 Jan 2000 18:38:05 +0100 Subject: [Pythonmac-SIG] Embedding on Mac (recently?) In-Reply-To: References: <20000117170025.0722B1CE2F@dinsdale.python.org> Message-ID: At 5:25 PM +0000 17-01-2000, Paul-Michael Agapow wrote: >Thanks to all those who replied to my plea on the above topic - I have a >little hacking ahead of me. (Especially as I don't want to get the users to >run Python to run my simulation. Easier for the developers as Just >observes, but not so for the user. I suspect it would only cause more >problems for me in the end.) Oh, another option might be to change your app embedding Python into a Python *extension*. Maybe all you have to is call you C main routine from a bootstrapping script. If you compile your stuff as shared libraries, you can use BuildApplication to turn it into a standalone executable. Easy to develop, and the user doesn't need to even know Python is used. Just From asymmetrik@yahoo.com Tue Jan 18 07:13:20 2000 From: asymmetrik@yahoo.com (erik ryerson) Date: Mon, 17 Jan 2000 23:13:20 -0800 (PST) Subject: [Pythonmac-SIG] how to select multiple files Message-ID: <20000118071320.25212.qmail@web1703.mail.yahoo.com> howdy, firstly i'm quite new to Python so i've probably just overlooked something already documented but i'll ask anyway. well i devoured the "Learning Python" book (yum) and have started moving my coding projects onto my mac but am having trouble adjusting the code to not operate on the command line. for instance, my favorite little sample program from the book was the mygrep.py program which i got to work on the mac in a very ugly and unmac-like way by using EasyDialogs (prompt for a pattern then prompt for a file to match the pattern in, then report either success or failure...then exit.)... i've expanded it, thanks to the InterslipControl examples (which themselves don't run since i'm running macos8.6 without interslip), and now i've got a little app window with a button that when pressed does the EasyDialogs routine mentioned above, but additionally prints the results to a message box in the app window. what i would like to be able to do (and my reason for writing in the first place), is to allow multiple files to be selected via something similar to a PromptGetFile dialog with a button to "Add" multiple files before clicking OK. Similar to how Fetch allows you to select multiple files to upload. if that's too complex to explain or would take months of ResEdit training, maybe a way to use GetDirectory to specify the path and then run the grep on all the text files in that directory would be best? either way i'd be happy with, both options of course would be ideal. i was able to get it to work on the command line on my windows machine by allowing *.txt using glob, but no matter how many ways i try it on the mac i can't get the same code to work. i hope i articulated this well. thanks in advance. erik __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com From jack@oratrix.nl Tue Jan 18 09:49:38 2000 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 18 Jan 2000 10:49:38 +0100 Subject: [Pythonmac-SIG] how to select multiple files In-Reply-To: Message by erik ryerson , Mon, 17 Jan 2000 23:13:20 -0800 (PST) , <20000118071320.25212.qmail@web1703.mail.yahoo.com> Message-ID: <20000118095030.000B436E440@snelboot.oratrix.nl> Erik, the next release of MacPython will have support for Navigation Services, and with that it's easy to do multiple selections. Until then it's probably going to be difficult, there used to be no standard MacOS dialog for multiple file selection, so everyone rolled their own. -- 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 dante@oz.net Thu Jan 20 05:28:32 2000 From: dante@oz.net (Dante) Date: Wed, 19 Jan 2000 21:28:32 -0800 Subject: [Pythonmac-SIG] PIL broken? Message-ID: I can't get MacPython to import PIL out of the box. The scripts in Python 1.5.2c1:Extensions:Imaging:Scripts: throw ImportError's whenever I run them. I deleted my python preferences and did a clean installation and I still get this. Macos 8.6 with plenty of RAM, the rest of python seems to work just fine (I've been using it for months.) Dante From fear@technologist.com Thu Jan 20 10:20:52 2000 From: fear@technologist.com (Chris Jacobson) Date: Thu, 20 Jan 2000 04:20:52 -0600 Subject: [Pythonmac-SIG] GUSI 2/etc Message-ID: <200001201020.FAA20405@pop02.iname.net> Has anyone tried building Python using GUSI 2 (the latest version is 2.0.4)? I'm working at it, and need to know about the .exp file: what needs to get exported... or more specifically, what SHOULDN'T be exported, that the .exp file is necessary? - Chris Jacobson From just@letterror.com Thu Jan 20 11:10:45 2000 From: just@letterror.com (Just van Rossum) Date: Thu, 20 Jan 2000 12:10:45 +0100 Subject: [Pythonmac-SIG] PIL broken? In-Reply-To: Message-ID: At 9:28 PM -0800 19-01-2000, Dante wrote: >I can't get MacPython to import PIL out of the box. The scripts in >Python 1.5.2c1:Extensions:Imaging:Scripts: throw ImportError's >whenever I run them. I deleted my python preferences and did a clean >installation and I still get this. > >Macos 8.6 with plenty of RAM, the rest of python seems to work just >fine (I've been using it for months.) I'm not sure if the right paths for PIL are in the default sys.path. Have you tried EditPythonPrefs? Just From jack@oratrix.nl Thu Jan 20 12:04:26 2000 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 20 Jan 2000 13:04:26 +0100 Subject: [Pythonmac-SIG] GUSI 2/etc In-Reply-To: Message by Chris Jacobson , Thu, 20 Jan 2000 04:20:52 -0600 , <200001201020.FAA20405@pop02.iname.net> Message-ID: <20000120120427.3316B36E440@snelboot.oratrix.nl> I have Python running with the new GUSI. Actually, I have it running with the new GUSI and with threading support! There are still a few problems that I'm currently trying to work out with Matthias Neeracher, the GUSI author: cleanup of GUSI crashes Python, and thread switching seems to be very slow. I'll check things into the CVS repository one of this weekend (assuming my expected-to-be-born-tomorrow-kid is a few days late:-). -- 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 Jan 20 12:13:20 2000 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 20 Jan 2000 13:13:20 +0100 Subject: [Pythonmac-SIG] GUSI 2/etc In-Reply-To: Message by Chris Jacobson , Thu, 20 Jan 2000 04:20:52 -0600 , <200001201020.FAA20405@pop02.iname.net> Message-ID: <20000120121320.4581336E440@snelboot.oratrix.nl> > I'm working at it, and need to know about the .exp file: what needs to > get exported... or more specifically, what SHOULDN'T be exported, that > the .exp file is necessary? Sorry, I got carried away and I didn't answer this question:-) It _may_ be safe to build PythonCore with "export everything" in stead of the .exp file nowadays. There are a number of routines that should be included in every fragment: setjmp, __initialize, a few more. Many revisions of CodeWarrior ago the only way to ensure these weren't loaded from a shared library was to not export them from that library. I think, however, that the current CodeWarrior linker somehow knows about these magic routines (or somehow they're defined in such a way that they can't be exported). I'd say: try it, and let us know the result. Let me think.... the "img" modules use setjmp/longjmp for their error handling. If you pass a garbage file to "imgpbm" and you don't get a crash you're fine:-) -- 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 Benjamin.Schollnick@usa.xerox.com Thu Jan 20 16:28:23 2000 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Thu, 20 Jan 2000 11:28:23 -0500 Subject: [Pythonmac-SIG] Setting Time & Date on a Macintosh Message-ID: <8B049D471C61D111847C00805FA67B1C029D0EFF@usa0129ms1.ess.mc.xerox.com> Hello Folks! I'm trying to work with CALLDLL in regards to setting the time/date on the Macintosh's as part of my Time Server & Time Client package. Here's the situation. CallDLL Appears to (at least in the v1.52 release) only allow INTEGERS, and not a LONGINT. The time/date value I need to be able to use is a LONGINT, which does not conventially allow conversion to a INTEGER. So, right now, I can set a date up to Jan 13, 1972 @ 3:14AM, but nothing later >grin< Does anyone have a suggestion around this little problem? I don't have a C compiler, so I can't make my own extension to python..... I've tried using STRUCT to convert the longint into a unsigned Integer, but Python seems to see unsigned AS LONGINTs.....(Or at least CALLDLL reported that the LONGINT was too long to be converted......) - Benjamin From jack@oratrix.nl Thu Jan 20 16:41:50 2000 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 20 Jan 2000 17:41:50 +0100 Subject: [Pythonmac-SIG] Setting Time & Date on a Macintosh In-Reply-To: Message by "Schollnick, Benjamin" , Thu, 20 Jan 2000 11:28:23 -0500 , <8B049D471C61D111847C00805FA67B1C029D0EFF@usa0129ms1.ess.mc.xerox.com> Message-ID: <20000120164151.379C736E440@snelboot.oratrix.nl> > Hello Folks! > > I'm trying to work with CALLDLL in regards to setting > the time/date on the Macintosh's as part of my Time Server & Time Client > package. > > Here's the situation. > > CallDLL Appears to (at least in the v1.52 release) only allow > INTEGERS, and > not a LONGINT. Hmm, never thought of that. Could you try passing two INT arguments in the place of the single LONGINT, and putting the top half of the value in the first one and the bottom half in the second one? Or possibly the other way around? And could you tell us either (a) it worked or (b) you got spectacular crashes? -- 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 savageb@pacbell.net Thu Jan 20 18:07:16 2000 From: savageb@pacbell.net (Bob Savage) Date: Thu, 20 Jan 2000 10:07:16 -0800 Subject: [Pythonmac-SIG] GUSI (background question) In-Reply-To: <20000120120427.3316B36E440@snelboot.oratrix.nl> Message-ID: Hi, all, Well, at this time i doubt that i will ever be much use to the collective effort to develop MacPython, but could anyone explain briefly what GUSI is? i guess it is a library that is being used, and Jack mentioned Thread support, so i guess it is at a fairly low level. No need to knock yourselves out over this one, i just want to understand better what is going on on the list, and this has come up quite a lot these past few months. thx, bob From seanh@unforgettable.com Thu Jan 20 17:39:49 2000 From: seanh@unforgettable.com (Sean Hummel ) Date: Thu, 20 Jan 2000 17:39:49 +0000 (GMT) Subject: [Pythonmac-SIG] GUSI 2/etc In-Reply-To: <20000120121320.4581336E440@snelboot.oratrix.nl> Message-ID: I know this is a bit off topic, but can someone post the URL to GUSI 2? On Thu, 20 Jan 2000, Jack Jansen wrote: > > > I'm working at it, and need to know about the .exp file: what needs to > > get exported... or more specifically, what SHOULDN'T be exported, that > > the .exp file is necessary? > > Sorry, I got carried away and I didn't answer this question:-) > > It _may_ be safe to build PythonCore with "export everything" in stead of the > .exp file nowadays. There are a number of routines that should be included in > every fragment: setjmp, __initialize, a few more. Many revisions of > CodeWarrior ago the only way to ensure these weren't loaded from a shared > library was to not export them from that library. I think, however, that the > current CodeWarrior linker somehow knows about these magic routines (or > somehow they're defined in such a way that they can't be exported). > > I'd say: try it, and let us know the result. Let me think.... the "img" > modules use setjmp/longjmp for their error handling. If you pass a garbage > file to "imgpbm" and you don't get a crash you're fine:-) > -- > 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 dante@oz.net Thu Jan 20 20:56:04 2000 From: dante@oz.net (Dante) Date: Thu, 20 Jan 2000 12:56:04 -0800 Subject: [Pythonmac-SIG] PIL broken? In-Reply-To: References: Message-ID: >At 9:28 PM -0800 19-01-2000, Dante wrote: > >I can't get MacPython to import PIL out of the box. The scripts in > >Python 1.5.2c1:Extensions:Imaging:Scripts: throw ImportError's > >whenever I run them. I deleted my python preferences and did a clean > >installation and I still get this. > >I'm not sure if the right paths for PIL are in the default sys.path. Have >you tried EditPythonPrefs? Yes, silly me. adding $(PYTHON):Extensions:Imaging:PIL fixed the problem. I deleted my python preferences again and reinstalled just to make sure I wasn't seeing things. Shouldn't this be in the path of the PythonInterpreter by default? Dante From chriss@dnastar.com Thu Jan 20 21:01:30 2000 From: chriss@dnastar.com (chriss@dnastar.com) Date: Thu, 20 Jan 2000 15:01:30 -0600 Subject: [Pythonmac-SIG] GUSI (background question) Message-ID: <20000120150130.008410@artemis.dnastar.com> On Thu, Jan 20, 2000, Bob Savage wrote: GUSI - Matthias Neeracher's ( http://www.iis.ee.ethz.ch/~neeri) Grand Unified Socket Interface - is replacement for part of Metrowerks Standard Libarary. It provides more unix-like implementations of many standard 'C' libarary funtions, which makes porting unix programs easyer; but its biggest features are socket and pthread emulation. A 'socket' is basicly a file discriptor that refers to a network connection, insted of an open file. int file, sock; file = open("Bob's Mac:yofile); sock = socket(....); // it's more complicated to set up a socket than a normal fd. connect( ); // but once you do you can use them in much the same way. read(file,..); read(sock,..); In the new GUSI2 whenever an operation cannot be conpleted immeadiatly, e.g. a read() is waiting for the network or disk, GUSI switches to another thread (assuming of course that there are more threads) that can make progress. MacPython has used GUSI for some time but GUSI_2's main enhansement is thread support. Jack apparently has a working version of MacPython that works with GUSI_2, but there are some performance issues with thread switching. I've also been woring on MacPython/GUSI2 but somehow introduced a crash on exit that I've never benn able to track down. (But why would you ever quit python) Christopher Stern DNAStar,1228 South Park Madison, WI 53715-2102, USA ph: 608.258.7420 ext. 25 From jack@oratrix.nl Thu Jan 20 22:08:14 2000 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 20 Jan 2000 23:08:14 +0100 Subject: [Pythonmac-SIG] GUSI (background question) In-Reply-To: Message by chriss@dnastar.com , Thu, 20 Jan 2000 15:01:30 -0600 , <20000120150130.008410@artemis.dnastar.com> Message-ID: <20000120220819.64F95EDD20@oratrix.oratrix.nl> Recently, chriss@dnastar.com said: > > I've also been woring on MacPython/GUSI2 but somehow introduced a crash > on exit that > I've never benn able to track down. (But why would you ever quit python) Some GUSI data structures are freed twice, it seems. Turning off the malloc-debug switch during Python compilation will mask the problem (MacPython is usually compiled with malloc debug, which fills free()d blocks with 0x2a (42 in decimal:-) so that accessing memory after you've freed it will result in quick death (and detection). I'll check my changes into CVS, but so far I've only adapted PythonStandSmall. I'm stil undecided on how to do thread support for the "real" shared Python, because if you want to import a dynamically loaded module it has to be compiled the same way (threading/non-threading) as the core. So, you can again give your feedback on the following choices, or come up with something else: - Make threaded the only option, that is, from the next release on extension modules, etc. will assume threading is on. - Make threading optional, and differentiate through the core shared library name: PythonCore for non-threaded, PythonThreadedCore for threaded. This may however result in problems if you have both on your system. - Make threading optional and somehow distinguish between a threaded and non-threaded PythonCore through a magic symbol exported, or the PY_API_VERSION flag, or some such. - Don't worry about incompatability, so modules compiled for the wrong model will cause spectacular crashes upon import:-) -- 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 just@letterror.com Thu Jan 20 22:56:01 2000 From: just@letterror.com (Just van Rossum) Date: Thu, 20 Jan 2000 23:56:01 +0100 Subject: [Pythonmac-SIG] GUSI (background question) In-Reply-To: <20000120220819.64F95EDD20@oratrix.oratrix.nl> References: Message by chriss@dnastar.com , Thu, 20 Jan 2000 15:01:30 -0600 , <20000120150130.008410@artemis.dnastar.com> Message-ID: At 11:08 PM +0100 20-01-2000, Jack Jansen wrote: >- Don't worry about incompatability, so modules compiled for the wrong >model will cause spectacular crashes upon import:-) Hm, I was rather happy about the project changes we made for 1.5.2 so that extension modules don't need to be recompiled for each new version. I would hate to see extensions compiled for 1.5.2c break in the next version. But if it's unavoidable, so be it. Anyhow, crashing should be avoided at all cost: this is Python after all ;-) Just From chriss@dnastar.com Fri Jan 21 03:12:32 2000 From: chriss@dnastar.com (chriss@dnastar.com) Date: Thu, 20 Jan 2000 21:12:32 -0600 Subject: Re(2): [Pythonmac-SIG] GUSI (background question) In-Reply-To: <20000120220819.64F95EDD20@oratrix.oratrix.nl> Message-ID: <20000120211232.028777@artemis.dnastar.com> On Thu, Jan 20, 2000, Jack Jansen wrote: >Some GUSI data structures are freed twice, it seems. Turning off the >malloc-debug switch during Python compilation will mask the problem >(MacPython is usually compiled with malloc debug, which fills free()d >blocks with 0x2a (42 in decimal:-) so that accessing memory after >you've freed it will result in quick death (and detection). We must have things put together alittle differently, I've flaming out on every exit, even after replacing your BSD Malloc with MSL's. By the way what I have is also PythonStandalone - no dll's isues yet. Christopher Stern DNAStar,1228 South Park Madison, WI 53715-2102, USA ph: 608.258.7420 ext. 25 From Benjamin.Schollnick@usa.xerox.com Fri Jan 21 14:06:58 2000 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Fri, 21 Jan 2000 09:06:58 -0500 Subject: [Pythonmac-SIG] Setting Time & Date on a Macintosh Message-ID: <8B049D471C61D111847C00805FA67B1C029D0F06@usa0129ms1.ess.mc.xerox.com> Jack, Here's the scoop.... If I break every rule that I can think of it works....>g< Here's the code I'm using, feel free to point out any mistakes. Here's my notes: 1) I suspect there is a error in the HI/LO conversion, because I am being forced to add 86400, otherwise I lose a day (exactly 24 hrs per attempt). 2) I'd like to petition for the addition of LONGINT (or equivalent) into CALLDLL. This method will work, but I suspect sooner or later a oddball value will break this. # # Test calldll. Tell the user how often menus flash, and let her change it. # import calldll import struct import sys import time epoch = 2208988800L macadjustment = 126230400 OSUtils = calldll.getlibrary('InterfaceLib') setmacdatetime = calldll.newcall(OSUtils.SetDateTime, 'None', 'InLong', 'InLong') tempval = long(time.time())-macadjustment tempval = int(tempval - 0x100000000L) lo = int(tempval & 0xffffffff) + 86400 hi = int((tempval >> 32) & 0xffffffff) setmacdatetime (lo, hi) sys.exit(1) # So the window stays on-screen - Benjamin From just@letterror.com Fri Jan 21 15:11:34 2000 From: just@letterror.com (Just van Rossum) Date: Fri, 21 Jan 2000 16:11:34 +0100 Subject: [Pythonmac-SIG] Setting Time & Date on a Macintosh Message-ID: At 9:06 AM -0500 21-01-2000, Schollnick, Benjamin wrote: [ ... ] >setmacdatetime = calldll.newcall(OSUtils.SetDateTime, 'None', 'InLong', >'InLong') [ ... ] Isn't the only problem that SetDateTime() wants an unsigned long instead of a signed long (like Python ints are)? In that case you could write something like (untested): import calldll InterfaceLib = calldll.getlibrary('InterfaceLib') _SetDateTime = calldll.newcall(InterfaceLib.SetDateTime, 'None', 'InLong') def SetDateTime(t): # 't' may be a normal int or a Python LongInt, but it should be # within range(0, 0x100000000) if t > 0x7fffffff: # sys.maxint # make the bit pattern for an unsigned, but stuff # it into a signed int t = int(t - 0x100000000L) _SetDateTime(t) Just From Benjamin.Schollnick@usa.xerox.com Fri Jan 21 16:27:12 2000 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Fri, 21 Jan 2000 11:27:12 -0500 Subject: [Pythonmac-SIG] Totally silly question (RE: FREEZE) Message-ID: <8B049D471C61D111847C00805FA67B1C029D0F0D@usa0129ms1.ess.mc.xerox.com> Folks, Silly question..... I've used freeze on the PC, or at least tried to, I switched to "INSTALLER" instead....Works alot better.... But does FREEZE work on the mac without modifications? Is there anything special that needs to be configured for FREEZE to work on the mac? Do you need a compilier for the final product on the Mac? - Benjamin From just@letterror.com Fri Jan 21 23:01:25 2000 From: just@letterror.com (Just van Rossum) Date: Sat, 22 Jan 2000 00:01:25 +0100 Subject: [Pythonmac-SIG] Totally silly question (RE: FREEZE) Message-ID: At 11:27 AM -0500 21-01-2000, Schollnick, Benjamin wrote: >Folks, > > Silly question..... > > I've used freeze on the PC, or at least tried to, I switched to >"INSTALLER" instead....Works alot better.... > > But does FREEZE work on the mac without modifications? Is there >anything special that needs to > be configured for FREEZE to work on the mac? Do you need a >compilier for the final product on the > Mac? There's macfreeze, which needs a compiler, and there's BuildApplication, which doesn't. BuildApplication is a higher level layer on top of macfreeze, which in turn is a layer on top of freeze. Just From lwoestman@proaxis.com Sat Jan 22 02:36:31 2000 From: lwoestman@proaxis.com (Larry Woestman) Date: Fri, 21 Jan 2000 18:36:31 -0800 Subject: [Pythonmac-SIG] problems installing python 1.5.2 on Mac OS 8.6 In-Reply-To: <20000121170029.B22F71D099@dinsdale.python.org> Message-ID: <3.0.6.32.20000121183631.007a2cd0@proaxis.com> Help! I can't get the Macintosh version of Python 1.5.2c1 to install on my Imac running MacOS 8.6. It installs without obvious complaints but fails to run the ConfigurePython program. It just "flashes" on the screen with no other output. When I try to run Pysol 3.10 (I know, but it was an easy-to-find python program) it fails with a "Pysol cannot find the standard Python libraries. Please check your installation.". I have tried installing with extensions turned off. I have downloaded another copy with the same results. I have searched the Python email archives without success. Any pointers would be appreciated. Thank You Larry Woestman From jack@oratrix.nl Sat Jan 22 22:51:32 2000 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 22 Jan 2000 23:51:32 +0100 Subject: [Pythonmac-SIG] problems installing python 1.5.2 on Mac OS 8.6 In-Reply-To: Message by Larry Woestman , Fri, 21 Jan 2000 18:36:31 -0800 , <3.0.6.32.20000121183631.007a2cd0@proaxis.com> Message-ID: <20000122225138.7F2EAEDD20@oratrix.oratrix.nl> Recently, Larry Woestman said: > I can't get the Macintosh version of Python 1.5.2c1 to install on my Imac run > ning MacOS 8.6. It installs without obvious complaints but fails to run the > ConfigurePython program. It just "flashes" on the screen with no other output > . When I try to run Pysol 3.10 (I know, but it was an easy-to-find python pr > ogram) it fails with a "Pysol cannot find the standard Python libraries. Ple > ase check your installation.". Hmm. There have been a few complaints about the 1.5.2 installer not working, but so far they've all been from people running a Japanese MacOS. So, I think you have a different problem. Could you try removing _everything_ with "python" in the name from your system folder and then running ConfigurePython again? If that fails again, please start Python and tell me what sys.path is. Also, the output from Apple System Profile could be handy. The symptoms you give are usually caused because Python can't find its home location (i.e. the folder where it lives). This is most often called by an old, incorrect, preference file. There are other possibilities, though, like having two disks with the same name. -- 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 just@letterror.com Sat Jan 22 23:24:58 2000 From: just@letterror.com (Just van Rossum) Date: Sun, 23 Jan 2000 00:24:58 +0100 Subject: [Pythonmac-SIG] problems installing python 1.5.2 on Mac OS 8.6 In-Reply-To: <20000122225138.7F2EAEDD20@oratrix.oratrix.nl> References: Message by Larry Woestman , Fri, 21 Jan 2000 18:36:31 -0800 , <3.0.6.32.20000121183631.007a2cd0@proaxis.com> Message-ID: At 11:51 PM +0100 22-01-2000, Jack Jansen wrote: >Recently, Larry Woestman said: >> I can't get the Macintosh version of Python 1.5.2c1 to install on my >>Imac run >> ning MacOS 8.6. It installs without obvious complaints but fails to run >>the >> ConfigurePython program. It just "flashes" on the screen with no other >>output Reading this again makes me think the installation actually was successful after all (no news is good news), but... >> . When I try to run Pysol 3.10 (I know, but it was an easy-to-find >>python pr >> ogram) it fails with a "Pysol cannot find the standard Python libraries. >>Ple >> ase check your installation.". ...maybe this is PySols way of telling you Tkinter can't be loaded? I keep forgetting, but apparently in the last release the path for Tkinter is not in the default sys.path, so import Tkinter fails. Please try to add this string: $(PYTHON):Mac:Lib:lib-tk to the default sys.path with EditPythonPrefs Just