From jack@oratrix.nl Wed May 3 10:20:53 2000 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 03 May 2000 11:20:53 +0200 Subject: [Pythonmac-SIG] MacPython CVS repository about to be moved Message-ID: <20000503092054.48725370CF2@snelboot.oratrix.nl> As trusty old trawler.cwi.nl is about to be retired the MacPython CVS repository is going to be relocated to a different machine. This will happen some time next week. To make this move less painful (and hopefully totally unpainful in the future) the machine is as of now also known as "pythoncvs.oratrix.nl". If you use CVS access to the MacPython sources you should start using this name now, and the actual move next week will be automatic. Converting an existing repository is done with the following steps: 1. With BBedit do a Find "trawler.cwi.nl" replace with "pythoncvs.oratrix.nl" in all files named "Repository" (exactly). Be sure you catch Python:Mac, Python:Extensions and anything from lib-src. Doing it on your whole disk shouldn't be a problem, though. 2. Start MacCVS, set your repository to "ropython@pythoncvs.oratrix.nl:/hosts/mm/CVSREMOTE". (admin->prefs) 3. Log in again (admin->login) -- 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 May 4 09:34:32 2000 From: jack@oratrix.nl (Jack Jansen) Date: Thu, 04 May 2000 10:34:32 +0200 Subject: [Pythonmac-SIG] Re: [PythonMac-checkins] MacPython CVS repository about to be moved In-Reply-To: Message by Rob Managan , Wed, 3 May 2000 08:58:22 -0700 , Message-ID: <20000504083433.4AB22370CF2@snelboot.oratrix.nl> Rob Managan said: > For reference in the CVS folders I have from the trawler gdbm > repository the files are: > Repository (with contents) > /hosts/mm/CVSREMOTE/lib-src/gdbm > > root (with contents) > :pserver:ropython@trawler.cwi.nl:/hosts/mm/CVSREMOTE > > and entries whose contents is a list of files and info about > versions and dates... > > So does the above instruction refer to the Root file instead of the > repository file? Apparently there are different versions of MacCVS out there (or maybe it's another difference), but, yes, in this case you have to update the "Root" files. You can probably safely update references to "trawler.cwi.nl" anywhere on your disk. -- 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 mmadeira@ualg.pt Thu May 4 15:44:15 2000 From: mmadeira@ualg.pt (Maria Margarida Madeira) Date: Thu, 04 May 2000 15:44:15 +0100 Subject: [Pythonmac-SIG] Where can I find wxPython for MacOS? Message-ID: <39118CBF.68089EDA@ualg.pt> Hello Can anyone point to me where can I find wxPython for MacOS? Even if it is an unstable version, cvs, whatever ... And also I could not get the swig home page. Did they move? Thanks in advance Margarida -- Maria Margarida C. S. Andrade Madeira (Assistente) GPSBio / ADEEC / UCEH , Universidade do Algarve, Campus de Gambelas 8000 FARO Portugal http://w3.ualg.pt/~mmadeira/ e-mail: mmadeira@ualg.pt tel. : +351 289 800100 fax. : +351 289 818560 Gabinete 2.67 ext.7747 Laboratório 2.76 ext.7917 From mmadeira@ualg.pt Thu May 4 15:44:15 2000 From: mmadeira@ualg.pt (Maria Margarida Madeira) Date: Thu, 04 May 2000 15:44:15 +0100 Subject: [Pythonmac-SIG] Where can I find wxPython for MacOS? Message-ID: <39118CBF.68089EDA@ualg.pt> Hello Can anyone point to me where can I find wxPython for MacOS? Even if it is an unstable version, cvs, whatever ... And also I could not get the swig home page. Did they move? Thanks in advance Margarida -- Maria Margarida C. S. Andrade Madeira (Assistente) GPSBio / ADEEC / UCEH , Universidade do Algarve, Campus de Gambelas 8000 FARO Portugal http://w3.ualg.pt/~mmadeira/ e-mail: mmadeira@ualg.pt tel. : +351 289 800100 fax. : +351 289 818560 Gabinete 2.67 ext.7747 Laboratório 2.76 ext.7917 From jimholliman@heartsoft.com Fri May 5 19:04:24 2000 From: jimholliman@heartsoft.com (Jim Holliman) Date: Fri, 05 May 2000 13:04:24 -0500 Subject: [Pythonmac-SIG] Python as Scripting Language in the CodeWarrior IDE Message-ID: Has anyone set up CodeWarrior Pro5, or 4 for that matter, to use Python as a scripting language? If any one can point me in the direction of some information and perhaps modules I wouldn't have to learn Perl or be saddled with the non portable (but good) AppleScript. -- Thanks Jim From jay@heynow.com Fri May 5 20:48:37 2000 From: jay@heynow.com (Jay Koutavas) Date: Fri, 5 May 2000 14:48:37 -0500 Subject: [Pythonmac-SIG] Where can I find wxPython for MacOS? In-Reply-To: <39118CBF.68089EDA@ualg.pt> References: <39118CBF.68089EDA@ualg.pt> Message-ID: Is anyone in the Mac Python community doing this port? If so, do you need a hand? We all deserve wxPython (and SWIG too). I can lend some development cycles to this, but I'd hate to start something already started. /Jay At 3:44 PM +0100 on 5/4/00, Maria Margarida Madeira wrote: >Hello > >Can anyone point to me where can I find wxPython for MacOS? >Even if it is an unstable version, cvs, whatever ... > >And also I could not get the swig home page. >Did they move? > >Thanks in advance >Margarida > > >-- >Maria Margarida C. S. Andrade Madeira (Assistente) >GPSBio / ADEEC / UCEH , Universidade do Algarve, Campus de Gambelas >8000 FARO Portugal > >http://w3.ualg.pt/~mmadeira/ e-mail: mmadeira@ualg.pt >tel. : +351 289 800100 fax. : +351 289 818560 >Gabinete 2.67 ext.7747 Laborat=F3rio 2.76 ext.7917 > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://www.python.org/mailman/listinfo/pythonmac-sig -- ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Jay Koutavas mailto:jay@heynow.com Heynow Software http://www.heynow.com Windham, New Hampshire, USA ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' From jack@oratrix.nl Fri May 5 22:14:14 2000 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 05 May 2000 23:14:14 +0200 Subject: [Pythonmac-SIG] Python as Scripting Language in the CodeWarrior IDE In-Reply-To: Message by Jim Holliman , Fri, 05 May 2000 13:04:24 -0500 , Message-ID: <20000505211419.1948FE2673@oratrix.oratrix.nl> Recently, Jim Holliman said: > Has anyone set up CodeWarrior Pro5, or 4 for that matter, to use Python as a > scripting language? If any one can point me in the direction of some > information and perhaps modules I wouldn't have to learn Perl or be saddled > with the non portable (but good) AppleScript. Jim, where can I find info on this scripting language stuff for CW? I've never heard of it, but it sounds potentially interesting. And if Perl can do it I guess Python can (unless Perl has turned into an OSA component while I wasn't looking, I never got around to doing this for Python). -- 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 anewcombe@earthlink.net Sat May 6 01:24:47 2000 From: anewcombe@earthlink.net (Amos Newcombe) Date: Fri, 5 May 2000 19:24:47 -0500 Subject: [Pythonmac-SIG] mac islink() Message-ID: I read this from macpath.py: ># Return true if the pathname refers to a symbolic link. ># (Always false on the Mac, until we understand Aliases.) > >def islink(s): > return 0 I won't claim to understand Aliases but I did find the following to work for me: import macfs def islink(s): return macfs.ResolveAliasFile(s)[2] Amos From jack@oratrix.nl Sat May 6 22:52:03 2000 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 06 May 2000 23:52:03 +0200 Subject: [Pythonmac-SIG] mac islink() In-Reply-To: Message by Amos Newcombe , Fri, 5 May 2000 19:24:47 -0500 , Message-ID: <20000506215208.2003EE2673@oratrix.oratrix.nl> Recently, Amos Newcombe said: > I read this from macpath.py: > > ># Return true if the pathname refers to a symbolic link. > ># (Always false on the Mac, until we understand Aliases.) > > > >def islink(s): > > return 0 Ah, memories.... (That comment is still from the time that Guido himself was responsible for MacPython) But: I'm not 100% sure that an alias is sufficiently similar to a symlink that it would be a good idea to put this in. Hmm, let me check where islink is used... Hmm, inconclusive results. Some scripts would definitely break, most appear to be unix-specific anyway. One other point against fixing islink is that ntpath.islink() also always returns zero, while NT aliases are a lot closer to unix symlinks than MacOS aliases (if I understand them correctly). I think I'll just take votes. So let me know whether you want islink() to remain as-is or fixed. -- 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 Sun May 7 23:12:57 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 08 May 2000 00:12:57 +0200 Subject: [Pythonmac-SIG] MacPython 1.6a2 available Message-ID: <20000507221302.0EE79E2673@oratrix.oratrix.nl> MacPython 1.6a2 is available in the usual place (either ftp://ftp.cwi.nl/pub/jack/python/mac or http://www.cwi.nl/ftp/jack/python/mac). I think everything is in shape again (especially the installer, after I broke a few things last time), please give it a try and let me know about problems: starting with the next alfa (which will probably be shortly) I want to start advertising wider again: this one is advertised only here on the SIG, like the previous alfa, but I think things should be fine for "novices" again as of this one. Changes since 1.6a1 ------------------- - All core-Python changes, plus a few from after 1.6a2, approximately as the Python CVS tree was at May 5. - The threading performance bug has been fixed. - Tkinter is included again (yeah!), but only lightly tested. Please report findings to the mailing list. - macfsn.py is auto-imported on startup (unless disabled with a new option). This retrofits macfs.StandardGetFile() and friends to use Navigation Services in stead of the old Standard File dialogs. - I think all installer problems have been fixed. Please report if not 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 managan@llnl.gov Mon May 8 18:31:30 2000 From: managan@llnl.gov (Rob Managan) Date: Mon, 8 May 2000 10:31:30 -0700 Subject: [Pythonmac-SIG] old ftp site removed Message-ID: I used to have some software available at ftp://ftp-lc.llnl.gov/pub/users/managan . This site is moving and since the files are out of date I have removed them. If there is a great need for Mac versions of releases of Numerical let me know and I will find a way to get them posted somewhere. -- *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan LLNL ph: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From lmeyn@mail.arc.nasa.gov Mon May 8 18:38:27 2000 From: lmeyn@mail.arc.nasa.gov (Larry Meyn) Date: Mon, 8 May 2000 10:38:27 -0700 Subject: [Pythonmac-SIG] MacPython 1.6a2 import problems In-Reply-To: <20000508160023.76F881CDCE@dinsdale.python.org> References: <20000508160023.76F881CDCE@dinsdale.python.org> Message-ID: I installed MacPython 1.6a2, but it seems to be having a problem with Mac style line-endings. This shows up when trying to import modules. When I changed my source file to have UNIX line endings the import worked, but then other problem cropped up. Larry Meyn NASA Ames Research Center From cbarker@jps.net Mon May 8 22:17:25 2000 From: cbarker@jps.net (Chris Barker) Date: Mon, 08 May 2000 14:17:25 -0700 Subject: [Pythonmac-SIG] Re:mac islink() References: <20000507160025.D93191CE34@dinsdale.python.org> Message-ID: <39172EE5.8724BFBC@jps.net> Jack Jansen wrote: >Ah, memories.... (That comment is still from the time that Guido >himself was responsible for MacPython) > >But: I'm not 100% sure that an alias is sufficiently similar to a >symlink that it would be a good idea to put this in. Hmm, let me check >where islink is used... Hmm, inconclusive results. Some scripts would >definitely break, most appear to be unix-specific anyway. One other >point against fixing islink is that ntpath.islink() also always >returns zero, while NT aliases are a lot closer to unix symlinks than >MacOS aliases (if I understand them correctly). >I think I'll just take votes. So let me know whether you want islink() >to remain as-is or fixed. I vote to keep it as it is. Platform dependent stuff has no place in the os module with the same name, and alias' are NOT the same as sym-links. Frankly, I don't think ANYTHING that is platform dependent should be in the os module. I don't know what is being planned for Py3k, but I'd love to see everything taken out of os that isn't cross platform. That way, I'd know as soon as I wote the code that it would work on all platforms. If I have to import macos, I'll know it'll only work on a mac. -Chris -- Christopher Barker, Ph.D. cbarker@jps.net --- --- --- http://www.jps.net/cbarker -----@@ -----@@ -----@@ ------@@@ ------@@@ ------@@@ Water Resources Engineering ------ @ ------ @ ------ @ Coastal and Fluvial Hydrodynamics ------- --------- -------- ------------------------------------------------------------------------ ------------------------------------------------------------------------ From managan@llnl.gov Tue May 9 01:04:16 2000 From: managan@llnl.gov (Rob Managan) Date: Mon, 8 May 2000 17:04:16 -0700 Subject: [Pythonmac-SIG] old ftp site removed In-Reply-To: <14614.64111.589261.916098@humbug> References: <14614.64111.589261.916098@humbug> Message-ID: >I would certainly like to have a mac version of NumPy available >somewhere. > >-Ron Cohen- > > > The default installation includes NumPy. I suppose we could twist some arms and get the sources and projects included with the developer's package that you can install. We should definitely have the include files added to the installer so you could compile modules that rely on NumPy . I think that falls to Jack or Just since they have done the installer. Once you have the projects (available on the CVS site) you can easily drop in new source code as it appears on sourceforge and recompile. -- *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan LLNL ph: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From noboru.yamamoto@kek.jp Tue May 9 04:14:22 2000 From: noboru.yamamoto@kek.jp (Noboru Yamamoto) Date: Tue, 09 May 2000 12:14:22 +0900 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG digest, Vol 1 #409 - 1 msg References: <20000508160024.315071CDD4@dinsdale.python.org> Message-ID: <39178152.462B8F12@kek.jp> > To: pythonmac-sig@python.org > Date: Mon, 08 May 2000 00:12:57 +0200 > From: Jack Jansen > Subject: [Pythonmac-SIG] MacPython 1.6a2 available > > MacPython 1.6a2 is available in the usual place (either > ftp://ftp.cwi.nl/pub/jack/python/mac or > http://www.cwi.nl/ftp/jack/python/mac). > > I think everything is in shape again (especially the installer, after > I broke a few things last time), please give it a try and let me know > about problems: starting with the next alfa (which will probably be > shortly) I want to start advertising wider again: this one is > advertised only here on the SIG, like the previous alfa, but I think > things should be fine for "novices" again as of this one. > I installed 1.6a2 into my PowerMac 8100 with G3 accelerator board running MacOS8.1. Python Interpreter and PythonIDE running OK. However, when I tried to import Tkinter module in Python Interpreter, I got the error message something like "windowsLib is missing". Do I need more recent Mac OS ( 8.5, 8.6 , 9.0 or X) to run Tkinter on MacPython 1.6a2? Noboru Yamamoto KEKB control group KEK, JAPAN > Changes since 1.6a1 > ------------------- > > - All core-Python changes, plus a few from after 1.6a2, approximately > as the Python CVS tree was at May 5. > - The threading performance bug has been fixed. > - Tkinter is included again (yeah!), but only lightly tested. Please > report findings to the mailing list. > - macfsn.py is auto-imported on startup (unless disabled with a > new option). > This retrofits macfs.StandardGetFile() and friends to use > Navigation Services in stead of the old Standard File dialogs. > - I think all installer problems have been fixed. Please > report if not 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 > > End of Pythonmac-SIG Digest_______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://www.python.org/mailman/listinfo/pythonmac-sig From jack@oratrix.nl Tue May 9 21:47:29 2000 From: jack@oratrix.nl (Jack Jansen) Date: Tue, 09 May 2000 22:47:29 +0200 Subject: [Pythonmac-SIG] old ftp site removed In-Reply-To: Message by Rob Managan , Mon, 8 May 2000 17:04:16 -0700 , Message-ID: <20000509204734.180C9D8397@oratrix.oratrix.nl> Recently, Rob Managan said: > The default installation includes NumPy. > > I suppose we could twist some arms and get the sources and projects > included with the developer's package that you can install. Consider it twisted:-) But, I'm not sure what you want. I'd be willing to include the .h files in the development package, but is that going to do anyone any good? Are a lot of people writing extensions that make use of the NumPy shared libraries (because that is basically the only thing you can do with the development install option: compile your own sources to link against PythonCore or any of the plugin modules. (Yes, I know, the 1.6a2 installer has all the projects in Mac:Build, but that's an oversight. There's nothing you can do with the projects without the sources). Sources should come from a source distribution or (preferrably, nowadays) the CVS repository. -- 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 jmassung@magpiesystems.com Wed May 10 16:09:42 2000 From: jmassung@magpiesystems.com (Jeff Massung) Date: Wed, 10 May 2000 09:09:42 -0600 Subject: [Pythonmac-SIG] 1.6a2 Tkinter Message-ID: <000301bfba91$c4d9de20$390110ac@Programmer1.magpie> I know it hasn't been tested much, but I had a few questions: Am I doing something wrong here? I start it up and first thing: >>> import Tkinter I get an error right away (not that it can't find it but a file/function error). Sorry, I'm not at my Mac, so I can't give exact details, only to say I added Lib:lib-tk to the path, and Mac:Plugins is there, too. Hopefully it is a stupid problem. And on a side note: is highlighted syntax going to be in this version? I hope so, otherwise back to XEmacs (then again, why leave?) Thanks for all the work in the Mac version! - Jeff Massung (jmassung@magpiesystems.com) - Lead software engineer for Magpie Systems (http://www.magpiesystems.com) - Bringing smart pigs and data analysis to the pipeline industry! From jack@oratrix.nl Wed May 10 16:30:51 2000 From: jack@oratrix.nl (Jack Jansen) Date: Wed, 10 May 2000 17:30:51 +0200 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG digest, Vol 1 #409 - 1 msg In-Reply-To: Message by Noboru Yamamoto , Tue, 09 May 2000 12:14:22 +0900 , <39178152.462B8F12@kek.jp> Message-ID: <20000510153052.62AC4370CF2@snelboot.oratrix.nl> > I installed 1.6a2 into my PowerMac 8100 with G3 accelerator board > running > MacOS8.1. > > Python Interpreter and PythonIDE running OK. However, when I tried to > import Tkinter module in Python Interpreter, I got the error message > something like "windowsLib is missing". Running without windowsLib is probably not going to be doable: it is part of Appearance 1.1 (I think), and more and more of MacPython depends on Appearance. But, if I'm not mistaken you can download Appearance for pre-8.5 MacOS systems. Check out the Apple website, and please let me know the results so that I can add this info to the release notes and the website. -- 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 Thu May 11 01:37:25 2000 From: managan@llnl.gov (Rob Managan) Date: Wed, 10 May 2000 17:37:25 -0700 Subject: [Pythonmac-SIG] old ftp site removed In-Reply-To: <20000509204734.180C9D8397@oratrix.oratrix.nl> References: <20000509204734.180C9D8397@oratrix.oratrix.nl> Message-ID: At 10:47 PM +0200 5/9/00, Jack Jansen wrote: >Recently, Rob Managan said: >> The default installation includes NumPy. >> >> I suppose we could twist some arms and get the sources and projects >> included with the developer's package that you can install. > >Consider it twisted:-) > >But, I'm not sure what you want. I'd be willing to include the .h >files in the development package, but is that going to do anyone any >good? Are a lot of people writing extensions that make use of the >NumPy shared libraries (because that is basically the only thing you >can do with the development install option: compile your own sources >to link against PythonCore or any of the plugin modules. (Yes, I know, >the 1.6a2 installer has all the projects in Mac:Build, but that's an >oversight. There's nothing you can do with the projects without the >sources). > The .h files are what is needed. Any number of extension modules that use NumPy arrays need to include those headers. The projects would only be useful since they are not available at the sourceforge NumPy archive. Thus while you can get the source there, the projects would allow you to easily compile a newer version of NumPy than was shipped with the Mac installer. -- *-*-*-*-*-*-*-*-*-*-**-*-*-*-*-*-*-*-*-*-*- Rob Managan LLNL ph: 925-423-0903 P.O. Box 808, L-095 FAX: 925-422-3389 Livermore, CA 94551-0808 From VitalOwns@aol.com Thu May 11 21:07:50 2000 From: VitalOwns@aol.com (VitalOwns@aol.com) Date: Thu, 11 May 2000 16:07:50 EDT Subject: [Pythonmac-SIG] join Message-ID: can i join the mailing list? From lists@kassube.de Thu May 11 22:27:59 2000 From: lists@kassube.de (Nils Kassube) Date: Thu, 11 May 2000 23:27:59 +0200 Subject: [Pythonmac-SIG] join In-Reply-To: Message-ID: VitalOwns@aol.com wrote: > can i join the mailing list? Can someone drag me away from my keyboard before I answer this question? M-u-s-t r-e-s-i-s-t t-h-e t-e-m-p-t-a-t-i-o-n. Help me! Please... :-) From jwmdck@monmouth.com Sat May 13 01:10:10 2000 From: jwmdck@monmouth.com (Murphy/Kostick) Date: Fri, 12 May 2000 20:10:10 -0400 Subject: [Pythonmac-SIG] MacPython 1.6a2: EditPythonPrefs Bug References: <20000507221302.0EE79E2673@oratrix.oratrix.nl> Message-ID: <391C9D61.B603F5A4@monmouth.com> Jack: EditPythonPrefs bombs (see below) when the user selects the "Default Startup Options" button. Changing the last entry of opt_dialog_map (EditPythonPrefs.py: line 54) from "nonavservices" to "nonavservice" seems to remove the problem. Jim Murphy Wall Township, New Jersey USA ================================= Traceback (most recent call last): File "Macintosh HD:SWdev:Jack:Python:Mac:scripts:EditPythonPrefs.py", line 186, in ? File "Macintosh HD:SWdev:Jack:Python:Mac:scripts:EditPythonPrefs.py", line 179, in main File "Macintosh HD:SWdev:Jack:Python:Mac:scripts:EditPythonPrefs.py", line 162, in edit_preferences File "Macintosh HD:SWdev:Jack:Python:Mac:scripts:EditPythonPrefs.py", line 144, in interact File "Macintosh HD:SWdev:Jack:Python:Mac:scripts:EditPythonPrefs.py", line 81, in optinteract KeyError: nonavservices ================================== From craig@osa.att.ne.jp Sat May 13 14:29:03 2000 From: craig@osa.att.ne.jp (Craig Hagerman) Date: Sat, 13 May 2000 22:29:03 +0900 Subject: [Pythonmac-SIG] These are un-doable, right? Message-ID: Hi, It sounds odd- but I want to check and make sure that a couple things I assume I can't do in Mac Python can't be done. First of all, am I correct in my understanding that I can not create a child process (fork), or a separate thread, or any other kind of multi-tasking with the mac version of Python? I think that this is only available with Windows or UNIX systems. This is what I understand but I don't know for sure. Assuming that is the case, I am also curious about whether or not it will be possible to do this with Python under OS X. I assume that the os.fork() method will work fine with OS X, but what about threads. I think that they require POSIX compliency, which I think Apple is not going to seek for OS X (but I am way out of my depth here). Anyone know the story on this? Another thing-- Am I correct in thinking that I can't do anything with the (toolbox ) Time Manager? I wanted some UNIX-ish cron functionality and right now use something called "iDo Script Scheduler" (little utility from Sophisticated Curcuits which allows you to schedule when AppleScripts do their thing) to call an AppleScript which in turn calls the Python script to do it's business. Kind of convoluted - just like to know if there is an easier way around this. Again, I assume that cron will be available under OS X so I can live with it until then, but just wondering. Lastly -- Is there any way to call AppleScripts from within Python? I was surprised to find out that you can do this within MacPerl code. I can't do this within Mac Python, right? Thanks in advance, Craig Hagerman From jack@oratrix.nl Mon May 15 09:30:54 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 15 May 2000 10:30:54 +0200 Subject: [Pythonmac-SIG] MacPython 1.6a2: EditPythonPrefs Bug In-Reply-To: Message by Murphy/Kostick , Fri, 12 May 2000 20:10:10 -0400 , <391C9D61.B603F5A4@monmouth.com> Message-ID: <20000515083115.443F0370CF2@snelboot.oratrix.nl> > Jack: > > EditPythonPrefs bombs (see below) when the user selects the > "Default > Startup Options" button. Thanks for the report. This has been fixed in the CVS archive, along with a couple of other bugs in EditPythonPrefs. There'll probably be a new release shortly, until then you'll have to live without EditPythonPrefs, I guess, unless you have access to the repository. -- 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 May 15 09:42:57 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 15 May 2000 10:42:57 +0200 Subject: [Pythonmac-SIG] These are un-doable, right? In-Reply-To: Message by Craig Hagerman , Sat, 13 May 2000 22:29:03 +0900 , Message-ID: <20000515084258.5286C370CF2@snelboot.oratrix.nl> > First of all, am I correct in my understanding that I can not create a > child process (fork), or a separate thread, or any other kind of > multi-tasking with the mac version of Python? I think that this is only > available with Windows or UNIX systems. This is what I understand but I > don't know for sure. Fork is indeed unavailable on Mac, but as of 1.6a2 threads do work. They haven't been tested thoroughly, though, so please give them a try. To start up separate processes you could look at the findertools module, or you could use the OSA (AppleScript) modules. Python:Mac:Demo:applescript.html has an example of the latter. > Assuming that is the case, I am also curious about whether or not it will > be possible to do this with Python under OS X. Definitely. But don't hold your breath for it: it's currently possible to build a standard Unix Python for MacOSX (the standard Unix distribution almost compiles out of the box) and I'm slowly working on Carbon compliance for MacPython, but when and how these two will meet is uncertain. > Another thing-- Am I correct in thinking that I can't do anything with the > (toolbox ) Time Manager? There isn't an interface to time mgr currently. Definitely doable with a day of work, but I don't have the time to spend on it. If someone else wants to take this up I'll gladly give some advise, though. > Lastly -- Is there any way to call AppleScripts from within Python? Often you don't have to call AppleScripts, because all of OSA is available from MacPython. But if you do need this specific functionality look at Python:Mac:Contrib:osam, this does what 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 azeldis@mail.wesleyan.edu Mon May 15 16:14:26 2000 From: azeldis@mail.wesleyan.edu (M. Papillon) Date: Mon, 15 May 2000 11:14:26 -0400 Subject: [Pythonmac-SIG] MacPython 1.6a2: parser Bug Message-ID: <200005151513.LAA08980@mail.wesleyan.edu> Here's the output from test_parser.py: ---- docstring.py o.k. ---- example.py parser module raised exception on input file example.py: Traceback (most recent call last): File "bwaj:Programming:Python 1.6a2:Demo:parser:test_parser.py", line 19, in testChunk new = parser.tuple2ast(tup) ParserError: Expected node type 12, got 312. ---- simple.py o.k. ---- source.py o.k. ---- test_parser.py parser module raised exception on input file test_parser.py: Traceback (most recent call last): File "bwaj:Programming:Python 1.6a2:Demo:parser:test_parser.py", line 19, in testChunk new = parser.tuple2ast(tup) ParserError: Expected node type 12, got 312. It works with python 1.6a2 on my Solaris box. If someone could put a binary up as soon as this is fixed that would be great, as I haven't got codewarrior... From jack@oratrix.nl Mon May 15 16:44:09 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 15 May 2000 17:44:09 +0200 Subject: [Pythonmac-SIG] MacPython 1.6a2: parser Bug In-Reply-To: Message by "M. Papillon" , Mon, 15 May 2000 11:14:26 -0400 , <200005151513.LAA08980@mail.wesleyan.edu> Message-ID: <20000515154410.DD30D370CF2@snelboot.oratrix.nl> > Here's the output from test_parser.py: > > ---- docstring.py o.k. > ---- example.py > parser module raised exception on input file example.py: > Traceback (most recent call last): > File "bwaj:Programming:Python 1.6a2:Demo:parser:test_parser.py", line > 19, in testChunk > new = parser.tuple2ast(tup) > ParserError: Expected node type 12, got 312. I haven't a clue what this test is supposed to do. If you know what is supposed to happen: please let me know. If you just ran this script hoping it would test the Python parser: forget it, it doesn't, as far as I know... I also see Makefiles and such in that folder, so it could well be that this is a unix-specific thing... -- 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 kantel@mpiwg-berlin.mpg.de Tue May 16 14:40:35 2000 From: kantel@mpiwg-berlin.mpg.de (=?iso-8859-1?Q?J=F6rg?= Kantel) Date: Tue, 16 May 2000 15:40:35 +0200 Subject: [Pythonmac-SIG] Two new How To :o) Message-ID: Hi, to whom of you who can read German: I released two new How To's at my Weblog: First "ftp with Python" on http://schockwellenreiter.editthispage.com/python/pythonftp.html and an second one about "Filedialog with Python and Tkinter at http://schockwellenreiter.editthispage.com/python/filedialog.html. Both are first written in Perl for a German Perl mailing list but I think the solutions in Python are more elegant ;o) I plan to add more and more How To's on this site. Contributors are wellcome. :o) (In both languages, German and English ;o) Cheers, J"org -- -- http://www.kantel.de/ # http://homepage.mac.com/jkantel/homepage.html joerg@kantel.de # jkantel@mac.com visit: http://www.rollberg.de/ - die WebSite fuer unmoegliche Nachrichten und http://schockwellenreiter.editthispage.com, mein Web-Tagebuch in Manila http://www.die-herforder.de - linke Politik online - nur im Internet From lmeyn@mail.arc.nasa.gov Thu May 18 21:11:39 2000 From: lmeyn@mail.arc.nasa.gov (Larry Meyn) Date: Thu, 18 May 2000 13:11:39 -0700 Subject: [Pythonmac-SIG] Path Name Problems in Python 1.6a2 In-Reply-To: <20000516160051.888021CD4B@dinsdale.python.org> References: <20000516160051.888021CD4B@dinsdale.python.org> Message-ID: I've found a couple of differences between how 1.5.2c1 and 1.6a2 in how path names are handled. 1) I store my commonly used software modules in a separate folder called "packages" and I put an alias to it in my Python folder. I then use EditPythonPrefs to put "$(PYTHON):packages" into the system path. This worked fine under 1.5.2c1, but 1.6a2 can't find modules stored in the aliased folder. If I replace the aliased folder with the actual folder there is no problem. 2) The other problem seems to be with tkinter. Path names with the "bullet" character (option-8) seem to get scrambled. Choosing the file "Macintosh HD:Projects:Legacy Projects:*Descent CAS/HAVOC:HAVOCpython:_HAVOC ND2" using the following code: f = tkFileDialog.askopenfile(title='Select.',parent = root) resulted in this error: IOError: [Errno 2] No such file or directory: 'Macintosh HD:Projects:Legacy Projects:\342\200\242Descent CAS/HAVOC:HAVOCpython:_HAVOC ND2' Eliminating the "bullet" character resolved the problem. Neither one of these problems is a show stopper, but I thought I should report them. Larry From jhrsn@pop.pitt.edu Sat May 20 04:13:02 2000 From: jhrsn@pop.pitt.edu (Jim Harrison) Date: Fri, 19 May 2000 23:13:02 -0400 Subject: [Pythonmac-SIG] Anyone running JPython/awt/swing successfully? Message-ID: I'd be interested in hearing from anyone who is successfully running JPython with awt and swing on the Mac. I have the interactive interpreter running OK and I can run simple non-GUI scripts by following the instructions on Jack's page. However, when I try to run any of the awt or swing demos, I get errors such as "TypeError: can't set arbitrary attribute in java instance:..." for awt demos or ImportErrors in the swing demos complaining that swing is not defined. Is anyone able to give me some hints on how to set up my libraries correctly or otherwise address these problems? I have a standard installation of MRJ 2.2 running on System 8.6 on a Powerbook G3. Jim Harrison University of Pittsburgh From jhrsn@pop.pitt.edu Sat May 20 04:13:03 2000 From: jhrsn@pop.pitt.edu (Jim Harrison) Date: Fri, 19 May 2000 23:13:03 -0400 Subject: [Pythonmac-SIG] PythonMode for Alpha? Message-ID: I see Alpha mentioned occasionally as a Python editor for the Mac, but the current distribution does not include a pythonMode.tcl mode file. Is this still available? Could anyone point me to a source for it? Jim Harrison University of Pittsburgh From savageb@pacbell.net Sat May 20 08:38:49 2000 From: savageb@pacbell.net (Bob Savage) Date: Sat, 20 May 2000 00:38:49 -0700 Subject: [Pythonmac-SIG] Python on OSX dp4 screenshot Message-ID: Just in case anyone wants to see it. http://www.stanford.edu/~bsavage/python-image.tiff Bob From doug@sonosphere.com Sat May 20 08:53:25 2000 From: doug@sonosphere.com (Doug Wyatt) Date: Sat, 20 May 2000 00:53:25 -0700 Subject: [Pythonmac-SIG] Python on OSX dp4 screenshot In-Reply-To: References: Message-ID: At 0:38 -0700 5/20/00, Bob Savage wrote: >Just in case anyone wants to see it. > >http://www.stanford.edu/~bsavage/python-image.tiff Darn, for a moment I thought you'd ported it to X already :-) I think it would be good to explore creating at least two versions of Python for X: - command-line, treating X as a BSD-like OS. This should be a moderately straightforward port, except to the extent to which there could be OS bugs. I'd love to use this in my work on X; I've never had the patience to learn shell scripting since I was first spoiled by Python. I may attempt this... - Carbonized, with access to the Mac toolbox. I don't know offhand what obstacles there might be, but the Carbon Dater tool could probably help us find them ... Doug -- Doug Wyatt doug@sonosphere.com http://www.sonosphere.com/ <- new: review of Mother Mallard at the Smithsonian From kish@cs.tu-berlin.de Sat May 20 16:49:34 2000 From: kish@cs.tu-berlin.de (Kei Ishii) Date: Sat, 20 May 2000 17:49:34 +0200 Subject: [Pythonmac-SIG] PythonMode for Alpha? In-Reply-To: Message-ID: An old old version of Python Mode is available in several but not obvious places, e.g. ftp://ftp.santafe.edu/pub/mac/Alpha/pythonMode.hqx Did not try it out (tried to program one for myself, although not very successfully, yet -- lack of time and experience, I guess :^|) Kei. At 5:13 Uhr +0200 20.05.2000, Jim Harrison wrote: |>I see Alpha mentioned occasionally as a Python editor for the Mac, but the |>current distribution does not include a pythonMode.tcl mode file. Is this |>still available? Could anyone point me to a source for it? |> |>Jim Harrison |>University of Pittsburgh |> |> |>_______________________________________________ |>Pythonmac-SIG maillist - Pythonmac-SIG@python.org |>http://www.python.org/mailman/listinfo/pythonmac-sig -- Kei Ishii ĄŠ°ę ·É kish@cs.tu-berlin.de TU Berlin, FB Informatik, Sekr. FR5-10, Franklinstr. 28/29, 10587 Berlin "I'm not dumb. I just have a command of thoroughly useless information" Calvin From rbl@hal.cwru.edu Sat May 20 17:46:47 2000 From: rbl@hal.cwru.edu (Robin B. Lake) Date: Sat, 20 May 2000 12:46:47 -0400 (EDT) Subject: [Pythonmac-SIG] Printing to a file Message-ID: <200005201646.MAA13803@hal.epbi.cwru.edu> Mac G3, OS 8.6, Python 1.6a1. I'm reading HTML pages off the Web and trying to file the contents of each page into a Mac file. I create the new file with a name derived from a line found on each Web page (no problem). I'm then setting stdout to that file and printing the downloaded page: sys.stdout = fpout this = urllib.urlopen('http://spamframjam/sub1/sub2/page',parameters) print this.read() later, at the bottom of the inner loop, I do: fpout.close() Problems: Sometimes I can create the 25 files created in the inner loop, sometimes it hangs. What I'd LIKE to be able to do is either copy the "this" instance above into the file created and pointed to by fpout. copyfile(this,fpout) does not work. Doing it that way would not tie up stdout. Also, the fpout = open( newpath, 'wb') fpout.close() pair just might be out of sync --- should I wait for an event on the fpout.close() before proceeding? BTW, this is based on an AppleScript that works, but certain aspects of the Python URLlib are different from WebMiner's: open url posting {param,value} approach. Haven't figured it all out yet. Thanks, Rob Lake rbl@hal.cwru.edu From billb@mousa.demon.co.uk Sat May 20 18:41:04 2000 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Sat, 20 May 2000 18:41:04 +0100 Subject: [Pythonmac-SIG] PythonMode for Alpha? In-Reply-To: References: Message-ID: At 5:49 pm +0200 20/05/00, Kei Ishii wrote: >An old old version of Python Mode is available in several but not >obvious places, e.g. ftp://ftp.santafe.edu/pub/mac/Alpha/pythonMode.hqx > That should be ftp://ftp.santafe.edu//pub/mac/Alpha/pythonMode.sit.hqx -- Bill Bedford There was a roar like the scream of a camel who has just seen two bricks. From jack@oratrix.nl Sat May 20 22:51:06 2000 From: jack@oratrix.nl (Jack Jansen) Date: Sat, 20 May 2000 23:51:06 +0200 Subject: [Pythonmac-SIG] Python on OSX dp4 screenshot In-Reply-To: Message by Doug Wyatt , Sat, 20 May 2000 00:53:25 -0700 , Message-ID: <20000520215111.C7C0BDDDE0@oratrix.oratrix.nl> Recently, Doug Wyatt said: > I think it would be good to explore creating at least two versions of > Python for X: > > - command-line, treating X as a BSD-like OS. This should be a > moderately straightforward port, except to the extent to which there > could be OS bugs. I'd love to use this in my work on X; I've never > had the patience to learn shell scripting since I was first spoiled > by Python. I may attempt this... This is basically already there: take the standard Python distribution (the unix one) and compile it. There were one or two minor gotchas, the main one I remember being that if you run on an HFS+ disk (as opposed to a UFS disk) there's a name clash between the eventual executable "python" and the "Python" directory. That's easily fixed in the Makefile by setting the EXE=".exe" variable. > - Carbonized, with access to the Mac toolbox. I don't know offhand > what obstacles there might be, but the Carbon Dater tool could > probably help us find them ... I'm busily hacking on this, and the easy bits have been done. I haven't checked it into the repository yet because from those sources I can't currently build a non-carbon Python. (I can't build a carbon-Python either, but that's a minor detail:-). I hope to have things working again in about 2 weeks time, then I'll check it in and you're all invited to help hacking on this. There are a few problems with helping with this, however. The main one is that you need Codewarrior Pro 6, which isn't released yet. Is anyone besides me on the MPTP program (Metrowerks's beta-tester list)? The other one is that backwards-compatibility is probably easiest with Universal Headers 3.3.1 or later. At least, that's what it looks like right now. If CW Pro 6 comes out soon that isn't a problem, otherwise I'd make life miserable for the rest of you by checking changes in. I'm still undecided. -- 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 Sat May 20 20:20:09 2000 From: seanh@unforgettable.com (Sean Hummel ) Date: Sat, 20 May 2000 19:20:09 +0000 (GMT) Subject: [Pythonmac-SIG] Python on OSX dp4 screenshot In-Reply-To: <20000520215111.C7C0BDDDE0@oratrix.oratrix.nl> Message-ID: Everyone who attended WWDC had the opportunity to pickup the CW6 beta disk. ------------------------------------------------ There are times when truth is stranger than fiction and lunch time is one of them. ================================================ ____________seanh@unforgettable.com_____________ ------------------------------------------------ On Sat, 20 May 2000, Jack Jansen wrote: > > Recently, Doug Wyatt said: > > I think it would be good to explore creating at least two versions of > > Python for X: > > > > - command-line, treating X as a BSD-like OS. This should be a > > moderately straightforward port, except to the extent to which there > > could be OS bugs. I'd love to use this in my work on X; I've never > > had the patience to learn shell scripting since I was first spoiled > > by Python. I may attempt this... > > This is basically already there: take the standard Python distribution > (the unix one) and compile it. There were one or two minor gotchas, > the main one I remember being that if you run on an HFS+ disk (as > opposed to a UFS disk) there's a name clash between the eventual > executable "python" and the "Python" directory. That's easily fixed in > the Makefile by setting the EXE=".exe" variable. > > > - Carbonized, with access to the Mac toolbox. I don't know offhand > > what obstacles there might be, but the Carbon Dater tool could > > probably help us find them ... > > I'm busily hacking on this, and the easy bits have been done. I > haven't checked it into the repository yet because from those sources > I can't currently build a non-carbon Python. (I can't build a > carbon-Python either, but that's a minor detail:-). I hope to have > things working again in about 2 weeks time, then I'll check it in and > you're all invited to help hacking on this. > > There are a few problems with helping with this, however. The main one > is that you need Codewarrior Pro 6, which isn't released yet. Is > anyone besides me on the MPTP program (Metrowerks's beta-tester list)? > > The other one is that backwards-compatibility is probably easiest with > Universal Headers 3.3.1 or later. At least, that's what it looks like > right now. If CW Pro 6 comes out soon that isn't a problem, otherwise > I'd make life miserable for the rest of you by checking changes > in. I'm still undecided. > -- > 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 rbl@hal.cwru.edu Sun May 21 00:49:42 2000 From: rbl@hal.cwru.edu (Robin B. Lake) Date: Sat, 20 May 2000 19:49:42 -0400 (EDT) Subject: [Pythonmac-SIG] Really need a "GOTO"! Message-ID: <200005202349.TAA14413@hal.epbi.cwru.edu> I've got a program almost working, but --- being trained in programming well before "GOTO"s were considered harmful --- I need some help in seeing how to change my "natural" code-construction tendancies. Here's the structure: Do something A while 1: if a line contains a string: do a bunch of stuff else: if a line contains a different string: Do something B ==== At this point, if I follow Do something B with: Do something B continue then embedded print statements show I don't got back to the start of the "while 1" loop, but just hang. From the documentation, using a "break" here won't take me to the start of the "while 1:" loop. If I try: Do something B continue then I get a syntax error. Help, please? Thank you, Rob Lake rbl@hal.cwru.edu From dgoodger@bigfoot.com Sun May 21 17:57:37 2000 From: dgoodger@bigfoot.com (David Goodger) Date: Sun, 21 May 2000 12:57:37 -0400 Subject: [Pythonmac-SIG] Re: Printing to a file In-Reply-To: <20000521160040.CBF981CDAE@dinsdale.python.org> Message-ID: > From: "Robin B. Lake" > Date: Saturday, May 20, 2000 12:46 > > I'm reading HTML pages off the Web and trying to file the contents > of each page into a Mac file. I create the new file with a name > derived from a line found on each Web page (no problem). I'm then > setting stdout to that file and printing the downloaded page: If you're deriving the name of the file from the web page contents, you should be reading the contents first, and creating the output file after. I assume you've got a line like "fpout = open(...)" here. > sys.stdout = fpout > > this = urllib.urlopen('http://spamframjam/sub1/sub2/page',parameters) > print this.read() > > later, at the bottom of the inner loop, I do: > > fpout.close() > > Problems: Sometimes I can create the 25 files created in the inner loop, > sometimes it hangs. > > What I'd LIKE to be able to do is either copy the "this" instance above > into the file created and pointed to by fpout. copyfile(this,fpout) does > not work. Doing it that way would not tie up stdout. instead of the lines above, use: fpout = open(...) this = urllib.urlopen('http://spamframjam/sub1/sub2/page',parameters) contents = this.read() fpout.write(contents) fpout.close() Of course, you could compress this considerably by leaving out some or all of the intermediate variables: open(...).write(urllib.urlopen('http://spamframjam/sub1/sub2/page', parameters).read()) This relies on Python to close the file for you too. -- David Goodger dgoodger@bigfoot.com Open-source projects: - The Go Tools Project: http://gotools.sourceforge.net (more to come!) From dgoodger@bigfoot.com Sun May 21 17:57:41 2000 From: dgoodger@bigfoot.com (David Goodger) Date: Sun, 21 May 2000 12:57:41 -0400 Subject: [Pythonmac-SIG] Re: Really need a "GOTO"! In-Reply-To: <20000521160040.CBF981CDAE@dinsdale.python.org> Message-ID: > From: "Robin B. Lake" > Date: Sat, 20 May 2000 19:49:42 -0400 (EDT) > > I've got a program almost working, but --- being trained in programming > well before "GOTO"s were considered harmful --- I need some help in > seeing how to change my "natural" code-construction tendancies. > Here's the structure: I assume you mean: Do something A while 1: if a line contains a string: do a bunch of stuff else: if a line contains a different string: Do something B (Please watch your indentation. Significant, you know! :-) > At this point, if I follow Do something B with: > > Do something B > continue > > then embedded print statements show I don't got back to the start of the > "while 1" loop, but just hang. From the documentation, using a "break" > here won't take me to the start of the "while 1:" loop. You don't need a "continue" to return to the top of the while loop. I don't see any problem with the pseudocode above. Perhaps post the actual code? Also, "else: if ...:" is usually shortened to "elif ...:". This saves some wear & tear on your tab key. -- David Goodger dgoodger@bigfoot.com Open-source projects: - The Go Tools Project: http://gotools.sourceforge.net (more to come!) From doug@sonosphere.com Mon May 22 11:39:53 2000 From: doug@sonosphere.com (Doug Wyatt) Date: Mon, 22 May 2000 03:39:53 -0700 Subject: [Pythonmac-SIG] Python on OSX dp4 screenshot In-Reply-To: <20000520215111.C7C0BDDDE0@oratrix.oratrix.nl> References: <20000520215111.C7C0BDDDE0@oratrix.oratrix.nl> Message-ID: At 23:51 +0200 5/20/00, Jack Jansen wrote: >Recently, Doug Wyatt said: > > I think it would be good to explore creating at least two versions of > > Python for X: > > > > - command-line, treating X as a BSD-like OS. This should be a > > moderately straightforward port, except to the extent to which there > > could be OS bugs. I'd love to use this in my work on X; I've never > > had the patience to learn shell scripting since I was first spoiled > > by Python. I may attempt this... > >This is basically already there: take the standard Python distribution >(the unix one) and compile it. There were one or two minor gotchas, >the main one I remember being that if you run on an HFS+ disk (as >opposed to a UFS disk) there's a name clash between the eventual >executable "python" and the "Python" directory. That's easily fixed in >the Makefile by setting the EXE=".exe" variable. I'm trying this ... # = my comments [wyatdo:~/Python-1.6a2] doug% ./configure creating cache ./config.cache #if test -f /usr/lib/NextStep/software_version -o -f #/System/Library/CoreServices/software_version ; then # echo $ac_n "checking for --with-next-archs""... $ac_c" 1>&6 ##### /System/Library/CoreServices/software_version exists checking for --with-next-archs... none: using ppc checking MACHDEP... next ##### I think we're afoul checking for --without-gcc... no checking for --with-cxx=... no checking for gcc... no checking for cc... cc then during make: cc -g -O2 -OPT:Olimit=0 -I./../Include -I.. -DHAVE_CONFIG_H -c -o dynload_next.o dynload_next.c dynload_next.c:60: header file 'mach-o/rld.h' not found dynload_next.c:81: undefined type, found `NXStream' It looks like it's deciding early on that we're on a Next machine ... So I fixed that by tweaking configure to ignore /System/Library/CoreServices/software_version. But now: - - - - - cd Modules; make OPT="-g -O2 -OPT:Olimit=0" python.o cc -g -O2 -OPT:Olimit=0 -I./../Include -I.. -DHAVE_CONFIG_H -c -o python.o python.c expr `cat buildno` + 1 >buildno1 mv -f buildno1 buildno cc -c -g -O2 -OPT:Olimit=0 -I. -DHAVE_CONFIG_H -DBUILD=`cat buildno` \ ./Modules/getbuildinfo.c ar cr libpython1.6.a getbuildinfo.o ranlib libpython1.6.a true cd Modules; make OPT="-g -O2 -OPT:Olimit=0" VERSION="1.6" \ prefix="/usr/local" exec_prefix="/usr/local" \ LIBRARY=../libpython1.6.a link cc python.o \ ../libpython1.6.a -lm -o python /usr/bin/ld: can't locate file for: -lm make[1]: *** [link] Error 1 make: *** [python] Error 2 - - - - - Is there a more general mailing list/forum where I should bring this up? Doug -- Doug Wyatt doug@sonosphere.com http://www.sonosphere.com/ <- new: review of Mother Mallard at the Smithsonian From jack@oratrix.nl Mon May 22 12:18:06 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 22 May 2000 13:18:06 +0200 Subject: [Pythonmac-SIG] Python on OSX dp4 screenshot In-Reply-To: Message by Doug Wyatt , Mon, 22 May 2000 03:39:53 -0700 , Message-ID: <20000522111811.91CFBDDDE0@oratrix.oratrix.nl> Recently, Doug Wyatt said: > > # = my comments > > [wyatdo:~/Python-1.6a2] doug% ./configure > creating cache ./config.cache > > #if test -f /usr/lib/NextStep/software_version -o -f > #/System/Library/CoreServices/software_version ; then > # echo $ac_n "checking for --with-next-archs""... $ac_c" 1>&6 > ##### /System/Library/CoreServices/software_version exists > checking for --with-next-archs... none: using ppc > checking MACHDEP... next > ##### I think we're afoul Nope, it's right: for all practical pusposes MacOS X is a next, for the time being. > cc -g -O2 -OPT:Olimit=0 -I./../Include -I.. -DHAVE_CONFIG_H -c -o > dynload_next.o dynload_next.c > dynload_next.c:60: header file 'mach-o/rld.h' not found > dynload_next.c:81: undefined type, found `NXStream' This is easy to fix: there is a define in (I think)dynload_next.c to make it switch between two types of dynamic loading. Pick the non-default one and it'll work. I can't check the exact details right now because I'm away from the office and my MacOSX machine is running MacOS9 at the moment. -- 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 doug@sonosphere.com Mon May 22 17:49:34 2000 From: doug@sonosphere.com (Doug Wyatt) Date: Mon, 22 May 2000 12:49:34 -0400 Subject: [Pythonmac-SIG] Python on Mac OS X In-Reply-To: <20000522111811.91CFBDDDE0@oratrix.oratrix.nl> References: <20000522111811.91CFBDDDE0@oratrix.oratrix.nl> Message-ID: At 13:18 +0200 5/22/00, Jack Jansen wrote: >This is easy to fix: there is a define in (I think)dynload_next.c to >make it switch between two types of dynamic loading. Pick the >non-default one and it'll work. I can't check the exact details right >now because I'm away from the office and my MacOSX machine is running >MacOS9 at the moment. Yes, I just added #define WITH_DYLD // dsw to the top of dynload_next.c and it compiled. Next problem ... At 23:51 +0200 5/20/00, Jack Jansen wrote: >This is basically already there: take the standard Python distribution >(the unix one) and compile it. There were one or two minor gotchas, >the main one I remember being that if you run on an HFS+ disk (as >opposed to a UFS disk) there's a name clash between the eventual >executable "python" and the "Python" directory. That's easily fixed in >the Makefile by setting the EXE=".exe" variable. Indeed. That has to be done in the top-level and the Modules Makefile's. Darn, why did I choose to make my disk HFS+?! And in the Modules makefile, # This target is used by the master Makefile to link the final binary. link: $(MAINOBJ) $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) $(MAINOBJ) \ $(LDLIBRARY) $(MODLIBS) $(LIBS) $(SYSLIBS) -o python$(EXE) $(LDLAST) mv python$(EXE) ../python$(EXE) I had to add $(EXE) after -o. Now during "make install"... export PATH; PATH="`pwd`:$PATH"; \ export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ cd ./Lib/plat-next; ./regen python ../../Tools/scripts/h2py.py /usr/include/fcntl.h ./regen: permission denied: python [3] The regen script just executes python, not python.exe. So I executed 'alias python /usr/local/bin/python1.6.exe' and tried again -- that worked. After it was all done I snipped the .exe's off the executables in /usr/local/bin. 4.4 BSD (wyatdo) (ttyp0) login: doug Password: Welcome to Darwin! [wyatdo:~] doug% python Python 1.6a2 (#8, 05/22/00, 12:34:49) [GCC Apple DevKit-based CPP 5.0] on next Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam >>> Cool! Doug -- Doug Wyatt doug@sonosphere.com http://www.sonosphere.com/ <- new: review of Mother Mallard at the Smithsonian From jack@oratrix.nl Mon May 22 19:48:05 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 22 May 2000 20:48:05 +0200 Subject: [Pythonmac-SIG] Python on Mac OS X In-Reply-To: Message by Doug Wyatt , Mon, 22 May 2000 12:49:34 -0400 , Message-ID: <20000522184811.5C9E5D8397@oratrix.oratrix.nl> Recently, Doug Wyatt said: > [wyatdo:~] doug% python > Python 1.6a2 (#8, 05/22/00, 12:34:49) [GCC Apple DevKit-based CPP 5.0] on ne > xt > Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam > >>> > > Cool! If you're feeling adventurous and you're swimming in spare time you could try to add some of the mac-specific modules and see what happens. Nav might be one that does something interesting if it can be gotten to work. But don't spend too much time on it: my guess is that migrating from MacPython to MacOSXPython will be the easier route than migrating from NextPython, given carbon. -- 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 May 25 14:45:00 2000 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Thu, 25 May 2000 09:45:00 -0400 Subject: [Pythonmac-SIG] Quiet lately? Here's a big one.... Message-ID: <8B049D471C61D111847C00805FA67B1C04FE2F8A@usa0129ms1.ess.mc.xerox.com> Folks, I'm not a big Applescript person, and in fact I just downloaded the docs for it (applescript) yesterday... But, I'm looking at ways to automate our macintosh's here at work. We're currently using QA PARTNER, which is no longer supported for the Mac platform. I've noticed talk about "Sendkeys" for the PC, which allows keyboard control, etc. What rough equivalents, and aids are there for the Macintosh? I know you can do a lot with Applescript, but we're talking about choosing items from picklists, etc. - Benjamin From Benjamin.Schollnick@usa.xerox.com Thu May 25 18:11:10 2000 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Thu, 25 May 2000 13:11:10 -0400 Subject: [Pythonmac-SIG] Eventtalker? Message-ID: <8B049D471C61D111847C00805FA67B1C04FE2F8F@usa0129ms1.ess.mc.xerox.com> Folks, I don't see any mention in the Python Documentation (including Mac specific) in regards to "EVENTTALKER"? I'm assuming it's a interface into the Applescript/AppleEvents interface, but I don't see any documentation on it, nor how to use it. Can anyone point me in the right direction to learn about this interface? - Benjamin From jack@oratrix.nl Fri May 26 12:30:48 2000 From: jack@oratrix.nl (Jack Jansen) Date: Fri, 26 May 2000 13:30:48 +0200 Subject: [Pythonmac-SIG] Quiet lately? Here's a big one.... In-Reply-To: Message by "Schollnick, Benjamin" , Thu, 25 May 2000 09:45:00 -0400 , <8B049D471C61D111847C00805FA67B1C04FE2F8A@usa0129ms1.ess.mc.xerox.com> Message-ID: <20000526113053.23CA0D8397@oratrix.oratrix.nl> Benjamin, AppleScript will allow you very nice control over any application that supports it. Actually, it is not AppleScript per se but the underlying stuff, called Open Scripting Architecture. And, as Python can also generate OSA commands you can indeed control lots of applications from Python. There's a short introduction in the "applescript" section in Python:Mac:Demo (applescript.html, I think it is). Controlling low-level things, like pressing specific buttons or selecting certain items from a list in a dialog is not "the official applescript way", but as it is often useful for controlling applications that don't (fully) support applescript there are ways to do this. The two that i know of are QuickKeys and KeyQuencer. Both of these allow you to put things like "press button labeled "OK" from topmost dialog" or "type "A"" or such in your applescript (or your Python script: these things are modeled as applescript extensions, so you can also call them from Python with a bit of work). It is indeed a good idea to first read Apple's applescript documentation. I know that I had quite some difficulty understanding it at first, because this high-level philosophy is a good idea once you understand it, but it is rather unlike what any other scripting language provides. -- 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 w_keller@gmx.de Sun May 28 17:27:27 2000 From: w_keller@gmx.de (Wolfgang Keller) Date: Sun, 28 May 2000 18:27:27 +0200 Subject: [Pythonmac-SIG] Quiet lately? Here's a big one.... In-Reply-To: <20000526113053.23CA0D8397@oratrix.oratrix.nl> References: Message by "Schollnick, Benjamin" , Thu, 25 May 2000 09:45:00 -0400 , <8B049D471C61D111847C00805FA67B1C04FE2F8A@usa0129ms1.ess.mc.xerox.com> Message-ID: At 13:30 Uhr +0200 26.05.2000, Jack Jansen wrote: >And, as Python can also >generate OSA commands you can indeed control lots of applications from >Python. Unfortunately the reverse seems to be not possible (like calling Python functions/methodes from Applescript, getting/setting attributes etc.). :-( Wolfgang Keller Zu Risiken und Nebenwirkungen von Junkmail lesen Sie de.admin.net-abuse.mail und fragen sie Ihren Postmaster oder Provider From erik@petr.nl Sun May 28 18:43:10 2000 From: erik@petr.nl (Erik van Blokland) Date: Sun, 28 May 2000 18:43:10 +0100 Subject: [Pythonmac-SIG] Quiet lately? Here's a big one.... Message-ID: <200005281540.RAA05299@rietveld.petr.nl> >At 13:30 Uhr +0200 26.05.2000, Jack Jansen wrote: >>And, as Python can also >>generate OSA commands you can indeed control lots of applications from >>Python. > >Unfortunately the reverse seems to be not possible (like calling Python >functions/methodes from Applescript, getting/setting attributes etc.). :-( Using MiniAEFrame you can build a script that responds to specific appleevents, which you can call directly from ScriptEditor/AppleScript using that weird direct-event-calling syntax. Documented here: http://developer.apple.com/techpubs/macos8/InterproCom/ AppleScriptScripters/AppleScriptLangGuide/AppleScript.60.html#33963 (URL should be 1 line) If you add nicely defined aete resources, you can write the higher level applescript language that you can use in ScriptEditor/AppleScript. The only editor for aete resources I've found it Resorcerer, costs something but is worth it. http://www.mathemaesthetics.com/GenInfo.html Hope this helps, Erik van Blokland -- letterror From pythonmac-sig@python.org Mon May 29 07:29:05 2000 From: pythonmac-sig@python.org (Peter Funk) Date: Mon, 29 May 2000 08:29:05 +0200 (MEST) Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) (fwd) Message-ID: Hi, [me on python-dev]: > > Is there a reliable algorithm to find a "per-user" directory on any > > Win95/98/NT/2000 system? On MacOS? [response from Guido van Rossum]: > The Mac doesn't have an environment at all. > > > Idea: Wouldn't it be nice if the 'nt' and 'mac' versions of the 'os' > > module would provide 'os.environ["HOME"]' similar to the posix > > version? This would certainly simplify the task of application > > programmers intending to write portable applications. > > This sounds like a nice idea... My mac knowledge is still very limited. But recently I saw on a Mac running some MacOS Version 9.X a login dialogbox asking for 'username' and 'password'. Since this was a very new G400 without any third party stuff installed on, I guess some form of user accounts have been added to recent versions of MacOS. Right? May be someone working with the Mac on daily basis (Jack? Just?) can shed some light on this? Is there something like a per user directory on newer versions of MacOS? And if so, how to figure it out? Regards, Peter From jack@oratrix.nl Mon May 29 10:35:21 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 29 May 2000 11:35:21 +0200 Subject: [Pythonmac-SIG] Quiet lately? Here's a big one.... In-Reply-To: Message by Erik van Blokland , Sun, 28 May 2000 18:43:10 +0100 , <200005281540.RAA05299@rietveld.petr.nl> Message-ID: <20000529093522.23DC0370CF2@snelboot.oratrix.nl> > Using MiniAEFrame you can build a script that responds to specific > appleevents, which you can call directly from ScriptEditor/AppleScript > using that weird direct-event-calling syntax. Documented here: > > http://developer.apple.com/techpubs/macos8/InterproCom/ > AppleScriptScripters/AppleScriptLangGuide/AppleScript.60.html#33963 > (URL should be 1 line) > > If you add nicely defined aete resources, you can write the higher level > applescript language that you can use in ScriptEditor/AppleScript. The > only editor for aete resources I've found it Resorcerer, costs something > but is worth it. There's an aete parser in gensuitemodule, so using that as documentation it shouldn't be too difficult to create a Python module that creates aete resources. Creating a genmoduleaete.py (or genclassaete.py, which is probably better) which creates a aete resource given a description (and which could possibly also generate the glue code which has to sit between MiniAEFrame and your class implementation) should be a couple of days work. If someone feels the urge I'll gladly accept contributed 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 Mon May 29 10:41:47 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 29 May 2000 11:41:47 +0200 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) (fwd) In-Reply-To: Message by pf@artcom-gmbh.de (Peter Funk) , Mon, 29 May 2000 08:29:05 +0200 (MEST) , Message-ID: <20000529094147.E5F29370CF2@snelboot.oratrix.nl> > My mac knowledge is still very limited. But recently I saw on a Mac running > some MacOS Version 9.X a login dialogbox asking for 'username' and 'password'. > Since this was a very new G400 without any third party stuff installed on, > I guess some form of user accounts have been added to recent versions of > MacOS. Right? MacOS 9 logins are rumoured to be not all that stable, and to interfere with things like backups and timed tasks, so I've stayed away from them so far. I don't know whether there is something like a user home directory. MacOS X turns the world inside out, where to the user his/her home directory appears as the root of the world. I don't know whether this is something that's handled at os/filesystem level, or whether it's just the finder doing this magic. If the former then a fixed pathname will work for HOME, and if the latter MacPython will be able to use the finder algorithm to find something to stuff in HOME. But note that 99% of the code that uses os.environ['HOME'] uses it to stuff dot-files in there, or obtain a point to store a mail folder or some such. And these things should be done differently on the Mac anyway, so putting a value into HOME may do more harm than good. -- 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 djfashena@earthlink.net Mon May 29 13:28:05 2000 From: djfashena@earthlink.net (David and Jessica Fashena) Date: Mon, 29 May 2000 07:28:05 -0500 Subject: [Pythonmac-SIG] how to interrupt a running script in 1.6a2 ? Message-ID: Hello all, I have just begun using Python and have a basic question. I was running a script (pi.py) in the Python 1.6a2/Demo/scripts folder to calculate Pi forever. Having seen a few thousand digits, I was unable to halt the program, and ultimately had to force a machine restart. I tried a number of different key combinations e.g. cntrl-c, cntrl-d, ESC, command- etc. Is there a way to halt a running script? thanks much, dave fashena P.S. Machine info: PowerMac G3, beige, 266 MHz From just@letterror.com Mon May 29 15:10:07 2000 From: just@letterror.com (Just van Rossum) Date: Mon, 29 May 2000 15:10:07 +0100 Subject: [Pythonmac-SIG] how to interrupt a running script in 1.6a2 ? In-Reply-To: Message-ID: At 7:28 AM -0500 29-05-2000, David and Jessica Fashena wrote: >Hello all, > >I have just begun using Python and have a basic question. I was running a >script (pi.py) in the Python 1.6a2/Demo/scripts folder to calculate Pi >forever. Having seen a few thousand digits, I was unable to halt the >program, and ultimately had to force a machine restart. I tried a number >of different key combinations e.g. cntrl-c, cntrl-d, ESC, command- etc. > >Is there a way to halt a running script? command-period should work (not control). If that fails (which it shouldn't in this case) command-option-shift-escape does a "force-quit", which should work for any running app. Just From pf@artcom-gmbh.de Mon May 29 16:32:08 2000 From: pf@artcom-gmbh.de (Peter Funk) Date: Mon, 29 May 2000 17:32:08 +0200 (MEST) Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) (fwd) In-Reply-To: <20000529094147.E5F29370CF2@snelboot.oratrix.nl> from Jack Jansen at "May 29, 2000 11:41:47 am" Message-ID: Hi Jack! Thank you for your response. The Mac and the philosphy behind MacOS is still an alien world to me (and maybe others also). > But note that 99% of the code that uses os.environ['HOME'] uses it to stuff > dot-files in there, or obtain a point to store a mail folder or some such. Let me try to explain 'some such' as follows: data which is somewhat related to a particular user (e.g. personal preferences: adjustements which represent the personal taste of a user). This data should not be lost, 1. if a new version of the software package is installed. or 2. if another user (e.g. a colleague) uses the computer. > And > these things should be done differently on the Mac anyway, so putting a value > into HOME may do more harm than good. So let me ask: If differently: *HOW* should this things be done on the Mac? On a Unixoid system for example I would use os.path.join(os.environ["HOME"], ".myapplication", "preferences") What should an application programmer use on the Mac instead? Is there nothing else than the global preferences subfolder in the systemfolder? And how to figure the pathname of this one out on a Mac running for example the german version of MacOS, where this is called "System Ordner"... Is there an API exposed to Python? I'm not aware of anything. Regards, Peter From jwblist@olympus.net Mon May 29 18:16:40 2000 From: jwblist@olympus.net (John W Baxter) Date: Mon, 29 May 2000 10:16:40 -0700 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) (fwd) In-Reply-To: <20000529094147.E5F29370CF2@snelboot.oratrix.nl> References: <20000529094147.E5F29370CF2@snelboot.oratrix.nl> Message-ID: At 11:41 +0200 5/29/2000, Jack Jansen wrote: >MacOS 9 logins are rumoured to be not all that stable, and to interfere with >things like backups and timed tasks, so I've stayed away from them so far. I >don't know whether there is something like a user home directory. Mac OS 9 multi-user certainly destabilized my 8100. I stopped using it and the machine became happy again. I haven't tried under Mac OS 9.04: I had no compelling reason to use multi-user anyhow (there is only one of me). --John (hey, what do you mean "only one of me"...we're in here too!) Baxter -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jwblist@olympus.net Mon May 29 18:29:00 2000 From: jwblist@olympus.net (John W Baxter) Date: Mon, 29 May 2000 10:29:00 -0700 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) (fwd) In-Reply-To: References: Message-ID: At 17:32 +0200 5/29/2000, Peter Funk wrote: >Let me try to explain 'some such' as follows: data which is somewhat >related to a particular user (e.g. personal preferences: adjustements >which represent the personal taste of a user). This data should not >be lost, > 1. if a new version of the software package is installed. >or 2. if another user (e.g. a colleague) uses the computer. > >> And >> these things should be done differently on the Mac anyway, so putting a >>value >> into HOME may do more harm than good. > >So let me ask: If differently: *HOW* should this things be done on the Mac? One way would be to use Mac OS 9's multi-user feature (IF it is stable on one's Macs, as it is not on my 8100). Each different user login has its own Preferences folder, own Documents folder, etc. The OS call which returns references to those folders and many others--which has been around since 1991--returns the folders related to the current user when Mac OS 9 multi user is in use. That is the FindFolder() function in the C/C++ APIs...I haven't examined that part of Mac Python to see how it is called in Python. Otherwise, you can use techniques similar to those used in the networking area (except one...see below)...every networking-related control panel has a Configurations... command in its File menu, wherein configurations can be created and selected. The Location Manager, in turn, and select the configurations for a particular location. (Location Manager was created for laptops...hence the name; it later moved into the desktop machines.) The exception to "every networking-related..." above is the Internet control panel, which has the selection of "sets" in its main window. These function similarly. ------- You could implement something similar to one or the other of those, without concerns about Mac OS 9 Multi-User. [Indeed, each Mac OS 9 multi-user login's TCP/IP control panel--to pick a concrete example--has its own set of configurations.] ------ Unfortunately (or fortunately), until Mac OS 9, a Mac was a "personal" computer...it didn't have the concept of multiple users. So outside of Mac OS 9 multi-user, you'll have to devise a solution. --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jdurchen@polytopic.com Mon May 29 20:37:42 2000 From: jdurchen@polytopic.com (James Durchenwald) Date: Mon, 29 May 2000 14:37:42 -0500 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) (fwd) In-Reply-To: References: Message-ID: This is my first post to this list but I think I can shed some light on this. You should go ahead and change the "global" preference. I believe that the OS copies all of the changed configs out of the system folder into a user's system folder when they log out. Conversely, when the user logs in, the information is copied into the system folder. This is definitely different than the way most multiuser systems handle this, but it is backwards compatible to the previous "one user" way that Mac philosophy was built upon. This might take a little experimenting to confirm, but I believe that this is the way to handle it. I think that apple did this to allow multiuser support on machines that will not be supported by MacOS X. This has been a big request for a long time from Mac users that will be solved by MacOS X, but unfortunately, the machines that this is officially supported on is relatively small at the present. (Though reports are that it might work on earlier systems such as the 8600/9600 seriese machines *crosses fingers*) :) James >Hi Jack! > >Thank you for your response. The Mac and the philosphy behind MacOS is >still an alien world to me (and maybe others also). > >> But note that 99% of the code that uses os.environ['HOME'] uses it to stuff >> dot-files in there, or obtain a point to store a mail folder or some such. > >Let me try to explain 'some such' as follows: data which is somewhat >related to a particular user (e.g. personal preferences: adjustements >which represent the personal taste of a user). This data should not >be lost, > 1. if a new version of the software package is installed. >or 2. if another user (e.g. a colleague) uses the computer. > >> And >> these things should be done differently on the Mac anyway, so >>putting a value >> into HOME may do more harm than good. > >So let me ask: If differently: *HOW* should this things be done on the Mac? > >On a Unixoid system for example I would use > os.path.join(os.environ["HOME"], ".myapplication", "preferences") >What should an application programmer use on the Mac instead? > >Is there nothing else than the global preferences subfolder in the >systemfolder? And how to figure the pathname of this one out on a Mac >running for example the german version of MacOS, where this is called >"System Ordner"... Is there an API exposed to Python? I'm not aware >of anything. > >Regards, Peter -- jdurchen@murl.com - VP Service Enhancement - MURL.com Have you checked out http://murl.com yet? From savageb@pacbell.net Mon May 29 21:12:47 2000 From: savageb@pacbell.net (Bob Savage) Date: Mon, 29 May 2000 13:12:47 -0700 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) In-Reply-To: Message-ID: Peter Funk wrote: > So let me ask: If differently: *HOW* should this things be done on the Mac? John Baxter wrote: > One way would be to use Mac OS 9's multi-user feature (IF it is stable on > one's Macs, as it is not on my 8100). Each different user login has its > own Preferences folder, own Documents folder, etc. The OS call which > returns references to those folders and many others--which has been around > since 1991--returns the folders related to the current user when Mac OS 9 > multi user is in use. That is the FindFolder() function in the C/C++ > APIs...I haven't examined that part of Mac Python to see how it is called > in Python. James Durchenwald wrote: > You should go ahead and change the "global" preference. Jack Jansen wrote: > MacOS X turns the world inside out I think we are all saying the same things largely, but I thought it could be organized differently. Pre-MacOS 9 get preferences via FindFolder() [caveat: global preferences change] MacOS 9 without Multi-User turned on get preferences via FindFolder() [caveat: global preferences change] MacOS 9 *with* Multi-User get preferences via FindFolder() [caveat: MU was hacked onto a single-user system so it can introduce some instability. I have noticed this myself, and would say that it "sort of" works.] MacOS X get preferences via FindFolder() os.environ['HOME'] ?? [caveat: insert moving target warning here (see below)] Some specifics: * macfs.FindFolder "FindFolder (where, which, create) Locates one of the ``special'' folders that MacOS knows about, such as the trash or the Preferences folder. where is the disk to search, which is the 4-character string specifying which folder to locate. Setting create causes the folder to be created if it does not exist. Returns a (vrefnum, dirid) tuple." -- look in the docs for more. The multiple users feature of MacOS 9 will ensure that you receive the correct one. As James Durchenwald pointed out, this is done through some sleight of hand. The folders are swapped in and out by the system so that older apps will get what they expect. * MacOS X Still in development and represents a major change to the "MacOS Philosophy". Documentation is just appearing, but I think it is fair to say that changes are to be expected up through July at least. As to FindFolder, this method is "Carbon Compliant" (meaning that it will be there in MacOS X) but I think that there will be some work needed when X ships; The standard behavior under X seems to be to put preferences in ~/Library/[appname] instead of the current standard of putting everything in the "Preferences" folder -- will a request via FindFolder return the user's Library directory? or perhaps the ~/Library/Carbon directory? I don't know. Regarding "os.environ['HOME']": Apple is putting out a new version of "Inside Macintosh". A "Preliminary" version of "Inside Mac OS X: System Overview" was released a couple of weeks ago: . I quote: "In developer versions of Mac OS X, the kernal environment exports BSD services and commands to the upper layers of the system through the System framework. User versions of Mac OS X do not." Does this mean that there will be an API for accessing BSD environment variables or not? I don't know. Best of luck with your project, Bob Savage From jack@oratrix.nl Mon May 29 22:56:53 2000 From: jack@oratrix.nl (Jack Jansen) Date: Mon, 29 May 2000 23:56:53 +0200 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) In-Reply-To: Message by Bob Savage , Mon, 29 May 2000 13:12:47 -0700 , Message-ID: <20000529215658.ABA6FDDDE0@oratrix.oratrix.nl> Okay, from all the bits of knowledge imparted by the various contributors (thanks! this was all news to me!) I think we can safely assume that the following code will work under all macos versions, regardless of whether they're multiuser, 8, 9, X or whatever: vrefnum, curdir = macfs.FindFolder(-1, 'pref', 0) fss = macfs.FSSpec((vrefnum, curdir, 'myapplication preferences')) filename = fss.as_pathname() and if you're feeling fancy you can use the kOnSystemDisk constant for '-1' and the kDontCreate for 0 (or something like that). BTW: I doubt that MacOS9 actually copies the preferences folder around, as someone suggested, I would guess that it simply adjusts the value returned by FindFolder. Programs that don't use FindFolder but hardcoded pathnames get stomped on rather seriously in non-US MacOS versions since about 1992, so I don't think there's many of them left. -- 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 Tue May 30 05:48:33 2000 From: jwblist@olympus.net (John W Baxter) Date: Mon, 29 May 2000 21:48:33 -0700 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) In-Reply-To: <20000529215658.ABA6FDDDE0@oratrix.oratrix.nl> References: <20000529215658.ABA6FDDDE0@oratrix.oratrix.nl> Message-ID: At 23:56 +0200 5/29/2000, Jack Jansen wrote: >BTW: I doubt that MacOS9 actually copies the preferences folder >around, as someone suggested, I would guess that it simply adjusts the >value returned by FindFolder. Programs that don't use FindFolder but >hardcoded pathnames get stomped on rather seriously in non-US MacOS >versions since about 1992, so I don't think there's many of them left. I believe Jack is correct about the not-copying of the special folders. Some programs work under Mac OS 9.x but fail under Mac OS 9.x with multi user on, largely because they "know" where the special folders are instead of asking. (MPW except the very new development version is one such.) --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From jdurchen@polytopic.com Tue May 30 22:13:31 2000 From: jdurchen@polytopic.com (James Durchenwald) Date: Tue, 30 May 2000 16:13:31 -0500 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) In-Reply-To: References: <20000529215658.ABA6FDDDE0@oratrix.oratrix.nl> Message-ID: It was I that actually said that. When logging out you get a VERY noticeable delay that I had attributed to the OS copying files. (There is also disk activity at logout time.) That was why I figured they had done something skanky like actually copying the files. I could most definitely been wrong. I could test this tonight when I get home to my Multiuser system if anyone cares. James >At 23:56 +0200 5/29/2000, Jack Jansen wrote: >>BTW: I doubt that MacOS9 actually copies the preferences folder >>around, as someone suggested, I would guess that it simply adjusts the >>value returned by FindFolder. Programs that don't use FindFolder but >>hardcoded pathnames get stomped on rather seriously in non-US MacOS >>versions since about 1992, so I don't think there's many of them left. > >I believe Jack is correct about the not-copying of the special folders. >Some programs work under Mac OS 9.x but fail under Mac OS 9.x with multi >user on, largely because they "know" where the special folders are instead >of asking. (MPW except the very new development version is one such.) > > --John >-- >John Baxter jwblist@olympus.net Port Ludlow, WA, USA -- jdurchen@murl.com - VP Service Enhancement - MURL.com Have you checked out http://murl.com yet? From savageb@pacbell.net Tue May 30 23:03:11 2000 From: savageb@pacbell.net (Bob Savage) Date: Tue, 30 May 2000 15:03:11 -0700 Subject: [Pythonmac-SIG] MOSX prefs -- again Message-ID: 'Lo all, I was perusing the MacOS-X docs online and I came across this: * > CFPreferences > > We have added new API to CFPreferences to support framework and suite > developers. First, we have added the constant > kCFPreferencesCurrentApplication; frameworks can pass this constant in place > of the application's name to retrieve preferences for the currently running > application. > > Secondly, we have made it possible for suites and frameworks to add their > preferences to an application's preferences. To add your suite preferences, > call CFPreferencesAddSuitePreferencesToApp(), passing the application's name > (or kCFPreferencesCurrentApplication for the currently running application) > and the name of your suite preferences. You can later remove your preferences > by calling CFPreferencesRemoveSuitePreferencesFromApp() if you wish. Finally, > set preferences for your suite by calling CFPreferencesSetValue(), passing > your suite's name in place of the application name. The user name and host > name arguments are as for applications; typically, you will pass a user name > of kCFPreferencesCurrentUser and a host name of kCFPreferencesAnyHost. CF refers to Core Foundation which is a part of Core Services -- the layer resting directly on top of the Kernel, and is well beneath both the "Cocoa" and "Carbon" layers. I believe, therefore, that it is available to both API sets, or perhaps more acurately it is implemented in them both, invoking CFPreferencesSetValue or whatever is appropriate. (BTW, I like that "Host" bit! Sounds great in a computer lab environment) Bob * Source: ---- "The obvious road is almost always a fool's road." - W.S. Burroughs From savageb@pacbell.net Tue May 30 23:11:08 2000 From: savageb@pacbell.net (Bob Savage) Date: Tue, 30 May 2000 15:11:08 -0700 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) In-Reply-To: Message-ID: on 5/30/00 2:13 PM, James Durchenwald wrote: > It was I that actually said that. When logging out you get a VERY > noticeable delay that I had attributed to the OS copying files. > (There is also disk activity at logout time.) That was why I figured > they had done something skanky like actually copying the files. I > could most definitely been wrong. I could test this tonight when I > get home to my Multiuser system if anyone cares. > James, I would like to hear what you find out. I noticed that my system behaves fine for a while, but when my wife logs out something goes haywire; I end up with her desktop prefs and the apple menu shows her "favorites" folder instead of mine (although Nav services using apps -- such as Outlook -- have access to my "favorites" because I can still use it from the save and open dialog boxes). If it is a bother, don't trouble yourself on my account. best, Bob From savageb@pacbell.net Tue May 30 23:13:15 2000 From: savageb@pacbell.net (Bob Savage) Date: Tue, 30 May 2000 15:13:15 -0700 Subject: [Pythonmac-SIG] MOSX prefs -- again In-Reply-To: Message-ID: on 5/30/00 3:03 PM, Bob Savage wrote: > CFPreferencesSetValue or whatever is appropriate. Whoops! *AS* appropriate From jdurchen@murl.com Wed May 31 03:08:17 2000 From: jdurchen@murl.com (jdurchen@murl.com) Date: Tue, 30 May 2000 21:08:17 -0500 Subject: [Pythonmac-SIG] Re: Per user dirs on Non-Unix platforms (was Re: [Python-Dev] Where to install non-code files) Message-ID: <200005310208.VAA17583@www.polytopic.com> I took a look at it and actually, it appers that the OS "blesses" the folder in the User's directory. I am sure that if I did a find folder, it would return this specific user directory. So in essence, it appears that the new MacOS9.0.4 multiuser system behaves a bit more Unix like than I first thought. In a standard user folder there is (Just after creating a new account) 1. Apple Menu Items 2. Desktop Pictures 3. Documents 4. Favorites (For Nav Services) 5. Internet Search Sites (Sherlock Plugins???) 6. Launcher Items 7. Preferences 8. PrintMonitor Documents 9. Shutdown Items 10. Startup Items James On Tue, May 30, 2000, at 04:11:08 pm Bob Savage wrote: > on 5/30/00 2:13 PM, James Durchenwald wrote: > > > It was I that actually said that. When logging out you get a VERY > > noticeable delay that I had attributed to the OS copying files. > > (There is also disk activity at logout time.) That was why I figured > > they had done something skanky like actually copying the files. I > > could most definitely been wrong. I could test this tonight when I > > get home to my Multiuser system if anyone cares. > > > > James, I would like to hear what you find out. I noticed that my > system > behaves fine for a while, but when my wife logs out something goes > haywire; > I end up with her desktop prefs and the apple menu shows her > "favorites" > folder instead of mine (although Nav services using apps -- such as > Outlook > -- have access to my "favorites" because I can still use it from the > save > and open dialog boxes). > > If it is a bother, don't trouble yourself on my account. > > best, > > Bob > > > > James Durchenwald jd@murl.com VP Service Enhancement 319.369.0344x203 Organize, store, and share your favorite bookmarks -- anytime, anywhere, FREE! ------------------------------------------------------------------ You've received MurlMail! -- FREE, web-based email, accessible anywhere, anytime from any browser-enabled device. Sign up now at http://murl.com Murl.com - At Your Service From sbender@harmony-ds.com Wed May 31 22:59:54 2000 From: sbender@harmony-ds.com (Scott Bender) Date: Wed, 31 May 2000 17:59:54 -0400 Subject: [Pythonmac-SIG] MacOS / MPW & Command line arguments? Message-ID: <015801bfcb4b$91904480$2c8c56cf@harmonyds.com> I need to be able to run the python interpreter from a script in MPW and the python program needs arguments. When I try to do this from MPW I get the following: PythonInterpreter some_argument ### MPW Shell - Unable to create the finder parameter list for this application. ### MPW Shell - Unable to get information on "". # File not found (OS error -43) Is there any way to make this work? thanks, - Scott