From danielt3@gte.net Fri Mar 1 17:28:41 2002 From: danielt3@gte.net (Daniel T.) Date: Fri, 1 Mar 2002 12:28:41 -0500 Subject: [Pythonmac-SIG] Help building an extension? Message-ID: Hi, I'm trying to build the "Noddy" extension from the docs but I can't seem to get it to build. I got the .slb compiled and wrote the setup.py like it said to do, then I option-drag the setup.py into the PythonInterpreter, and put 'build' in the command line. Then a window pops up, where it looks like I should type --verbose build? Then the windows comes up saying that it's building but it never seems to finish. What am I doing wrong? TIA -- From kp87@lycos.com Fri Mar 1 17:36:04 2002 From: kp87@lycos.com (kevin parks) Date: Sat, 02 Mar 2002 02:36:04 +0900 Subject: [Pythonmac-SIG] Gnu readlines? Message-ID: MacPythonians, I have always wanted the Python interpreter to behave a bit more like a shell, with a history and command-line editing, etc. I have always found the interpreter to be really unfriendly, which is a shame since Python invites you to fiddle about in the interpreter, yet the interpreter is so unforgiving. There is GNU readlines. Ironically, UNIX people, who have shells already really don't need this functionality as much as us shell-less mac folks, yet we don't have the GNU readlines available do we? Or is there one that works with MacPython? I love Python so much, but the interpreter is really a dog. Any chance the Gnu readlines stuff will ever be added to MacPython? I am not so keen on how the cursor behaves in the interpreter either. It seem (compared to a shell or wish(TCL) that you can click and type places that you shouldn't be able and sometimes the interpreter farts on you if you put the cursor in a nasty place (say you copy and or paste something and forget that you are no t at the end of the current line and accidentally hit return. An interpreter "recorder" which logs your last 100 or so interpreter moves would be great too. I always mess around in the interpreter, discover something cool and then forget how to recreate it when I am trying to incorporate my fiddlings into a module or script. I still don't care much for our stone-age IDE either (sorry, but now that i have seen python under *nix and windoze...), but did i mention how much i love Python? And how grateful i am that it is on the mac? I do love it, really! But it is like a really pretty <__> boy / <__> girl (check which ever applies to you) in very ugly clothes and a bad hair-do (on a mac anyway). Cheers, kevin 2,000,000,000 Web Pages--you only need 1. Save time with My Lycos. http://my.lycos.com From kp87@lycos.com Sat Mar 2 18:39:20 2002 From: kp87@lycos.com (kevin parks) Date: Sun, 03 Mar 2002 03:39:20 +0900 Subject: [Pythonmac-SIG] SciPy Message-ID: I am guessing that there is no SciPy build for MacOS? 2,000,000,000 Web Pages--you only need 1. Save time with My Lycos. http://my.lycos.com From Jack.Jansen@oratrix.com Sat Mar 2 22:51:31 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sat, 2 Mar 2002 23:51:31 +0100 Subject: [Pythonmac-SIG] Help building an extension? In-Reply-To: Message-ID: <09CEC845-2E30-11D6-A476-003065517236@oratrix.com> On vrijdag, maart 1, 2002, at 06:28 , Daniel T. wrote: > Hi, > > I'm trying to build the "Noddy" extension from the docs > but I > can't seem to get it to build. > > I got the .slb compiled and wrote the setup.py like it said to > do, then I option-drag the setup.py into the PythonInterpreter, > and put 'build' in the command line. > > Then a window pops up, where it looks like I should type > --verbose build? You don't need to option-drag setup.py: On the Mac setup.py will present you with a (slightly) more mac-like dialog where you can fill out the command line. That's the second dialog you got. So just doubleclick setup.py and type (or select) "build" in the command line there. > Then the windows comes up saying that it's building but it > never seems to finish. At what step does it hang? Has it already fired up CodeWarrior? Maybe if you post the output in the setup.py window here that'll make things a bit clearer. I do also so occasional hangs with distutils, where it doesn't seem to talk to CodeWarrior, but usually trying again cures it. I haven't yet looked into what could be causing this. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From steve@spvi.com Sat Mar 2 22:56:32 2002 From: steve@spvi.com (Steve Spicklemire) Date: Sat, 2 Mar 2002 17:56:32 -0500 Subject: [Pythonmac-SIG] SciPy In-Reply-To: Message-ID: You can use the fink port of scientific python: find.sourceforge.net -steve On Saturday, March 2, 2002, at 01:39 PM, kevin parks wrote: > I am guessing that there is no SciPy build for MacOS? > > > > > > > 2,000,000,000 Web Pages--you only need 1. Save time with My Lycos. > http://my.lycos.com > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From Jack.Jansen@oratrix.com Sat Mar 2 23:42:38 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sun, 3 Mar 2002 00:42:38 +0100 Subject: [Pythonmac-SIG] Gnu readlines? In-Reply-To: Message-ID: <2E41EBDA-2E37-11D6-A476-003065517236@oratrix.com> On vrijdag, maart 1, 2002, at 06:36 , kevin parks wrote: > MacPythonians, > > I have always wanted the Python interpreter to behave a bit > more like a shell, with a history and command-line editing, > etc. I have always found the interpreter to be really > unfriendly, which is a shame since Python invites you to fiddle > about in the interpreter, yet the interpreter is so > unforgiving. There is GNU readlines. Last time I checked (which was many years ago, admittedly) GNU Readline was very unix-specific. It did all its magic with funny stty settings. Plus: the functionality the SIOUX console gives you isn't really good enoughb for readline (no cursor movements, clear, etc). All in all it would be a major undertaking. > I still don't care much for our stone-age IDE either (sorry, > but now that i have seen python under *nix and windoze...), What's the problem with the IDE? PythonWin with Scintilla is better, I must admit, but on unix you only have Idle, and that I find really lame. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Sat Mar 2 23:43:42 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sun, 3 Mar 2002 00:43:42 +0100 Subject: [Pythonmac-SIG] SciPy In-Reply-To: Message-ID: <53FDAFF6-2E37-11D6-A476-003065517236@oratrix.com> On zaterdag, maart 2, 2002, at 11:56 , Steve Spicklemire wrote: > You can use the fink port of scientific python: > > find.sourceforge.net I think Kevin was referrring to OS9 and MacPython, not OSX and machoPython, so the fink port isn't going to do him much good. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From just@letterror.com Sun Mar 3 09:37:47 2002 From: just@letterror.com (Just van Rossum) Date: Sun, 3 Mar 2002 10:37:47 +0100 Subject: [Pythonmac-SIG] Gnu readlines? In-Reply-To: <2E41EBDA-2E37-11D6-A476-003065517236@oratrix.com> Message-ID: <20020303103749-r01010800-fe1d9d64-0920-010c@10.0.0.23> Jack Jansen wrote: > > I have always wanted the Python interpreter to behave a bit > > more like a shell, with a history and command-line editing, > > etc. I have always found the interpreter to be really > > unfriendly, which is a shame since Python invites you to fiddle > > about in the interpreter, yet the interpreter is so > > unforgiving. There is GNU readlines. > > Last time I checked (which was many years ago, admittedly) GNU > Readline was very unix-specific. It did all its magic with > funny stty settings. Plus: the functionality the SIOUX console > gives you isn't really good enoughb for readline (no cursor > movements, clear, etc). All in all it would be a major > undertaking. And considering it won't be too long before MacPython gets absorbed completely by MachoPython in OSX, there really really is hardly any point to it at this time. A complete waste of time. Just From jsw@cdc.noaa.gov Sun Mar 3 13:34:21 2002 From: jsw@cdc.noaa.gov (Jeff Whitaker) Date: Sun, 3 Mar 2002 06:34:21 -0700 (MST) Subject: [Pythonmac-SIG] Re: Pythonmac-SIG] SciPy Message-ID: Hi: I'm a fink developer and the maintainer of the python package (and most of the scientific stuff). I've succeeded in patching scipy so that it will compile, but as of now I can't get it to run. The problem is that with apple's dynamic linker, you can't have two loadable modules (A,B) both linking the same static library (C). They compile fine, but when you try to load A and B in python, you get multiply defined symbol errors (for all the symbols in C both A and B reference), and the import fails. The only solution I know of is to recompile all of the statics libs (which in scipy case is quite a few, including libg2c and atlas) as shared libs. If anyone knows another way around this problem, I'd love to hear about it. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov 325 Broadway Web : www.cdc.noaa.gov/~jsw Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124 From prastawa@cs.unc.edu Sun Mar 3 15:07:23 2002 From: prastawa@cs.unc.edu (Marcel Prastawa) Date: Sun, 03 Mar 2002 10:07:23 -0500 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG] SciPy References: Message-ID: <3C823C2B.1090503@cs.unc.edu> Jeff Whitaker wrote: > Hi: I'm a fink developer and the maintainer of the python package (and > most of the scientific stuff). I've succeeded in patching scipy so that > it will compile, but as of now I can't get it to run. The problem is that > with apple's dynamic linker, you can't have two loadable modules (A,B) > both linking the same static library (C). They compile fine, but when you > try to load A and B in python, you get multiply defined symbol errors (for > all the symbols in C both A and B reference), and the import fails. The > only solution I know of is to recompile all of the statics libs (which in > scipy case is quite a few, including libg2c and atlas) as shared libs. > If anyone knows another way around this problem, I'd love to hear about > it. Jeff, I have experienced the same problem with Numeric and my own extension (both linked to LAPACK and ATLAS). One solution would be to compile both modules as two-level namespace extensions. This will probably be the default behavior for distutils in 2.2.1. For now, you could do this manually by editing /sw/lib/python2.2/config/Makefile. Set LDSHARED (or BLDSHARED, I can't remember which, you could change both) to "$(CC) $(LDFLAGS) -bundle -bundle_loader /sw/bin/python" Basically, you need to remove the "-flat_namespace" and the "-undefined suppress" flags. That should do the trick. BTW, I just realized that you probably don't need to compile both as two-level namespace extensions, just one of them. Marcel From jsw@cdc.noaa.gov Mon Mar 4 12:43:19 2002 From: jsw@cdc.noaa.gov (Jeff Whitaker) Date: Mon, 4 Mar 2002 05:43:19 -0700 (MST) Subject: [Pythonmac-SIG] Re: Pythonmac-SIG] SciPy In-Reply-To: <3C823C2B.1090503@cs.unc.edu> Message-ID: Marcel: Thanks for the tip. Unfortunately, when I remove the "-flat_namespace" and "-undefined suppress" flags I get lots of undefined symbols like this: cc -L/sw/lib -bundle build/temp.darwin-5.3-PowerMacintosh-2.3/_kindsmodule.o -o build/lib.darwin-5.3-PowerMacintosh-2.3/kinds/_kinds.so /usr/bin/ld: Undefined symbols: _PyDict_SetItemString _PyErr_Occurred _PyModule_GetDict _Py_BuildValue _Py_FatalError _Py_InitModule4 error: command 'cc' failed with exit status 1 I wonder how you avoided this? -Jeff On Sun, 3 Mar 2002, Marcel Prastawa wrote: > Jeff Whitaker wrote: > > Hi: I'm a fink developer and the maintainer of the python package (and > > most of the scientific stuff). I've succeeded in patching scipy so that > > it will compile, but as of now I can't get it to run. The problem is that > > with apple's dynamic linker, you can't have two loadable modules (A,B) > > both linking the same static library (C). They compile fine, but when you > > try to load A and B in python, you get multiply defined symbol errors (for > > all the symbols in C both A and B reference), and the import fails. The > > only solution I know of is to recompile all of the statics libs (which in > > scipy case is quite a few, including libg2c and atlas) as shared libs. > > If anyone knows another way around this problem, I'd love to hear about > > it. > > Jeff, > > I have experienced the same problem with Numeric and my own extension > (both linked to LAPACK and ATLAS). One solution would be to compile both > modules as two-level namespace extensions. > > This will probably be the default behavior for distutils in 2.2.1. For > now, you could do this manually by editing > /sw/lib/python2.2/config/Makefile. > Set LDSHARED (or BLDSHARED, I can't remember which, you could change > both) to > "$(CC) $(LDFLAGS) -bundle -bundle_loader /sw/bin/python" > Basically, you need to remove the "-flat_namespace" and the "-undefined > suppress" flags. > > That should do the trick. BTW, I just realized that you probably don't > need to compile both as two-level namespace extensions, just one of them. > > Marcel > > -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov 325 Broadway Web : www.cdc.noaa.gov/~jsw Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124 From prastawa@cs.unc.edu Mon Mar 4 14:57:58 2002 From: prastawa@cs.unc.edu (Marcel Prastawa) Date: Mon, 4 Mar 2002 09:57:58 -0500 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG] SciPy In-Reply-To: Message-ID: <377EA1D2-2F80-11D6-9500-000A27942780@cs.unc.edu> On Monday, March 4, 2002, at 07:43 , Jeff Whitaker wrote: > Marcel: Thanks for the tip. Unfortunately, when I remove the > "-flat_namespace" and "-undefined suppress" flags I get lots of undefined > ... [snip] ... > I wonder how you avoided this? The symbols are defined in the Python executable. You should link the extension to it by using the -bundle_loader flag. Ex: cc ... -bundle_loader /sw/bin/python.exe Adding it to BLDSHARED/LDSHARED in the Makefile should get it to work. Marcel From Jack.Jansen@oratrix.com Mon Mar 4 15:26:28 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Mon, 4 Mar 2002 16:26:28 +0100 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG] SciPy In-Reply-To: <377EA1D2-2F80-11D6-9500-000A27942780@cs.unc.edu> Message-ID: <327AD692-2F84-11D6-8AAC-0030655234CE@oratrix.com> On Monday, March 4, 2002, at 03:57 , Marcel Prastawa wrote: > > On Monday, March 4, 2002, at 07:43 , Jeff Whitaker wrote: > >> Marcel: Thanks for the tip. Unfortunately, when I remove the >> "-flat_namespace" and "-undefined suppress" flags I get lots of >> undefined >> ... [snip] ... >> I wonder how you avoided this? > > The symbols are defined in the Python executable. You should link the > extension to it by using the -bundle_loader flag. > Ex: cc ... -bundle_loader /sw/bin/python.exe > Adding it to BLDSHARED/LDSHARED in the Makefile should get it to work. Only add it to LDSHARED. This BLDSHARED/LDSHARED stuff had me baffled for a while, but it turns out to be really simple: BLDSHARED is used only when building an extension module during the normal core build process (hence the "B"), and LDSHARED is used otherwise (i.e. when using distutils on an already installed Python). To make understanding even more difficult some of the rules that makedepend added to the makefile, which turn out not to be used anyway, use LDSHARED where they should use BLDSHARED. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Benjamin.Schollnick@usa.xerox.com Mon Mar 4 18:41:06 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Mon, 04 Mar 2002 13:41:06 -0500 Subject: [Pythonmac-SIG] Applescript Confusion? Message-ID: Folks, I'm a little confused... I'm attempting to help with simplifying some automation here... I'd like to setup a Python program to automatically run some Applescript commands here.... (Freehand 10, Open command...) But I don't see any way to do the equivalent of: tell application "Macromedia Freehand 10" open "filename" end tell I suspect it's possible, but I'm not sure how to do it in python... (And I've got the OPEN syntax wrong, but my Applescript book is at home.... Anyone want to fix it?) The entire idea, is that I could use SYS.ARGV to change the name of the application, and the open target... Thus our automation becomes a little simpler... - Benjamin From billb@mousa.demon.co.uk Mon Mar 4 19:46:02 2002 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Mon, 4 Mar 2002 19:46:02 +0000 Subject: [Pythonmac-SIG] Applescript Confusion? In-Reply-To: References: Message-ID: At 1:41 pm -0500 04/03/02, Benjamin Schollnick wrote: >Folks, > > I'm a little confused... > > I'm attempting to help with simplifying some automation here... > > I'd like to setup a Python program to automatically run some > Applescript commands here.... > > (Freehand 10, Open command...) > > But I don't see any way to do the equivalent of: > > tell application "Macromedia Freehand 10" > open "filename" > end tell > > I suspect it's possible, but I'm not sure how to do it in > python... First you have to run gensuitemodule on the applescript Xtra which will give you the whole of the AE commands to Freehand you then use something like ( which actually opens a Illustrator file) import Freehand import StdSuites fh = Freehand.Freehand(start=1, timeout=10*60*60) std = StdSuites.StdSuites() fh.activate() fh.open(StdSuites.file(file +'.art'), Dialogs=0) or if you are using SYS.ARGV you use findertools findertools.launch(sys.argv[1]) which uses the finder to open the file in the files parent application and may cause problems if the application is not running and is slow to start. -- Bill Bedford You can win or you can have peace, but not at the same time. From jjackson@pobox.com Mon Mar 4 20:29:42 2002 From: jjackson@pobox.com (John Jackson) Date: Mon, 4 Mar 2002 12:29:42 -0800 Subject: [Pythonmac-SIG] Newbie question about shared libraries and QuickTime Message-ID: <8ED5D9F0-2FAE-11D6-8809-0003930925FE@pobox.com> Hi, I've been working with python on both OS 9 and OS X, and I was looking at doing some work with QuickTime. There's a couple of things I'm not clear about: 1. With the functions in the shared libraries (such as QuickTime), what's the easiest way to find the definition for the function? I can use the module browser in the IDE, and then import the function in the interactive window and get its doc string, but that's a little cumbersome. Is there an easier way, that would list the doc strings in the module browser? (Or should I just hack the module browser?...) 2. It looks like not all of QuickTime has been implemented in the shared library. Of course, the function(s) that I'm looking for is one that's not included. Is where I need to take the source for the library (_Qtmodule.c) and add the missing functions, and then recompile it? How difficult is that? I don't have an up-to-date version of Metrowerks; can this be done with downloadable compilers? I'd be happy if I got it working on either one of the platforms, and then I can get my application written and be on my way. (If you're familiar with the Apple sample code for Quicktime, I'm trying to write a python implementation of the program "MakeEffectSlideShow" which is broken and limited.) thanks for any help! ___________________ John Jackson From dp@ulaluma.com Tue Mar 5 06:50:15 2002 From: dp@ulaluma.com (Donovan Preston) Date: Mon, 4 Mar 2002 22:50:15 -0800 Subject: [Pythonmac-SIG] Newbie question about shared libraries and QuickTime In-Reply-To: <8ED5D9F0-2FAE-11D6-8809-0003930925FE@pobox.com> Message-ID: <3FADBD27-3005-11D6-AE3D-00039376B1AE@ulaluma.com> On Monday, March 4, 2002, at 12:29 PM, John Jackson wrote: > Hi, > > I've been working with python on both OS 9 and OS X, and I was looking > at doing some work with QuickTime. > > There's a couple of things I'm not clear about: > > 1. With the functions in the shared libraries (such as QuickTime), > what's the easiest way to find the definition for the function? > > I can use the module browser in the IDE, and then import the function > in the interactive window and get its doc string, but that's a little > cumbersome. Is there an easier way, that would list the doc strings in > the module browser? (Or should I just hack the module browser?...) > The best reference for any of the toolbox modules is really just Apple's Developer Documentation. It will give you the best idea of what functions are available and how they are to be used. Then, you'll know what you are looking for. As far as easy reference to the docstrings goes, you might want to try PyDoc. Does anybody know if it runs under OS 9? I have used it on X (using Mach-O Python). Running pydoc with the option to listen on a local port and then pointing your webbrowser to localhost:port is surprisingly easy and effective. > 2. It looks like not all of QuickTime has been implemented in the > shared library. Of course, the function(s) that I'm looking for is one > that's not included. Is where I need to take the source for the library > (_Qtmodule.c) and add the missing functions, and then recompile it? Good news: It's possible that the function you are looking for may have been turned into a Method of an Object by bgen, which generates the Python wrappers for the toolbox APIs. For example, Apple may have an API which looks like this: FooRef CreateFooRef(); void DoSomethingWithAFooRef(FooRef theRef); void DestroyFooRef(FooRef theRef); bgen will turn "DoSomethingWithAFooRef" into a method of the FooRef object that is created by CreateFooRef. So in python, you might do: myFooRef = CreateFooRef() myFooRef.DoSomethingWithAFooRef() (DestroyFooRef will be automatically called when the reference count drops to zero.) Or, The function you are looking for may not be visible because it's not implemented, which you can tell by looking in the "Blacklist" section of the bgen module which generates the Python wrappers. In the QuickTime module's case, it's in Modules/qt/qtscan.py. (In the source distribution of Python) Anything in the BlackListNames section will not be wrapped (although the function may be wrapped by hand) and any function which contains one of the types in BlackListTypes will not be wrapped automatically. In my experience, the QuickTime module is fairly tough to use from Python mostly because it's such a complex API and the automatic bgen wrapping doesn't always get the semantics of how to use the functions properly. Since bgen often generates perfectly valid looking code that may never be tested, it's tough to know what's in a working state and what's not. > > How difficult is that? I don't have an up-to-date version of > Metrowerks; can this be done with downloadable compilers? I'd be happy > if I got it working on either one of the platforms, and then I can get > my application written and be on my way. > Depends what your level of experience and/or patience is. On OS 9, things are easier with Codewarrior. I've read some stuff in the past about using MPW, but it's going to be frustrating enough struggling with bgen to add struggling with MPW on top of that ;-) Basically you're going to want to fix up the bgen module so that it automatically generates the correct code; sometimes that involves just manually writing a wrapper function yourself and putting it in the bgen module as one big string so it will insert that string in the output c files. > (If you're familiar with the Apple sample code for Quicktime, I'm > trying to write a python implementation of the program > "MakeEffectSlideShow" which is broken and limited.) Good luck. I'm sure Jack would love to have more people helping with the toolbox modules, if you have the time and the patience to help out. > > thanks for any help! > ___________________ > John Jackson > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From mjb@uma.pt Tue Mar 5 10:40:37 2002 From: mjb@uma.pt (Michael J. Barber) Date: Tue, 5 Mar 2002 10:40:37 +0000 Subject: [Pythonmac-SIG] Applescript Confusion? In-Reply-To: Message-ID: <6DFE417C-3025-11D6-9BED-0050E4794D0F@uma.pt> On Monday, March 4, 2002, at 06:41 PM, Schollnick, Benjamin wrote: > I'd like to setup a Python program to automatically run some > Applescript commands here.... > > (Freehand 10, Open command...) > Does Freehand 10 imply OS X? I'll assume it does... > But I don't see any way to do the equivalent of: > > tell application "Macromedia Freehand 10" > open "filename" > end tell > > I suspect it's possible, but I'm not sure how to do it in > python... > > (And I've got the OPEN syntax wrong, but my Applescript > book is at home.... Anyone want to fix it?) > I think you just need to replace 'open "filename"' by 'open alias "filename"'. I don't have Freehand around to try it, but that is at least how you can use open from a number of other apps. > The entire idea, is that I could use SYS.ARGV to change the > name of the application, and the open target... > > Thus our automation becomes a little simpler... > Bill Bedford has already explained a way to do this using an OSA interface package created by gensuitemodule. This is a good approach in general, but might be awkward if you have a large number of applications that you want to allow for. I'll suggest an alternative that MacPython won't like, but that you can use in a Unix Python: osascript. Store your script in a string and pass it to osascript through a pipe. It should look something like: import os scriptTemplate = "osascript -e 'tell app \"%s\" to open alias \"%s\"'" app = "Macromedia Freehand 10" fn = "filename" osapipe = os.popen(scriptTemplate % (app, fn), 'r') osapipe.close() Since you have to deal with quotes for AppleScript, Python, and the shell, you'll probably have to escape some of the quotes, like I did above. Hopefully, there are no unpleasant line-breaks inserted by Mail.app, but it's a simple enough script to figure out even if it did. From Jack.Jansen@oratrix.com Tue Mar 5 11:24:47 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 5 Mar 2002 12:24:47 +0100 Subject: [Pythonmac-SIG] Newbie question about shared libraries and QuickTime In-Reply-To: <3FADBD27-3005-11D6-AE3D-00039376B1AE@ulaluma.com> Message-ID: <999E7386-302B-11D6-A7B3-0030655234CE@oratrix.com> On Tuesday, March 5, 2002, at 07:50 , Donovan Preston wrote: >> 2. It looks like not all of QuickTime has been implemented in the >> shared library. Of course, the function(s) that I'm looking for is one >> that's not included. Is where I need to take the source for the >> library (_Qtmodule.c) and add the missing functions, and then >> recompile it? > > Good news: It's possible that the function you are looking for may have > been turned into a Method of an Object by bgen, which generates the > Python wrappers for the toolbox APIs. For example, Apple may have an > API which looks like this: > > FooRef CreateFooRef(); > void DoSomethingWithAFooRef(FooRef theRef); > void DestroyFooRef(FooRef theRef); > > bgen will turn "DoSomethingWithAFooRef" into a method of the FooRef > object that is created by CreateFooRef. So in python, you might do: > > myFooRef = CreateFooRef() > myFooRef.DoSomethingWithAFooRef() > > (DestroyFooRef will be automatically called when the reference count > drops to zero.) > > Or, The function you are looking for may not be visible because it's > not implemented, which you can tell by looking in the "Blacklist" > section of the bgen module which generates the Python wrappers. In the > QuickTime module's case, it's in Modules/qt/qtscan.py. (In the source > distribution of Python) Anything in the BlackListNames section will not > be wrapped (although the function may be wrapped by hand) and any > function which contains one of the types in BlackListTypes will not be > wrapped automatically. My strategy for which routines/types are blacklisted is pretty simple: if is_easy_to_fix(it): fix(it) elif I_need_it_myself(it): fix(it) test(it) # :-) else: blacklist.append(it) Quicktime is so big that I could probably spend months to make it fully accessible. But: by all means submit a bug report to sourceforge if you find something missing that you would like to use. And this doesn't only hold for quicktime: also for all the other toolbox modules. And if there's a toolbox that's missing and that you would really like covered: same thing! > In my experience, the QuickTime module is fairly tough to use from > Python mostly because it's such a complex API and the automatic bgen > wrapping doesn't always get the semantics of how to use the functions > properly. Since bgen often generates perfectly valid looking code that > may never be tested, it's tough to know what's in a working state and > what's not. For such cases you should definitely file a bug report! -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Tue Mar 5 11:29:24 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 5 Mar 2002 12:29:24 +0100 Subject: [Pythonmac-SIG] Applescript Confusion? In-Reply-To: Message-ID: <3EAA2282-302C-11D6-A7B3-0030655234CE@oratrix.com> On Monday, March 4, 2002, at 08:46 , Bill Bedford wrote: > > import Freehand > import StdSuites > fh = Freehand.Freehand(start=1, timeout=10*60*60) > std = StdSuites.StdSuites() > fh.activate() > fh.open(StdSuites.file(file +'.art'), Dialogs=0) If all works as intended Freehand.Freehand should already use the StdSuites as a base class, and start=1 implies activate(), so the following should work: import Freehand fh = Freehand.Freehand(start=1, timeout=10*60*60) fh.open(Freehand.file(file +'.art'), Dialogs=0) -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From billb@mousa.demon.co.uk Tue Mar 5 12:10:49 2002 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Tue, 5 Mar 2002 12:10:49 +0000 Subject: [Pythonmac-SIG] Applescript Confusion? In-Reply-To: <3EAA2282-302C-11D6-A7B3-0030655234CE@oratrix.com> References: <3EAA2282-302C-11D6-A7B3-0030655234CE@oratrix.com> Message-ID: At 12:29 pm +0100 05/03/02, Jack Jansen wrote: >On Monday, March 4, 2002, at 08:46 , Bill Bedford wrote: >> >> import Freehand >> import StdSuites >> fh = Freehand.Freehand(start=1, timeout=10*60*60) >> std = StdSuites.StdSuites() >> fh.activate() >> fh.open(StdSuites.file(file +'.art'), Dialogs=0) > >If all works as intended Freehand.Freehand should already use the >StdSuites as a base class, and start=1 implies activate(), The code above is part of a bigger script where activate() is needed -- sorry >so the following should work: > > import Freehand > > fh = Freehand.Freehand(start=1, timeout=10*60*60) > fh.open(Freehand.file(file +'.art'), Dialogs=0) Mmmm >>> import Freehand >>> fh = Freehand.Freehand(start=1, timeout=10*60*60) >>> fh.open(Freehand.file('Holkham:Coaches:BRW:BWK8003 Conflat L')) Traceback (most recent call last): File "", line 1, in ? AttributeError: 'module' object has no attribute 'file' >>> -- Bill Bedford You can win or you can have peace, but not at the same time. From jsw@cdc.noaa.gov Tue Mar 5 12:34:50 2002 From: jsw@cdc.noaa.gov (Jeff Whitaker) Date: Tue, 5 Mar 2002 05:34:50 -0700 (MST) Subject: [Pythonmac-SIG] Re: Pythonmac-SIG] SciPy In-Reply-To: <327AD692-2F84-11D6-8AAC-0030655234CE@oratrix.com> Message-ID: Thanks Jack and Marcel - Scipy now actually not only builds, but runs. It fails about 10% of the tests, but it's a start! I'll be committing a fink package soon. -Jeff On Mon, 4 Mar 2002, Jack Jansen wrote: > > On Monday, March 4, 2002, at 03:57 , Marcel Prastawa wrote: > > > > > On Monday, March 4, 2002, at 07:43 , Jeff Whitaker wrote: > > > >> Marcel: Thanks for the tip. Unfortunately, when I remove the > >> "-flat_namespace" and "-undefined suppress" flags I get lots of > >> undefined > >> ... [snip] ... > >> I wonder how you avoided this? > > > > The symbols are defined in the Python executable. You should link the > > extension to it by using the -bundle_loader flag. > > Ex: cc ... -bundle_loader /sw/bin/python.exe > > Adding it to BLDSHARED/LDSHARED in the Makefile should get it to work. > > Only add it to LDSHARED. This BLDSHARED/LDSHARED stuff had me baffled > for a while, but it turns out to be really simple: BLDSHARED is used > only when building an extension module during the normal core build > process (hence the "B"), and LDSHARED is used otherwise (i.e. when using > distutils on an already installed Python). To make understanding even > more difficult some of the rules that makedepend added to the makefile, > which turn out not to be used anyway, use LDSHARED where they should use > BLDSHARED. > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- Emma > Goldman - > > -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov 325 Broadway Web : www.cdc.noaa.gov/~jsw Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124 From Jack.Jansen@oratrix.com Tue Mar 5 12:51:30 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 5 Mar 2002 13:51:30 +0100 Subject: [Pythonmac-SIG] Applescript Confusion? In-Reply-To: Message-ID: On Tuesday, March 5, 2002, at 01:10 , Bill Bedford wrote: >>>> import Freehand >>>> fh = Freehand.Freehand(start=1, timeout=10*60*60) >>>> fh.open(Freehand.file('Holkham:Coaches:BRW:BWK8003 Conflat L')) > Traceback (most recent call last): > File "", line 1, in ? > AttributeError: 'module' object has no attribute 'file' >>>> Mmm. And if you open the freehand dictionary in script editor, does "file" show up? If it does show up then there's a bug in gensuitemodule. If it doesn't show up then I misunderstand (again) how it should work and you should indeed import StdSuites too. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From billb@mousa.demon.co.uk Tue Mar 5 13:25:26 2002 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Tue, 5 Mar 2002 13:25:26 +0000 Subject: [Pythonmac-SIG] Applescript Confusion? In-Reply-To: References: Message-ID: At 1:51 pm +0100 05/03/02, Jack Jansen wrote: >On Tuesday, March 5, 2002, at 01:10 , Bill Bedford wrote: >>>>> import Freehand >>>>> fh = Freehand.Freehand(start=1, timeout=10*60*60) >>>>> fh.open(Freehand.file('Holkham:Coaches:BRW:BWK8003 Conflat L')) >> Traceback (most recent call last): >> File "", line 1, in ? >> AttributeError: 'module' object has no attribute 'file' >>>>> > >Mmm. And if you open the freehand dictionary in script editor, does >"file" show up? If it does show up then there's a bug in >gensuitemodule. If it doesn't show up then I misunderstand (again) >how it should work and you should indeed import StdSuites too. No file doesn't show up. In fact Freehand does not have a Standard suite dictionary. -- Bill Bedford You can win or you can have peace, but not at the same time. From halazar@media.mit.edu Tue Mar 5 09:31:24 2002 From: halazar@media.mit.edu (Michael Halle) Date: Tue, 05 Mar 2002 09:31:24 +0000 Subject: [Pythonmac-SIG] Newbie question about shared libraries and QuickTime In-Reply-To: Your message of "Mon, 04 Mar 2002 22:50:15 PST." <3FADBD27-3005-11D6-AE3D-00039376B1AE@ulaluma.com> Message-ID: <200203051431.JAA18051@ml.media.mit.edu> Not exactly an answer to your specific question, but I've had good luck using Jython and QuickTime for Java. It works, it's here, it's pretty complete. --Mike From Jack.Jansen@oratrix.com Tue Mar 5 14:36:44 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 5 Mar 2002 15:36:44 +0100 Subject: [Pythonmac-SIG] Applescript Confusion? In-Reply-To: Message-ID: <6A441614-3046-11D6-A7B3-0030655234CE@oratrix.com> > > No file doesn't show up. In fact Freehand does not have a Standard > suite dictionary. So clearly I misunderstand OSA again:-) -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Tue Mar 5 22:09:20 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 5 Mar 2002 23:09:20 +0100 Subject: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell Message-ID: Folks, does anyone know of an OSX program that actually uses the CFBundleTypeRole of "Shell" in its .plist and actually has it working? According to the docs, if you set this role for a certain document type in your plist file it should fire up a new instance of your program for each double-clicked document: exactly what we want for Python.app. The bad news is that it doesn't work. The other bad news is that a google search for these two words returns two sorts of matches: Apple documentation and copies of my Python.app plist file. So, I'm not tempted to believe that (a) this doesn't work and (b) I'm the only one who ever tried it:-) There is apparently an alternative way to get this behaviour: the Java Jar Runner does it (even though it specifies a role of Viewer for .jar files), every .jar you double-click gets its own separate icon in the dock, etc. Information (or pointers to it) how Jar Runner could be doing this would also be welcome. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From terabaap@yumpee.org Wed Mar 6 00:24:03 2002 From: terabaap@yumpee.org (Manoj Plakal) Date: Tue, 05 Mar 2002 18:24:03 -0600 Subject: [Pythonmac-SIG] Re: [wxPython-mac] Status summary and embedding/pyobjc References: <886773C6-3087-11D6-9548-003065517236@oratrix.com> Message-ID: <3C8561A3.4080502@yumpee.org> [I'm Ccing this to pythonmac-sig. Please Cc any replies to me, I'm not subscribed to the list.] Jack Jansen wrote: > I'll reply to wxpython-mac, because the question came in here, but I > think we should continue this discussion on pythonmac-sig.... > > On dinsdag, maart 5, 2002, at 10:54 , Manoj Plakal wrote: >> Also, Python.app is currently compiled against Carbon, >> and not Cocoa. Is there some reason for this apart from >> not wanting to make too many changes to the code? > > Lack of time. We'll need both Cocoa and Carbon at some point, but as > Carbon is more important for the short term (as it gives us the IDE, and > all the existing MacPython functionality) I've left Cocoa to other > people who are more familiar with it. > > I'm hoping that at some point we can have a Python.app that is > "Cocoa-Carbon-Neutral" and that the Cocoa bootstrapping could be done > from Python code. But that may be impossible (due to the initialization > code for the initial Apple events) and moreover I don't understand the > issues yet. For the time being I would suggest that people start a > CocoaPython sourceforge project (or hop on to the PyObjc sourceforge > project, if it exists), and create a CocoaPython.app framework. If I > understand this message correctly you already have this working, right? [restating for the benefit of pythonmac-sig] What I have right now is a *very* trivial Cocoa app built using Project Builder that does a direct embedding of Python via Py_Initialize/PyRun_SimpleFile/Py_Finalize. That's it. I think that you can flesh this out a little bit to make a CocoaPython.app and use it with pyobjc to write Python scripts that access Cocoa, just like the Classic/Carbon GUI goodies you have in MacPython. What would even cooler would be to use Interface Builder to design the UI and write app logic in Python. Unfortunately, I know nothing about Mac/Cocoa programming but I'm willing to use this as an excuse to learn :) I'm not sure of actually starting a new project or anything, I've started too many that are languishing in various stages of incompleteness :) But I'll be glad to play around with the Cocoa/pyobjc stuff and see if I can do some GUI apps. As for wxPython on Mac, it looks like the best bet is to get wxMac working with Python.app. If we can fix the menubars, allow multiple Python.app instantiations, and get dock icons changeable, we should be good to go ... Manoj From dan@grassi.org Wed Mar 6 05:53:16 2002 From: dan@grassi.org (Dan Grassi) Date: Wed, 6 Mar 2002 00:53:16 -0500 Subject: [Pythonmac-SIG] time.daylight, MacClassic vs MachO In-Reply-To: <3C8561A3.4080502@yumpee.org> Message-ID: <7468EC83-30C6-11D6-8325-00039346A28A@grassi.org> I was writing some time routines and noticed that the MachO time.daylight variable is wrong and MacClassic is correct. Dan From Jack.Jansen@oratrix.com Wed Mar 6 09:46:23 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Wed, 6 Mar 2002 10:46:23 +0100 Subject: [Pythonmac-SIG] time.daylight, MacClassic vs MachO In-Reply-To: <7468EC83-30C6-11D6-8325-00039346A28A@grassi.org> Message-ID: <04D689A5-30E7-11D6-B212-0030655234CE@oratrix.com> On Wednesday, March 6, 2002, at 06:53 , Dan Grassi wrote: > I was writing some time routines and noticed that the MachO > time.daylight variable is wrong and MacClassic is correct. For me it works fine.... Just in case: you know that time.daylight==1 means "local time needs to reflect DST", i.e. it is always 1 if you're in a timezone that has DST, even when DST is not currently applicable? If you know all this and time.daylight is still off: please post a sourceforge bug report. Please include your timezone (preferrably as TZ variable, that makes things easyier to repeat) and the values for time.timezone, time.altzone, time.daylight and time.tzname. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Wed Mar 6 09:34:40 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Wed, 6 Mar 2002 10:34:40 +0100 Subject: [Pythonmac-SIG] Re: [wxPython-mac] Status summary and embedding/pyobjc In-Reply-To: <3C8561A3.4080502@yumpee.org> Message-ID: <61D740FB-30E5-11D6-B212-0030655234CE@oratrix.com> > As for wxPython on Mac, it looks like the best bet > is to get wxMac working with Python.app. If we can > fix the menubars, allow multiple Python.app instantiations, > and get dock icons changeable, we should be good > to go ... Okay, okay... I'll put a few hours of work into the menubar. It must be something simple, as the IDE doesn't have any problems with menubars. If someone can point me to some clear instructions on what I should download and how I should build it (and preferrably so easy to understand that there's something left of the "few hours" mentioned above that I can actually manage to debug something:-) I'll give it a go. As to the multiple instantiations: have you tried this from the command line with Python from CVS? For me this works fine. As to why it only works from the command line, that's still an open issue. And the dock icons I'll leave to someone else, this should be easy. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From gbrush@darwin.sfbr.org Thu Mar 7 19:13:15 2002 From: gbrush@darwin.sfbr.org (Gerry Brush) Date: Thu, 7 Mar 2002 13:13:15 -0600 Subject: [Pythonmac-SIG] RPy and libR.dylib Message-ID: <603AF790-31FF-11D6-8E77-003065AB1B98@darwin.sfbr.org> Walter Moreira has just announced a Python interface http://www.cmat.edu.uy/~walterm/rpy to the R (gnu S) statistical package. When I try to import it using mach-o python I get the following error. I don't know if this is a Python or and R question, but does anyone know how I can make this work? It would be very handy to have the R statistical library available to my Python code. Thanks. Gerry For example: mac28.gbrush: ~ {131} python Python 2.2 (#1, Mar 6 2002, 11:40:22) [GCC 2.95.2 19991024 (release)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import rpy Traceback (most recent call last): File "", line 1, in ? File "/sw/lib/python2.2/site-packages/rpy.py", line 23, in ? from _rpy import * # If this fails, you need to compile the C extension ImportError: dyld: python multiple definitions of symbol _main python definition of _main libR.dylib(system.lo) definition of _main Failure linking new module From cjl@physics.otago.ac.nz Fri Mar 8 00:41:36 2002 From: cjl@physics.otago.ac.nz (Chris Lee) Date: Fri, 8 Mar 2002 13:41:36 +1300 Subject: [Pythonmac-SIG] Another (probably) stupid questio Message-ID: <3F07CFF9-322D-11D6-8D9B-0003937807FC@physics.otago.ac.nz> Hi All, I have just upgraded to a G4 processor machine and I am about to do a make/install of Macho python. I just have one question does the configure file recognize the G4 and set compiler options to optimize for the it? If not what options do I have to add to the makefile? Thanks for all your help Cheers Chris ################################# Chris Lee Physics Department Otago University PO Box 56 Dunedin New Zealand Phone ++64 3 479 7749 Fax ++64 3 479 0964 ################################# From prastawa@cs.unc.edu Fri Mar 8 01:53:53 2002 From: prastawa@cs.unc.edu (Marcel Prastawa) Date: Thu, 7 Mar 2002 20:53:53 -0500 (EST) Subject: [Pythonmac-SIG] RPy and libR.dylib In-Reply-To: <603AF790-31FF-11D6-8E77-003065AB1B98@darwin.sfbr.org> Message-ID: On Thu, 7 Mar 2002, Gerry Brush wrote: > ImportError: dyld: python multiple definitions of symbol _main > python definition of _main > libR.dylib(system.lo) definition of _main > Failure linking new module I think that you could work around this by building R (libR.dylib) as a two-level namespace binary. I am not familiar with R, so I couldn't be of much help. You can try removing the "-flat_namespace -undefined suppress" flags from the Makefile (if there is one). Apple has a tech note on two-level namespace binaries, should be available from http://developer.apple.com Marcel From prastawa@cs.unc.edu Fri Mar 8 01:57:26 2002 From: prastawa@cs.unc.edu (Marcel Prastawa) Date: Thu, 7 Mar 2002 20:57:26 -0500 (EST) Subject: [Pythonmac-SIG] Another (probably) stupid questio In-Reply-To: <3F07CFF9-322D-11D6-8D9B-0003937807FC@physics.otago.ac.nz> Message-ID: On Fri, 8 Mar 2002, Chris Lee wrote: > I have just upgraded to a G4 processor machine and I am about to do a > make/install of Macho python. I just have one question does the > configure file recognize the G4 and set compiler options to optimize for > the it? I don't think that Python has any G4-specific optimizations (Altivec). Maybe sometime in the future... Marcel From jsw@cdc.noaa.gov Fri Mar 8 12:47:24 2002 From: jsw@cdc.noaa.gov (Jeff Whitaker) Date: Fri, 8 Mar 2002 05:47:24 -0700 (MST) Subject: [Pythonmac-SIG] RPy and libR.dylib Message-ID: Gerry: Here's a patch for R that did the trick for me. --- R-1.4.1/configure.orig Thu Mar 7 17:37:52 2002 +++ R-1.4.1/configure Thu Mar 7 17:40:59 2002 @@ -11636,7 +11636,7 @@ darwin1.3) shlib_ldflags="-bundle -flat_namespace -undefined suppress" ;; *) - shlib_ldflags="-bundle -bundle_loader \$(R_HOME)/bin/R.bin" ;; + shlib_ldflags="-bundle -flat_namespace -undefined suppress" ;; esac shlib_cxxldflags="${shlib_ldflags}" ;; @@ -11823,7 +11823,7 @@ case "${host_os}" in darwin*) LIBR_EXT=".dylib" - LIBR_LDFLAGS="-dynamiclib" + LIBR_LDFLAGS="-dynamiclib -flat_namespace -undefined suppress -install_name ${prefix}/lib/R/bin/libR.dylib" ;; esac If you install R with fink, just wait for a new revision to show up in unstable CVS (I'll upload it later today). After rebuilding R with this patch, rpy works fine for me. -Jeff -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov 325 Broadway Web : www.cdc.noaa.gov/~jsw Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124 From Jack.Jansen@oratrix.com Fri Mar 8 13:30:03 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 8 Mar 2002 14:30:03 +0100 Subject: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: Message-ID: <9915D4BC-3298-11D6-AE76-0030655234CE@oratrix.com> On Tuesday, March 5, 2002, at 11:09 , Jack Jansen wrote: > Folks, > does anyone know of an OSX program that actually uses the > CFBundleTypeRole of "Shell" in its .plist and actually has it working? Contacted Apple support about this, and it turns out the Shell role is not implemented at all. They are going to fix the documentation. I'm going to think about the problem a bit more: it's solved for the command line case already, and for the finder case (doubleclicking a .py file) I'm not so sure anymore that what you want if you double click a .py file is running it, a case could be made that you really want to open it in the IDE. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Fri Mar 8 13:31:50 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 8 Mar 2002 14:31:50 +0100 Subject: [Pythonmac-SIG] RPy and libR.dylib In-Reply-To: Message-ID: Jeff, are you sure this isn't the revrse patch? Gerry's problam was that he had a multiple-defined "_main", and that could be solved by *removing* -flat_namespace (if it was in there in the first place), not by adding it... On Friday, March 8, 2002, at 01:47 , Jeff Whitaker wrote: > > Gerry: Here's a patch for R that did the trick for me. > > --- R-1.4.1/configure.orig Thu Mar 7 17:37:52 2002 > +++ R-1.4.1/configure Thu Mar 7 17:40:59 2002 > @@ -11636,7 +11636,7 @@ > darwin1.3) > shlib_ldflags="-bundle -flat_namespace -undefined suppress" ;; > *) > - shlib_ldflags="-bundle -bundle_loader \$(R_HOME)/bin/R.bin" ;; > + shlib_ldflags="-bundle -flat_namespace -undefined suppress" ;; > esac > shlib_cxxldflags="${shlib_ldflags}" > ;; > @@ -11823,7 +11823,7 @@ > case "${host_os}" in > darwin*) > LIBR_EXT=".dylib" > - LIBR_LDFLAGS="-dynamiclib" > + LIBR_LDFLAGS="-dynamiclib -flat_namespace -undefined suppress > -install_name > ${prefix}/lib/R/bin/libR.dylib" > ;; > esac > > If you install R with fink, just wait for a new revision to show up in > unstable CVS (I'll upload it later today). > > > After rebuilding R with this patch, rpy works fine for me. > > -Jeff > > -- > Jeffrey S. Whitaker Phone : (303)497-6313 > Meteorologist FAX : (303)497-6449 > NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov > 325 Broadway Web : www.cdc.noaa.gov/~jsw > Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124 > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From jsw@cdc.noaa.gov Fri Mar 8 13:49:37 2002 From: jsw@cdc.noaa.gov (Jeff Whitaker) Date: Fri, 8 Mar 2002 06:49:37 -0700 (MST) Subject: [Pythonmac-SIG] RPy and libR.dylib In-Reply-To: Message-ID: Jack: All I can say is what worked for me. When I first tried importing rpy with the unmodified R installation, python couldn't find libR.dylib. I fixed that by adding the "install_name". But then, I got undefined symbol errors in R_X11.so - because of the "-bundle_loader" argument, dyld was expecting them to be defined by R. Simply removing the "bundle_loader" produced undefined symbol errors in the R compile, so I added the "flat_namespace" stuff and everything worked. So, to summarize, libR.dylib and R_X11.so were initially compiled with two-level namespaces - for me, this was the source of the problem rather than the solution. Gerry (or anyone else) - please let me know whether this works for you. -Jeff On Fri, 8 Mar 2002, Jack Jansen wrote: > Jeff, > are you sure this isn't the revrse patch? Gerry's problam was that he > had a multiple-defined "_main", and that could be solved by *removing* > -flat_namespace (if it was in there in the first place), not by adding > it... > > On Friday, March 8, 2002, at 01:47 , Jeff Whitaker wrote: > > > > > Gerry: Here's a patch for R that did the trick for me. > > > > --- R-1.4.1/configure.orig Thu Mar 7 17:37:52 2002 > > +++ R-1.4.1/configure Thu Mar 7 17:40:59 2002 > > @@ -11636,7 +11636,7 @@ > > darwin1.3) > > shlib_ldflags="-bundle -flat_namespace -undefined suppress" ;; > > *) > > - shlib_ldflags="-bundle -bundle_loader \$(R_HOME)/bin/R.bin" ;; > > + shlib_ldflags="-bundle -flat_namespace -undefined suppress" ;; > > esac > > shlib_cxxldflags="${shlib_ldflags}" > > ;; > > @@ -11823,7 +11823,7 @@ > > case "${host_os}" in > > darwin*) > > LIBR_EXT=".dylib" > > - LIBR_LDFLAGS="-dynamiclib" > > + LIBR_LDFLAGS="-dynamiclib -flat_namespace -undefined suppress > > -install_name > > ${prefix}/lib/R/bin/libR.dylib" > > ;; > > esac > > > > If you install R with fink, just wait for a new revision to show up in > > unstable CVS (I'll upload it later today). > > > > > > After rebuilding R with this patch, rpy works fine for me. > > > > -Jeff > > > > -- > > Jeffrey S. Whitaker Phone : (303)497-6313 > > Meteorologist FAX : (303)497-6449 > > NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov > > 325 Broadway Web : www.cdc.noaa.gov/~jsw > > Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124 > > > > > > _______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- Emma > Goldman - > > -- Jeffrey S. Whitaker Phone : (303)497-6313 Meteorologist FAX : (303)497-6449 NOAA/OAR/CDC R/CDC1 Email : jsw@cdc.noaa.gov 325 Broadway Web : www.cdc.noaa.gov/~jsw Boulder, CO, USA 80303-3328 Office : Skaggs Research Cntr 1D-124 From guess-who@kevin-masako.com Fri Mar 8 14:19:32 2002 From: guess-who@kevin-masako.com (Kevin Ollivier) Date: Fri, 8 Mar 2002 09:19:32 -0500 Subject: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <9915D4BC-3298-11D6-AE76-0030655234CE@oratrix.com> Message-ID: <825A65EC-329F-11D6-AFE6-00039384E8D4@kevin-masako.com> On Friday, March 8, 2002, at 08:30 AM, Jack Jansen wrote: > > On Tuesday, March 5, 2002, at 11:09 , Jack Jansen wrote: > >> Folks, >> does anyone know of an OSX program that actually uses the >> CFBundleTypeRole of "Shell" in its .plist and actually has it working? > > Contacted Apple support about this, and it turns out the Shell role is > not implemented at all. They are going to fix the documentation. > > I'm going to think about the problem a bit more: it's solved for the > command line case already, and for the finder case (doubleclicking a > .py file) I'm not so sure anymore that what you want if you double > click a .py file is running it, a case could be made that you really > want to open it in the IDE. Couldn't it be set up so that in the Finder case, when you double-click on a .py file, the Python.app bundle would actually pass the script and its arguments to the command line interface, then shut down? (I know Applescript can execute shell commands, are there C++/ObjectiveC APIs for this?) While I do see your point that people may want to open the script in the editor, I think the question boils down to what a person with Python installed is planning on doing more with the scripts they have, running or editing them? Personally, I find myself running scripts more than editing them, so I think this behavior should at least be supported if possible, especially if non-programmers start using Python scripts/programs. If, however, this means reverse-engineering the JAR launcher's functionality, then I'd say open it in the editor for now. =) We could in worst case package in an Applescript drop-let for Python scripts which runs them from the command line, or create an Applescript which lets you specify a script name and parameters. I also had a question about the new WASTE support for OS X. Should I download the binary distribution and put it in the $(CVSROOT)/dist directory? The author states on the web site that to get the source code I need to contact him directly. You mentioned CVS access, but I couldn't seem to find it. Thanks, Kevin From robin@alldunn.com Fri Mar 8 16:09:26 2002 From: robin@alldunn.com (Robin Dunn) Date: Fri, 8 Mar 2002 08:09:26 -0800 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell References: <825A65EC-329F-11D6-AFE6-00039384E8D4@kevin-masako.com> Message-ID: <0b8a01c1c6bb$9f4863b0$0214a8c0@Rogue> > > > > I'm going to think about the problem a bit more: it's solved for the > > command line case already, and for the finder case (doubleclicking a > > .py file) I'm not so sure anymore that what you want if you double > > click a .py file is running it, a case could be made that you really > > want to open it in the IDE. > > Couldn't it be set up so that in the Finder case, when you double-click > on a .py file, the Python.app bundle would actually pass the script and > its arguments to the command line interface, then shut down? What about setting up a new file extension for this behaviour? For example a .pya for python application, or reuse the .pyw from MSW? -- Robin Dunn Software Craftsman robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython! From altis@semi-retired.com Fri Mar 8 16:27:23 2002 From: altis@semi-retired.com (Kevin Altis) Date: Fri, 8 Mar 2002 08:27:23 -0800 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <9915D4BC-3298-11D6-AE76-0030655234CE@oratrix.com> Message-ID: > From: Jack Jansen > > I'm going to think about the problem a bit more: it's solved for the > command line case already, and for the finder case (doubleclicking a .py > file) I'm not so sure anymore that what you want if you double click a > .py file is running it, a case could be made that you really want to > open it in the IDE. In that case, how do you envision users of scripts running them? In the case of a script with a GUI the user is going to want to treat the script like an application, or at least that is what we're already doing on Windows and Linux with wxPython scripts/apps. The user will want the option of a console window for stdout and stderr (basically debugging). We already have the .pyw extension for suppressing the console, what does that do on the Mac? Double-clicking a .py or .pyw file on Windows (Linux too?) runs the script. If we have to have a separate extension or some other wrapper mechanism for the Mac, that is going to make doing cross-platform scripts more tedious, so it would be nice to avoid if possible. ka From mjb@uma.pt Fri Mar 8 16:30:13 2002 From: mjb@uma.pt (Michael J. Barber) Date: Fri, 8 Mar 2002 16:30:13 +0000 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <0b8a01c1c6bb$9f4863b0$0214a8c0@Rogue> Message-ID: On Friday, March 8, 2002, at 04:09 PM, Robin Dunn wrote: >>> >>> I'm going to think about the problem a bit more: it's solved for the >>> command line case already, and for the finder case (doubleclicking a >>> .py file) I'm not so sure anymore that what you want if you double >>> click a .py file is running it, a case could be made that you really >>> want to open it in the IDE. >> >> Couldn't it be set up so that in the Finder case, when you double-click >> on a .py file, the Python.app bundle would actually pass the script and >> its arguments to the command line interface, then shut down? > > What about setting up a new file extension for this behaviour? For > example > a .pya for python application, or reuse the .pyw from MSW? > How about .py for opening in the IDE, and .pyc for running it? From billb@mousa.demon.co.uk Fri Mar 8 17:01:19 2002 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Fri, 8 Mar 2002 17:01:19 +0000 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: References: Message-ID: At 8:27 am -0800 08/03/02, Kevin Altis wrote: >> From: Jack Jansen >> >> I'm going to think about the problem a bit more: it's solved for the >> command line case already, and for the finder case (doubleclicking a .py >> file) I'm not so sure anymore that what you want if you double click a >> .py file is running it, a case could be made that you really want to >> open it in the IDE. > >In that case, how do you envision users of scripts running them? In the case >of a script with a GUI the user is going to want to treat the script like an >application, or at least that is what we're already doing on Windows and >Linux with wxPython scripts/apps. The user will want the option of a console >window for stdout and stderr (basically debugging). We already have the .pyw >extension for suppressing the console, what does that do on the Mac? >Double-clicking a .py or .pyw file on Windows (Linux too?) runs the script. > >If we have to have a separate extension or some other wrapper mechanism for >the Mac, that is going to make doing cross-platform scripts more tedious, so >it would be nice to avoid if possible. What's wrong with using contextual menus?* There are 'open with' plug ins for both OS9 and OSX There is even a python interface that allows you to run scripts. *OK on OSX it is a bit slow, but I would expect that will change. -- Bill Bedford You can win or you can have peace, but not at the same time. From kevino@tulane.edu Fri Mar 8 17:37:03 2002 From: kevino@tulane.edu (Kevin Ollivier) Date: Fri, 8 Mar 2002 12:37:03 -0500 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell References: <825A65EC-329F-11D6-AFE6-00039384E8D4@kevin-masako.com> <0b8a01c1c6bb$9f4863b0$0214a8c0@Rogue> Message-ID: <007501c1c6c7$e4512800$6d01a8c0@kevinnew> > > > I'm going to think about the problem a bit more: it's solved for the > > > command line case already, and for the finder case (doubleclicking a > > > .py file) I'm not so sure anymore that what you want if you double > > > click a .py file is running it, a case could be made that you really > > > want to open it in the IDE. > > > > Couldn't it be set up so that in the Finder case, when you double-click > > on a .py file, the Python.app bundle would actually pass the script and > > its arguments to the command line interface, then shut down? > > What about setting up a new file extension for this behaviour? For example > a .pya for python application, or reuse the .pyw from MSW? I think we should include support for other extensions that are being used, like .pyw, but I think it's important to maintain compatibility as much as possible with other Python distributions for a consistent experience. When you double-click on a .py file in Windows, it runs the script, so I think we should replicate this on Mac if possible. I've been checking, and it looks like there are API calls for executing from the command line (exec() and system()), so this should give us the behavior we are looking for without much extra work. (multiple instances, GUIs work) However, if people want to open the editor as the default action, we could create a dialog letting them change this behavior. Hopefully I will have some time this weekend to play with implementing this functionality. =) Kevin From Chris.Barker@noaa.gov Fri Mar 8 18:11:14 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Fri, 08 Mar 2002 10:11:14 -0800 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell References: <825A65EC-329F-11D6-AFE6-00039384E8D4@kevin-masako.com> <0b8a01c1c6bb$9f4863b0$0214a8c0@Rogue> <007501c1c6c7$e4512800$6d01a8c0@kevinnew> Message-ID: <3C88FEC2.E3751EE1@noaa.gov> Kevin Ollivier wrote: > > > > The finder case (doubleclicking a > > > > .py file) I'm not so sure anymore that what you want if you double > > > > click a .py file is running it, a case could be made that you really > > > > want to open it in the IDE. Personally, I've always thought this was a fundemental flaw in the MacOS paradime: the one-to-one file-application association. While it makes sense for applications with propriatary formats like a MS Word adn the like, it never has fit well with how I work. More often than not a file contians data, and I might want to work with that data in any number of applications. Or, as in this case, the file is a script, so it might be either edited or run (and could well be editied in more than one application). Right now I'm using KDE on Linux, and it works great: you can have a primary association that will launch and app on clicking, and any number of secondary associations that you can choose by right clicking. YOu can , of course, also specify the app when you right click. Enough ranting. I had hoped OS-X would have come up woth something better. IN any case, if you have a one-to-one association with a *.py file, I certainly hope the OS gives you a way to choose that association. Differnet people are going to want different things. I do like the idea of the defaults being: *.py--editor of your choice (maybe defaulting to the IDE), and *.pyc--The interpreter. This fits well with all other compiled language development: the source code is edited, the compiled code is run. I suppose we still have the question of whether it should bring up a terminal window or not, but maybe *.pyw would make sense for supressing that, and being compatable with windows. Another option is to do what I always do on Linux: if I want a terminal window, I start the script form a terminal window. On *nix, by the way, the distiction between a source file and an executable is whether the executable permission bit is set. If it is, then typing it on the command line (or clicking on it in a file manager, depending on the file manager, will run it. Perhaps this could be used by OS-X as well, though I still think the File manager should provide an easy way to make the choice each time you click the file. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From moehl@akaflieg.extern.tu-berlin.de Fri Mar 8 19:09:27 2002 From: moehl@akaflieg.extern.tu-berlin.de (Torsten Sadowski) Date: Fri, 8 Mar 2002 20:09:27 +0100 (CET) Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <3C88FEC2.E3751EE1@noaa.gov> Message-ID: On Fri, 8 Mar 2002, Chris Barker wrote: > Kevin Ollivier wrote: > > > > > The finder case (doubleclicking a > > > > > .py file) I'm not so sure anymore that what you want if you double > > > > > click a .py file is running it, a case could be made that you really > > > > > want to open it in the IDE. > > Personally, I've always thought this was a fundemental flaw in the MacOS > paradime: the one-to-one file-application association. While it makes > sense for applications with propriatary formats like a MS Word adn the > like, it never has fit well with how I work. More often than not a file > contians data, and I might want to work with that data in any number of > applications. Or, as in this case, the file is a script, so it might be > either edited or run (and could well be editied in more than one snip! In my opinion is the Mac the only machine without a one-to-one file-application association. Every Mac-File has a TYPE and a CREATOR. And all programs who can deal with a certain type should be able to open that file. If you click on a file the prgram with the same creator will be opened. In the case of python, where all files are textfiles, the type should be TEXT and the creator should give the program you want. If I'm not completely mistaken this is already the case. There are different creators for the IDE and for python, so why not a third creator for wxwindows? The Mac doesn't care for fileendings at all. Regards, Torsten P.S. Is there already a wxpython for classic MacOS to try? From kevino@tulane.edu Fri Mar 8 19:35:06 2002 From: kevino@tulane.edu (Kevin Ollivier) Date: Fri, 8 Mar 2002 14:35:06 -0500 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell References: <825A65EC-329F-11D6-AFE6-00039384E8D4@kevin-masako.com> <0b8a01c1c6bb$9f4863b0$0214a8c0@Rogue> <007501c1c6c7$e4512800$6d01a8c0@kevinnew> <3C88FEC2.E3751EE1@noaa.gov> Message-ID: <00a601c1c6d8$687ad300$6d01a8c0@kevinnew> > Right now I'm using KDE on Linux, and it works great: you can have a > primary association that will launch and app on clicking, and any number > of secondary associations that you can choose by right clicking. YOu can > , of course, also specify the app when you right click. > > Enough ranting. I had hoped OS-X would have come up woth something > better. IN any case, if you have a one-to-one association with a *.py > file, I certainly hope the OS gives you a way to choose that > association. Differnet people are going to want different things. I agree with this as well. There are rumors that OS X 10.2 will introduce an "Open With..." context menu. (Hoping!) > I do like the idea of the defaults being: *.py--editor of your choice > (maybe defaulting to the IDE), and *.pyc--The interpreter. This fits > well with all other compiled language development: the source code is > edited, the compiled code is run. This I don't agree with, simply because people generally distribute the .py file instead of the .pyc file. On Win and Linux, this is not a problem - by default double-clicking on a .py file compiles and then runs the script. It treats it like an application, as Kevin Altis mentioned earlier. I think we need to justify why Python should behave differently on Mac if we want to change this behavior. I think it would be detrimental because the average Python user would have to open most scripts in the IDE before running them the first time, and know the difference between .py and .pyc to avoid doing this subsequent times. > I suppose we still have the question of whether it should bring up a > terminal window or not, but maybe *.pyw would make sense for supressing > that, and being compatable with windows. Another option is to do what I > always do on Linux: if I want a terminal window, I start the script form > a terminal window. The default behavior on Windows is to have a terminal window for .py, and suppress it with .pyw. I think this works. We may need to control Terminal.app to make this happen... I'll have to look into it. However, I have to say that the terminal window issue on Windows is not very reliable because the shell closes as soon as execution stops - which isn't very helpful for debugging purposes. (Nothing to do with Python, a dumb default in Windows.) As a result, on Windows I always open up a DOS window when I want to view terminal output as well. On OS X, you can use the Console.app utility to view any stderr (and stdout?) messages that occurred since the start of the session, so anyone wanting to debug has this option as well. > On *nix, by the way, the distiction between a source file and an > executable is whether the executable permission bit is set. If it is, > then typing it on the command line (or clicking on it in a file manager, > depending on the file manager, will run it. Perhaps this could be used > by OS-X as well, though I still think the File manager should provide an > easy way to make the choice each time you click the file. I wouldn't want to rely on this, simply because as people share files between platforms it would not reliably keep the executable bit set. (Say it was developed on Windows, for example.) However, I think when you use the Terminal in OS X, it behaves as you described, so *NIX friendly people can still have that behavior if they so desire. =) Kevin From kevino@tulane.edu Fri Mar 8 19:45:42 2002 From: kevino@tulane.edu (Kevin Ollivier) Date: Fri, 8 Mar 2002 14:45:42 -0500 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell References: Message-ID: <00ac01c1c6d9$f0b6cfc0$6d01a8c0@kevinnew> > snip! > > In my opinion is the Mac the only machine without a one-to-one > file-application association. Every Mac-File has a TYPE and a CREATOR. And > all programs who can deal with a certain type should be able to open that > file. If you click on a file the prgram with the same creator will be > opened. In the case of python, where all files are textfiles, the type > should be TEXT and the creator should give the program you want. If I'm > not completely mistaken this is already the case. There are different > creators for the IDE and for python, so why not a third creator for > wxwindows? The Mac doesn't care for fileendings at all. We could do this, but from my understanding the correct creator code would only be set if the developer wrote the wxPython script on Mac. Since a majority of wxPython apps have been developed on other platforms so far, we would still run into the same problem. > P.S. Is there already a wxpython for classic MacOS to try? Check out the "I'm a developer and I want to help with the wxPython for Mac project. How do I get started?" FAQ question on how to get the wxPython binaries for Carbon MacPython, which runs on OS 9. However, be forewarned - this is still experimental! http://wiki.wxpython.org/index.cgi/Frequently_20Asked_20Questions Kevin From billb@mousa.demon.co.uk Fri Mar 8 19:55:05 2002 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Fri, 8 Mar 2002 19:55:05 +0000 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <00a601c1c6d8$687ad300$6d01a8c0@kevinnew> References: <825A65EC-329F-11D6-AFE6-00039384E8D4@kevin-masako.com> <0b8a01c1c6bb$9f4863b0$0214a8c0@Rogue> <007501c1c6c7$e4512800$6d01a8c0@kevinnew> <3C88FEC2.E3751EE1@noaa.gov> <00a601c1c6d8$687ad300$6d01a8c0@kevinnew> Message-ID: At 2:35 pm -0500 08/03/02, Kevin Ollivier wrote: >> Right now I'm using KDE on Linux, and it works great: you can have a >> primary association that will launch and app on clicking, and any number >> of secondary associations that you can choose by right clicking. YOu can >> , of course, also specify the app when you right click. >> >> Enough ranting. I had hoped OS-X would have come up woth something >> better. IN any case, if you have a one-to-one association with a *.py >> file, I certainly hope the OS gives you a way to choose that >> association. Differnet people are going to want different things. > >I agree with this as well. There are rumors that OS X 10.2 will introduce an >"Open With..." context menu. (Hoping!) It's here already, called Zingg! see http://www.brockerhoff.net/zingg -- Bill Bedford You can win or you can have peace, but not at the same time. From altis@semi-retired.com Fri Mar 8 19:56:49 2002 From: altis@semi-retired.com (Kevin Altis) Date: Fri, 8 Mar 2002 11:56:49 -0800 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: Message-ID: > From: Michael J. Barber > > >> Couldn't it be set up so that in the Finder case, when you double-click > >> on a .py file, the Python.app bundle would actually pass the script and > >> its arguments to the command line interface, then shut down? > > > > What about setting up a new file extension for this behaviour? For > > example > > a .pya for python application, or reuse the .pyw from MSW? > > > How about .py for opening in the IDE, and .pyc for running it? The other problem with .pyc and .pywc (compiled version of .pyw) is that those files will not automatically be created unless a module is imported. distutils will automatically create compiled (.pyc) and optimized compiled (.pyo) files during an installation, but when you're developing, you are unlikely to have them for scripts that never get imported. None of the main PythonCard sample scripts are compiled, demo.py in the wxPython distribution is not compiled, etc. There doesn't seem to be much of a speed increase in using the compiled or optimized compiled files, so I don't think people worry about them too much. ka From billb@mousa.demon.co.uk Fri Mar 8 20:02:46 2002 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Fri, 8 Mar 2002 20:02:46 +0000 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <00a601c1c6d8$687ad300$6d01a8c0@kevinnew> References: <825A65EC-329F-11D6-AFE6-00039384E8D4@kevin-masako.com> <0b8a01c1c6bb$9f4863b0$0214a8c0@Rogue> <007501c1c6c7$e4512800$6d01a8c0@kevinnew> <3C88FEC2.E3751EE1@noaa.gov> <00a601c1c6d8$687ad300$6d01a8c0@kevinnew> Message-ID: At 2:35 pm -0500 08/03/02, Kevin Ollivier wrote: >> I do like the idea of the defaults being: *.py--editor of your choice >> (maybe defaulting to the IDE), and *.pyc--The interpreter. This fits >> well with all other compiled language development: the source code is >> edited, the compiled code is run. > >This I don't agree with, simply because people generally distribute the .py >file instead of the .pyc file. On Win and Linux, this is not a problem - by >default double-clicking on a .py file compiles and then runs the script. It >treats it like an application, as Kevin Altis mentioned earlier. This is exactly what happens on my mac, if it doen't on your I suggest it is because at some time you have changed the creator from 'Pyth' to something else. >I think we >need to justify why Python should behave differently on Mac if we want to >change this behavior. I think it would be detrimental because the average >Python user would have to open most scripts in the IDE before running them >the first time, and know the difference between .py and .pyc to avoid doing >this subsequent times. Or know enough about the mac to change the creator, and there mush be about half a dozen ways of doing that, including a script in the tools folder. -- Bill Bedford You can win or you can have peace, but not at the same time. From altis@semi-retired.com Fri Mar 8 20:08:24 2002 From: altis@semi-retired.com (Kevin Altis) Date: Fri, 8 Mar 2002 12:08:24 -0800 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <00a601c1c6d8$687ad300$6d01a8c0@kevinnew> Message-ID: > From: Kevin Ollivier > > The default behavior on Windows is to have a terminal window for .py, and > suppress it with .pyw. I think this works. We may need to control > Terminal.app to make this happen... I'll have to look into it. However, I > have to say that the terminal window issue on Windows is not very reliable > because the shell closes as soon as execution stops - which isn't very > helpful for debugging purposes. (Nothing to do with Python, a dumb default > in Windows.) As a result, on Windows I always open up a DOS window when I > want to view terminal output as well. On OS X, you can use the Console.app > utility to view any stderr (and stdout?) messages that occurred since the > start of the session, so anyone wanting to debug has this option as well. Chances are on Windows you want to pass the -i command-line option to Python. # -i : inspect interactively after running script, (also PYTHONINSPECT=x) # and force prompts, even if stdin does not appear to be a terminal When the app ends, you'll still be in the interpreter (Ctrl+Z to exit). In addition, if there is a syntax error, your console window won't disappear, you'll be left in the interpreter with a message telling you where the problem is. I'm working on this very issue right now trying to get scripts to launch as detached sub-processes on both Windows and Linux. The resourceEditor in PythonCard can run a script just fine and that has been working for a while using os.system on Linux and os.popen on Windows with 'start'. The difficulty arises when the script has a syntax error. In that case, you want to run with the interpreter or have some other method to catch the traceback. Once a wxPython app is in the main event loop it doesn't matter because an exception won't kill the event loop, but it does when the syntax error prevents the main event loop from starting. I'm not happy with the launch with interpreter solution I have and will probably post on c.l.py later today, so I won't clutter this thread with any more details. If you're interested, email me directly. ka From Chris.Barker@noaa.gov Fri Mar 8 23:59:59 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Fri, 08 Mar 2002 15:59:59 -0800 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell References: Message-ID: <3C89507F.284B3245@noaa.gov> Torsten Sadowski wrote: > In my opinion is the Mac the only machine without a one-to-one > file-application association. Well, *nix has a None-to-one association. Recent Desktops for *nix (KDE, GNOME) provide an association. KDE uses mime-types, which it tries to figure out from both the filename and by examining the file itself. A given mime-type can be associated with any number of applications. > Every Mac-File has a TYPE and a CREATOR. Which is a very nifty system, but unfortunately incompatable with other systems, so when transfering files, we're back to doing something with a filename. > And > all programs who can deal with a certain type should be able to open that > file. sure. Of course, if the type gets contaminated (or is blank), you often can't open it. That drives me crazy, and Apple has not made it easy for the non-=programmer to examine or set the types and creators. I don't ink it's even possible to change it with anything provided with a Mac, out of the box. Has Apple come up with some way to preserve the type-creator attributes for OS-X? > If you click on a file the prgram with the same creator will be > opened. What it that's not what you want? I want to edit rather than run this Python file this time, other times I want to run it. I certainly don't want a list of ALL the applications that can read a text file (imagine that on OS_X, with all the classic text file utilities installed?) Anyway, we're not designing OS-X's file manager or file system, so this is not very relevant. The question is how to work with what Apple has given us. > There are different > creators for the IDE and for python, so why not a third creator for > wxwindows? I like this idea..would it work for OS-X ? > The Mac doesn't care for file endings at all. Until it gets a file from another system that doesn't have a type and creator, then it has to figure out what to do. I think that's what this whole discussion is about. Bill Bedford wrote: > This is exactly what happens on my mac, if it doen't on your I > suggest it is because at some time you have changed the creator from > 'Pyth' to something else. Or it never had that type to begin with: either it came form another system, or was created by an editor that isn't python-aware. I find that I sometimes use the IDE, sometimes BBEdit lite (which used to be able to set the creator for me, but seems to have lost that capability). The result is that I nevr click on a Python script, I always drag it onto the app I want, The IDE, an editor, of the interpretter. This is sometimes kind of awkward. Kevin Altis wrote: > The other problem with .pyc and .pywc (compiled version of .pyw) is that > those files will not automatically be created unless a module is imported. > distutils will automatically create compiled (.pyc) and optimized compiled > (.pyo) files during an installation, but when you're developing, you are > unlikely to have them for scripts that never get imported. If you can figure out how to change the creator, you can figure out how to compile a python scriipt. > None of the main > PythonCard sample scripts are compiled, demo.py in the wxPython distribution > is not compiled, etc. There doesn't seem to be much of a speed increase in > using the compiled or optimized compiled files, so I don't think people > worry about them too much. I agree that I don't, but I liek th *nix way anyway. On my mac, I'd live to be able to make an application out of a script by just compiling it. Come to think of it, it would be kind of like the current "Build Applet" option. IN fact, that is exactly how I work on the Mac. While developing, I want to Python files in an editor, and when I have a working app that I want to just use, I make an applet out of it. Perhaps approach should be preserved in OS-X. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From bobsavage@mac.com Sat Mar 9 06:17:36 2002 From: bobsavage@mac.com (Bob Savage) Date: Sat, 09 Mar 2002 00:17:36 -0600 Subject: [wxPython-mac] Re: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <3C88FEC2.E3751EE1@noaa.gov> Message-ID: on 3/8/02 12:11 PM, Chris Barker wrote: > Kevin Ollivier wrote: >>>>> The finder case (doubleclicking a >>>>> .py file) I'm not so sure anymore that what you want if you double >>>>> click a .py file is running it, a case could be made that you really >>>>> want to open it in the IDE. > > Personally, I've always thought this was a fundemental flaw in the MacOS > paradime: the one-to-one file-application association. ... > Enough ranting. I had hoped OS-X would have come up woth something > better. IN any case, if you have a one-to-one association with a *.py > file, I certainly hope the OS gives you a way to choose that > association. Differnet people are going to want different things. > All of this bit about adding extra filename extensions is way off. MacOSX does not work this way. We should **NOT** create a new file extension for the IDE, etc. just use .py like every other platform (and .pyc for compiled). MacOSX has an "Open with" feature, it is found in the inspector, not contextual menus. Show the Inspector, click on the file, and select "Open with..." you can select from a popup of known applications that handle that kind of file (Finder maintains a database) or you can select a different one. You can also select to have this apply just to this file or to all files with that file ending. Clearly the best thing is to have the one file ending with a default to something that will run it via the interpreter, and people already have the option to change a specific file to open in the IDE if they should so choose (or BBEdit, etc., it is up to the user). Making it so that the filename has to be changed back and forth is just a waste of people's time. Bob From draayer@surfglobal.net Sat Mar 9 20:02:37 2002 From: draayer@surfglobal.net (Dean Draayer) Date: Sat, 9 Mar 2002 15:02:37 -0500 Subject: [Pythonmac-SIG] Re: [HELP!] PC Line Endings? Batch file replacement Message-ID: > Suggestions *ARE* welcome... That reminds me, I began writing an entry for "The Official MacPython LineEnding Converter Competition" a while back but never got around to polishing it off. Well, it's finished now - thanks for the incentive! You can grab it from the following web page: http://www.emba.uvm.edu/~ddraayer/macpysrcwipe/index.html Hope someone finds it useful. This utility implements some of the features on Jack's original wish list - I'm willing to include more features (or change existing ones) if anyone shows interest. --Dean From draayer@surfglobal.net Sat Mar 9 20:02:33 2002 From: draayer@surfglobal.net (Dean Draayer) Date: Sat, 9 Mar 2002 15:02:33 -0500 Subject: [Pythonmac-SIG] Re: Newbie question about shared libraries and QuickTime Message-ID: > As far as easy reference to the docstrings goes, you might want to try > PyDoc. Does anybody know if it runs under OS 9? I use it under MacOS 8.6 (running MacPython 2.1). Very handy - but only to the extent that informative docstrings are written :( You may find it convenient to put a script to access pydoc in your Python IDE scripts menu - it might go something like this: #---------- import sys if __name__ == '__main__': from EasyDialogs import AskString from pydoc import Helper helper = Helper(sys.stdin, sys.stdout) topic = AskString('Help topic:', '') if topic != None: # user didn't cancel if topic == '': helper.intro() else: helper.help(topic) #---------- PyDoc can also output HTML (pydoc.writedoc function, I think?). --Dean From hansv@net4all.be Sun Mar 10 16:44:57 2002 From: hansv@net4all.be (Hans verschooten) Date: Sun, 10 Mar 2002 17:44:57 +0100 Subject: [Pythonmac-SIG] Ming on Mac OS X Message-ID: <27BA6213-3446-11D6-9CFD-0030654E4A4C@net4all.be> Hi, does anybody have a binary for Ming on Mac OS X, Ming is a library to create swf (Macromedia Flash) files. There are Python examples. But I just can't get the Python Library to compile. If anybody has played with Ming v0.2 on a mac, please show me the way. Any help is appreciated, Hans From jwblist@olympus.net Sun Mar 10 18:12:31 2002 From: jwblist@olympus.net (John W Baxter) Date: Sun, 10 Mar 2002 10:12:31 -0800 Subject: [Pythonmac-SIG] Wanted: working example of CFBundleTypeRole Shell In-Reply-To: <9915D4BC-3298-11D6-AE76-0030655234CE@oratrix.com> References: <9915D4BC-3298-11D6-AE76-0030655234CE@oratrix.com> Message-ID: At 14:30 +0100 3/8/2002, Jack Jansen wrote: >I'm going to think about the problem a bit more: it's solved for the >command line case already, and for the finder case (doubleclicking a .py >file) I'm not so sure anymore that what you want if you double click a >.py file is running it, a case could be made that you really want to >open it in the IDE. Actually, I probably want to open it in Emacs. But I don't think you need to cater to my whims. ;-) As to edit vs execute, I would say "execute" because: I can put an icon for the IDE in my doc, and drag/drop when I want to edit. (But can I?...can I craft a dock icon which runs the IDE rather than editing it...is the IDE itself a .py file?) All in all, an interesting question. Do the HIG say anything about what to do about interpreted language source files? --John -- John Baxter jwblist@olympus.net Port Ludlow, WA, USA From macnerd@dontspam.realmspace.com Mon Mar 11 00:27:46 2002 From: macnerd@dontspam.realmspace.com (macnerd) Date: Sun, 10 Mar 2002 16:27:46 -0800 Subject: [Pythonmac-SIG] Ming on Mac OS X In-Reply-To: <27BA6213-3446-11D6-9CFD-0030654E4A4C@net4all.be> Message-ID: <000201c1c893$919519a0$bdc8a8c0@jmenchacant> Where can I get information about Ming?! This sounds interesting. Not that I am a big fan of Flash, but by auto-creating Flash files, it kinda of opens up the technology. ciao, Joaquin -----Original Message----- From: pythonmac-sig-admin@python.org [mailto:pythonmac-sig-admin@python.org]On Behalf Of Hans verschooten Sent: Sunday, March 10, 2002 8:45 AM To: pythonmac-SIG@python.org Subject: [Pythonmac-SIG] Ming on Mac OS X Hi, does anybody have a binary for Ming on Mac OS X, Ming is a library to create swf (Macromedia Flash) files. There are Python examples. But I just can't get the Python Library to compile. If anybody has played with Ming v0.2 on a mac, please show me the way. Any help is appreciated, Hans _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From hansv@net4all.be Mon Mar 11 07:23:54 2002 From: hansv@net4all.be (Hans verschooten) Date: Mon, 11 Mar 2002 08:23:54 +0100 Subject: [Pythonmac-SIG] Ming on Mac OS X In-Reply-To: <000201c1c893$919519a0$bdc8a8c0@jmenchacant> Message-ID: http://www.opaque.net/ming/ On maandag, maart 11, 2002, at 01:27 , macnerd wrote: > Where can I get information about Ming?! This sounds interesting. > Not that I am a big fan of Flash, but by auto-creating Flash files, > it kinda of opens up the technology. > > ciao, > Joaquin > > -----Original Message----- > From: pythonmac-sig-admin@python.org > [mailto:pythonmac-sig-admin@python.org]On Behalf Of Hans verschooten > Sent: Sunday, March 10, 2002 8:45 AM > To: pythonmac-SIG@python.org > Subject: [Pythonmac-SIG] Ming on Mac OS X > > > Hi, > > does anybody have a binary for Ming on Mac OS X, Ming is a library to > create swf (Macromedia Flash) files. There are Python examples. But I > just can't get the Python Library to compile. If anybody has played with > Ming v0.2 on a mac, please show me the way. > > Any help is appreciated, > Hans > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Chris.Barker@noaa.gov Mon Mar 11 17:30:04 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Mon, 11 Mar 2002 09:30:04 -0800 Subject: [Pythonmac-SIG] Re: [HELP!] PC Line Endings? Batch file replacement References: Message-ID: <3C8CE99C.8AE3E9CF@noaa.gov> This is a multi-part message in MIME format. --------------E6C62C8F6E2E246705BDC51B Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Dean, your utility looks great. My only suggestion is something you've already talked about: converting spaces->tabs and tabs-> spaces while preserving Python symantics. Since this utility is designed to work with Python files, there is absolutely no point in doing it any other way. The code to do it right is not as trivial as I thought when I first started to write it, but then I found a converter on the net that I believe was written by Gordan McMillian. He used the tokenize module to do the heavy lifting, and this guarantees that it is does the way the Python interpreter would do it. I've enclosed it with this email. You should be able to do a quick cut & paste of some of this code into your utility, and have what you want. Note that this code allows convertion to mixed tabs and spaces...please don't allow that option in your version! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov --------------E6C62C8F6E2E246705BDC51B Content-Type: text/plain; charset=us-ascii; name="tabcleaner.py" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="tabcleaner.py" #!/usr/bin/python import tokenize import string TABSONLY = 'TABSONLY' SPACESONLY = 'SPACESONLY' MIXED = 'MIXED' class PyText: def __init__(self, fnm, optdict): self.optdict = optdict self.fnm = fnm self.txt = open(self.fnm, 'r').readlines() self.indents = [(0, 0, )] self.lnndx = 0 self.indentndx = 0 def getline(self): if self.lnndx < len(self.txt): txt = self.txt[self.lnndx] self.lnndx = self.lnndx + 1 else: txt = '' return txt def tokeneater(self, type, token, start, end, line): if type == tokenize.INDENT: (lvl, s) = self.indents[-1] self.indents[-1] = (lvl, s, start[0]-1) self.indents.append((lvl+1, start[0]-1,)) elif type == tokenize.DEDENT: (lvl, s) = self.indents[-1] self.indents[-1] = (lvl, s, start[0]-1) self.indents.append((lvl-1, start[0]-1,)) elif type == tokenize.ENDMARKER: (lvl, s) = self.indents[-1] self.indents[-1] = (lvl, s, len(self.txt)) def split(self, ln): content = string.lstrip(ln) if not content: return ('', '\n') lead = ln[:len(ln) - len(content)] lead = string.expandtabs(lead) return (lead, content) def process(self): style = self.optdict.get('style', TABSONLY) indent = string.atoi(self.optdict.get('indent', '4')) tabsz = string.atoi(self.optdict.get('tabs', '8')) print 'file %s -> style %s, tabsize %d, indent %d' % (self.fnm, style, tabsz, indent) tokenize.tokenize(self.getline, self.tokeneater) #import pprint #pprint.pprint(self.indents) new = [] for (lvl, s, e) in self.indents: if s >= len(self.txt): break if s == e: continue oldlead, content = self.split(self.txt[s]) #print "oldlead", len(oldlead), `oldlead` if style == TABSONLY: newlead = '\t'*lvl elif style == SPACESONLY: newlead = ' '*(indent*lvl) else: sz = indent*lvl t,spcs = divmod(sz, tabsz) newlead = '\t'*t + ' '*spcs new.append(newlead + content) for ln in self.txt[s+1:e]: lead, content = self.split(ln) #print "lead:", len(lead) new.append(newlead + lead[len(oldlead):] + content) self.save(new) #print "---", self.fnm #for ln in new: # print ln, #print def save(self, txt): bakname = os.path.splitext(self.fnm)[0]+'.bak' print "backing up", self.fnm, "to", bakname #print os.getcwd() try: os.rename(self.fnm, bakname) except os.error: os.remove(bakname) os.rename(self.fnm, bakname) open(self.fnm, 'w').writelines(txt) def test(): tc = PyText('test1.py') tc.process() tc = PyText('test1.py') tc.process(style=TABSONLY) tc = PyText('test1.py') tc.process(style=MIXED, indent=4, tabs=8) tc = PyText('test1.py') tc.process(style=MIXED, indent=2, tabs=8) def cleanfile(fnm, d): if os.path.isdir(fnm) and not os.path.islink(fnm): names = os.listdir(fnm) for name in names: fullnm = os.path.join(fnm, name) if (os.path.isdir(fullnm) and not os.path.islink(fullnm)) or \ os.path.normcase(fullnm[-3:]) == ".py": cleanfile(fullnm, d) return tc = PyText(fnm, d) tc.process() usage="""\ %s [options] [path...] options -T : reformat to TABS ONLY -S : reformat to SPACES ONLY ( -i option is important) -M : reformat to MIXED SPACES / TABS ( -t and -i options important) -t : tab is worth characters -i : indents should be characters -h : print this text path is file or directory """ if __name__ == '__main__': import sys, getopt, os opts, args = getopt.getopt(sys.argv[1:], "TSMht:i:") d = {} print `opts` for opt in opts: if opt[0] == '-T': d['style'] = TABSONLY elif opt[0] == '-S': d['style'] = SPACESONLY elif opt[0] == '-M': d['style'] = MIXED elif opt[0] == '-t': d['tabs'] = opt[1] elif opt[0] == '-i': d['indent'] = opt[1] elif opt[0] == '-h': print usage % sys.argv[0] sys.exit(0) if not args: print usage % sys.argv[0] for arg in args: cleanfile(arg, d) --------------E6C62C8F6E2E246705BDC51B-- From Chris.Barker@noaa.gov Mon Mar 11 17:32:24 2002 From: Chris.Barker@noaa.gov (Chris Barker) Date: Mon, 11 Mar 2002 09:32:24 -0800 Subject: [Pythonmac-SIG] Another (probably) stupid questio References: Message-ID: <3C8CEA28.641E4CA7@noaa.gov> Marcel Prastawa wrote: > On Fri, 8 Mar 2002, Chris Lee wrote: > > I have just upgraded to a G4 processor machine and I am about to do a > > make/install of Macho python. I just have one question does the > > configure file recognize the G4 and set compiler options to optimize for > > the it? > > I don't think that Python has any G4-specific optimizations (Altivec). > Maybe sometime in the future... Probably correct, but you can use native BLAS libraries with the LinearAlgebra package that comes with NumPy, so depending on what you need, you might get some help there. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From macnerd@dontspam.realmspace.com Mon Mar 11 18:35:33 2002 From: macnerd@dontspam.realmspace.com (macnerd) Date: Mon, 11 Mar 2002 10:35:33 -0800 Subject: [Pythonmac-SIG] How-To type/creator and walking through directories? Message-ID: <000301c1c92b$87f7df70$bdc8a8c0@jmenchacant> I have a major annoyance in that I have a CD of HTMLs and GIFs, which = have generic TYPE/CREATORS. I would like to change this to TYPE/CREATOR of my choosing, so I want to = create a tool that will walk through all of the directories. I'm so new to the Mac scripting, so I was wondering if someone could = tell me how can I change the=20 type/creator and walk through the folders. Do the folders look like = UNIX directories in MacPython? Are there symbolic . and ..? From macnerd@dontspam.realmspace.com Mon Mar 11 19:00:11 2002 From: macnerd@dontspam.realmspace.com (macnerd) Date: Mon, 11 Mar 2002 11:00:11 -0800 Subject: [Pythonmac-SIG] Ming on Mac OS X In-Reply-To: Message-ID: <000801c1c92e$f8ea5570$bdc8a8c0@jmenchacant> OK. This is amazing. Really. This opens up a whole lot of possibilities. For really old hokey browsers that can use the Flash plug-in, there are tools to convert dynamically generated content from XML and SVG into a Flash format. This is really really cool. This solves a lot of pratical solutions. I still have this lurking dream for someday a W3C XML standard that would support an animation format that is rich as Flash. Then have follow on tools to migrate SWF files to this format, and vice versa. Then graphic animators can do what they do best, and us developer types can move SWF into an open standard, but still kick SWF around for older browsers. Just a dream... -----Original Message----- From: pythonmac-sig-admin@python.org [mailto:pythonmac-sig-admin@python.org]On Behalf Of Hans verschooten Sent: Sunday, March 10, 2002 11:24 PM To: macnerd@dontspam.realmspace.com Cc: pythonmac-SIG@python.org Subject: Re: [Pythonmac-SIG] Ming on Mac OS X http://www.opaque.net/ming/ On maandag, maart 11, 2002, at 01:27 , macnerd wrote: > Where can I get information about Ming?! This sounds interesting. > Not that I am a big fan of Flash, but by auto-creating Flash files, > it kinda of opens up the technology. > > ciao, > Joaquin > > -----Original Message----- > From: pythonmac-sig-admin@python.org > [mailto:pythonmac-sig-admin@python.org]On Behalf Of Hans verschooten > Sent: Sunday, March 10, 2002 8:45 AM > To: pythonmac-SIG@python.org > Subject: [Pythonmac-SIG] Ming on Mac OS X > > > Hi, > > does anybody have a binary for Ming on Mac OS X, Ming is a library to > create swf (Macromedia Flash) files. There are Python examples. But I > just can't get the Python Library to compile. If anybody has played with > Ming v0.2 on a mac, please show me the way. > > Any help is appreciated, > Hans [snip] From billb@mousa.demon.co.uk Mon Mar 11 19:26:24 2002 From: billb@mousa.demon.co.uk (Bill Bedford) Date: Mon, 11 Mar 2002 19:26:24 +0000 Subject: [Pythonmac-SIG] How-To type/creator and walking through directories? In-Reply-To: <000301c1c92b$87f7df70$bdc8a8c0@jmenchacant> References: <000301c1c92b$87f7df70$bdc8a8c0@jmenchacant> Message-ID: At 10:35 am -0800 11/03/02, macnerd wrote: >I have a major annoyance in that I have a CD of HTMLs and GIFs, >which have generic TYPE/CREATORS. >I would like to change this to TYPE/CREATOR of my choosing, so I >want to create a tool that will walk >through all of the directories. > >I'm so new to the Mac scripting, so I was wondering if someone could >tell me how can I change the >type/creator and walk through the folders. Do the folders look like >UNIX directories in MacPython? >Are there symbolic . and ..? ......Python 2.2:Mac:scripts:fixfiletypes.py will get you started -- Bill Bedford You can win or you can have peace, but not at the same time. From jdm352@mail.usask.ca Tue Mar 12 06:08:30 2002 From: jdm352@mail.usask.ca (jdm352@mail.usask.ca) Date: Tue, 12 Mar 2002 00:08:30 -0600 (CST) Subject: [Pythonmac-SIG] MacPython 2.2 errors after default installation .. ? Message-ID: <1015913310.3c8d9b5e7334a@webmail.usask.ca> (I also posted this to comp.lang.python; then I found this list. I hope no one finds that out of line ..) Hi, I just installed MacPython22 from the full archive installer (this powerbook is not on the net), but I can't get any .py files to execute and double clicking the PythonInterpreterClassic icon tells me: "The document 'PythonInterpreterClasic" could not be opened, because the application "Unknown Python Document" could not be found. Could not find a translation extension with appropriate translators." ConfigurePythonClassic gives a similarly meaningless (to me) error: "The applicaton "ConfigurePythonClassic" could not be opened because "NavigationLib" could not be found" Did I do something wrong during the install? Os 8.1, Powerbook 5300ce 32 MB Thanks, -Jim From Benjamin.Schollnick@usa.xerox.com Tue Mar 12 12:46:22 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Tue, 12 Mar 2002 07:46:22 -0500 Subject: [ot] Mcmillian's tools, was (RE: [Pythonmac-SIG] Re: [HELP!] PC L ine Endings? Batch file replacement) Message-ID: I just had to throw this in, when I saw this comment... >g< > The code to do it right is not as trivial as I thought when I first > started to write it, but then I found a converter on the net that I > believe was written by Gordan McMillian. He used the tokenize module to > do the heavy lifting, and this guarantees that it is does the way the > Python interpreter would do it. I've enclosed it with this email. You > should be able to do a quick cut & paste of some of this code into your > utility, and have what you want. > > Note that this code allows convertion to mixed tabs and spaces...please > don't allow that option in your version! Just a quick note, I've been using Gordon's McMillian's installer package, for ages.... I highly recommend his tools, and he's been extremely helpful when I've had questions regarding his software, and/or bug fixes.... - Benjamin From Benjamin.Schollnick@usa.xerox.com Tue Mar 12 12:59:07 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Tue, 12 Mar 2002 07:59:07 -0500 Subject: [Pythonmac-SIG] How-To type/creator and walking through direc tories? Message-ID: This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. --Boundary_(ID_f9HEGowPMe0C/DLIhEPURA) Content-type: text/plain; charset="utf-8" Included in with the python distrib., is a script called "fixfiletypes", it can and will do what your asking for..... Although, you may have to look up the creator/type code(s). The original script is designed to reset the file types for python scripts & C files, but I've made a few modifications....(And included my changed version with this message). 1) The original (at least python v2.0), is case sensitive to the file extension. fix: if os.path.isfile(name): for ext, cr, tp in list: if string.upper(name[-len(ext):]) == ext: fs = macfs.FSSpec(name) curcrtp = fs.GetCreatorType() if curcrtp <> (cr, tp): if change: fs.SetCreatorType(cr, tp) macostools.touched(fs) print 'Fixed ', name else: print 'Wrong', curcrtp, name The string.upper(name..... removes this dependency.... 2) It only contains creator, etc, information for python code.... (I seem to remember that the original had a few additional entries, but I'm not motivated enough to verify this): The #1 change, impact the list now... The file extension has to be in uppercase, but you now only need a single entry.... If anyone else would like to contribute additional Creator/type codes please feel free to contact me... # File Extension # Creator Code # Type Code list = [ ('.AIFF', 'SCPL', 'AIFF'), ('.AVI', 'TVOD', 'VfW '), # AVI Format (Quicktime) ('.AS', 'ToyS', 'TEXT'), ('.C', 'CWIE', 'TEXT'), ('.CMC', 'CMIF', 'CMC '), ('.CMIF', 'CMIF', 'TEXT'), ('.GIF', 'GKON', 'GIFf'), # GIF Format (Graphic Converter) ('.H', 'CWIE', 'TEXT'), ('.HQX', 'SITx', 'TEXT'), # HQX (Stuffit Archive) ('.JPG', 'GKON', 'JPEG'), # JPG (Graphic Converter) ('.JPEG', 'GKON', 'JPEG'), # JPG (Graphic Converter) ('.MOV', 'TVOD', 'MooV'), # Quicktime (MOV) ('.MOOV', 'TVOD', 'MooV'), # Quicktime (MOV) ('.MPG', 'TVOD', 'MPG '), # Quicktime (MPG) ('.MPEG', 'TVOD', 'MPG '), # Quicktime (MPG) ('.PDF', 'CARO', 'PDF '), # Adobe Acrobat PDF File ('.PM6', 'ALD6', 'ALB6'), # Pagemaker v6.0 File ('.P65', 'AD65', 'APPL'), ('.PY', 'Pyth', 'TEXT'), ('.PYC', 'Pyth', 'PYC '), ('.SMI', 'oneb', 'APPL'), ('.WAV', 'TVOD', 'WAVE'), ('.XLS', 'XCEL', 'XLS8'), ('.ZIP', 'SITx', 'ZIP ') ] I've found this script to be extremely helpful, and powerful. Of course, "with great power, comes great responsiblity". Misuse of this script, can impede or even "damage" your system. A bad type/creator code, can make files unusable until you reset the code(s) to the proper settings. - Benjamin -----Original Message----- From: macnerd [mailto:macnerd@realmspace.com] Sent: Monday, March 11, 2002 1:36 PM To: pythonmac-SIG@python.org Subject: [Pythonmac-SIG] How-To type/creator and walking through directories? I have a major annoyance in that I have a CD of HTMLs and GIFs, which have generic TYPE/CREATORS. I would like to change this to TYPE/CREATOR of my choosing, so I want to create a tool that will walk through all of the directories. I'm so new to the Mac scripting, so I was wondering if someone could tell me how can I change the type/creator and walk through the folders. Do the folders look like UNIX directories in MacPython? Are there symbolic . and ..? _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig --Boundary_(ID_f9HEGowPMe0C/DLIhEPURA) Content-type: application/octet-stream; name="fixfiletypes.py" Content-disposition: attachment; filename="fixfiletypes.py" # # Fixfiletypes - Set mac filetypes to something sensible, # recursively down a directory tree. # # It will only touch extensions it feels pretty sure about. # This script is useful after copying files from unix. # # Jack Jansen, CWI, 1995. # import os import macfs import sys import macostools import string # File Extension # Creator Code # Type Code list = [ ('.AIFF', 'SCPL', 'AIFF'), ('.AVI', 'TVOD', 'VfW '), # AVI Format (Quicktime) ('.AS', 'ToyS', 'TEXT'), ('.C', 'CWIE', 'TEXT'), ('.CMC', 'CMIF', 'CMC '), ('.CMIF', 'CMIF', 'TEXT'), ('.GIF', 'GKON', 'GIFf'), # GIF Format (Graphic Converter) ('.H', 'CWIE', 'TEXT'), ('.HQX', 'SITx', 'TEXT'), # HQX (Stuffit Archive) ('.JPG', 'GKON', 'JPEG'), # JPG (Graphic Converter) ('.JPEG', 'GKON', 'JPEG'), # JPG (Graphic Converter) ('.MOV', 'TVOD', 'MooV'), # Quicktime (MOV) ('.MOOV', 'TVOD', 'MooV'), # Quicktime (MOV) ('.MPG', 'TVOD', 'MPG '), # Quicktime (MPG) ('.MPEG', 'TVOD', 'MPG '), # Quicktime (MPG) ('.PDF', 'CARO', 'PDF '), # Adobe Acrobat PDF File ('.PM6', 'ALD6', 'ALB6'), # Pagemaker v6.0 File ('.P65', 'AD65', 'APPL'), ('.PY', 'Pyth', 'TEXT'), ('.PYC', 'Pyth', 'PYC '), ('.SMI', 'oneb', 'APPL'), ('.WAV', 'TVOD', 'WAVE'), ('.XLS', 'XCEL', 'XLS8'), ('.ZIP', 'SITx', 'ZIP ') ] def walktree(name, change): if os.path.isfile(name): for ext, cr, tp in list: if string.upper(name[-len(ext):]) == ext: fs = macfs.FSSpec(name) curcrtp = fs.GetCreatorType() if curcrtp <> (cr, tp): if change: fs.SetCreatorType(cr, tp) macostools.touched(fs) print 'Fixed ', name else: print 'Wrong', curcrtp, name elif os.path.isdir(name): print '->', name files = os.listdir(name) for f in files: walktree(os.path.join(name, f), change) def run(change): fss, ok = macfs.GetDirectory('Folder to search:') if not ok: sys.exit(0) walktree(fss.as_pathname(), change) if __name__ == '__main__': run(1) --Boundary_(ID_f9HEGowPMe0C/DLIhEPURA)-- From Benjamin.Schollnick@usa.xerox.com Tue Mar 12 13:02:00 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Tue, 12 Mar 2002 08:02:00 -0500 Subject: [Pythonmac-SIG] MacPython 2.2 errors after default installati on .. ? Message-ID: Do the python scripts have the "python" icon? Or are they a generic icon? If they are a generic icon, then you may need to rebuild your desktop. (Press and hold down the option-Open Apple (command) key, during boot up. Eventually the mac will ask if you want to rebuild the desktop... ) - Benjamin -----Original Message----- From: jdm352@mail.usask.ca [mailto:jdm352@mail.usask.ca] Sent: Tuesday, March 12, 2002 1:09 AM To: pythonmac-sig@python.org Subject: [Pythonmac-SIG] MacPython 2.2 errors after default installation .. ? (I also posted this to comp.lang.python; then I found this list. I hope no one finds that out of line ..) Hi, I just installed MacPython22 from the full archive installer (this powerbook is not on the net), but I can't get any .py files to execute and double clicking the PythonInterpreterClassic icon tells me: "The document 'PythonInterpreterClasic" could not be opened, because the application "Unknown Python Document" could not be found. Could not find a translation extension with appropriate translators." ConfigurePythonClassic gives a similarly meaningless (to me) error: "The applicaton "ConfigurePythonClassic" could not be opened because "NavigationLib" could not be found" Did I do something wrong during the install? Os 8.1, Powerbook 5300ce 32 MB Thanks, -Jim _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From Jack.Jansen@oratrix.com Tue Mar 12 15:09:45 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 12 Mar 2002 16:09:45 +0100 Subject: [Pythonmac-SIG] Ming on Mac OS X In-Reply-To: <000801c1c92e$f8ea5570$bdc8a8c0@jmenchacant> Message-ID: <2FFEA5E5-35CB-11D6-9F4A-0030655234CE@oratrix.com> On Monday, March 11, 2002, at 08:00 , macnerd wrote: > I still have this lurking dream for someday a W3C XML > standard that would support an animation format that is > rich as Flash. Just a moment while I borrow Guido's time machine.... [>POOF<] Have a look at the SVG standard. With the SMIL timing in there it should allow you to do most things that you can do in flash. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Tue Mar 12 15:12:08 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 12 Mar 2002 16:12:08 +0100 Subject: [Pythonmac-SIG] How-To type/creator and walking through direc tories? In-Reply-To: Message-ID: <856C8EC2-35CB-11D6-9F4A-0030655234CE@oratrix.com> On Tuesday, March 12, 2002, at 01:59 , Schollnick, Benjamin wrote: > 2) It only contains creator, etc, information for python code.... > (I seem to remember that the original had a few additional entries, > but I'm not motivated enough to verify this): It should really use Internet Config to map extension to file creator/type. Any takers? -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Benjamin.Schollnick@usa.xerox.com Tue Mar 12 15:56:51 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Tue, 12 Mar 2002 10:56:51 -0500 Subject: [Pythonmac-SIG] How-To type/creator and walking through direc tories? Message-ID: I'm running Mac OS 9.21 on a QuickSliver macintosh.... Anyone know why I'd be getting IC errors? icgluetest.py lici.ICFindConfigFile() AttributeError: ICFindConfigFile test app.py File "...", line 210, in mapfile return self.ic.ICMapFilename (file) icglue.error: -666 if os.path.isfile(name): for ext, cr, tp in list: if string.upper(name[-len(ext):]) == ext: fs = macfs.FSSpec(name) mapping = Internet_config.mapfile (name) print name, "\t...." And, where is the Internet Config settings made? I remember there being a Internet Config control panel, but I don't see it on this machine.... (I remember it being a 3rd party add-on?) - Benjamin -----Original Message----- From: Jack Jansen [mailto:Jack.Jansen@oratrix.com] Sent: Tuesday, March 12, 2002 10:12 AM To: Schollnick, Benjamin Cc: 'macnerd@realmspace.com'; pythonmac-SIG@python.org Subject: Re: [Pythonmac-SIG] How-To type/creator and walking through direc tories? On Tuesday, March 12, 2002, at 01:59 , Schollnick, Benjamin wrote: > 2) It only contains creator, etc, information for python code.... > (I seem to remember that the original had a few additional entries, > but I'm not motivated enough to verify this): It should really use Internet Config to map extension to file creator/type. Any takers? -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From macnerd@dontspam.realmspace.com Tue Mar 12 18:28:44 2002 From: macnerd@dontspam.realmspace.com (macnerd) Date: Tue, 12 Mar 2002 10:28:44 -0800 Subject: [Pythonmac-SIG] Ming on Mac OS X In-Reply-To: <2FFEA5E5-35CB-11D6-9F4A-0030655234CE@oratrix.com> Message-ID: <000501c1c9f3$bee63b80$bdc8a8c0@corp.good.com> The question is, can you get graphic design folks to program in SMIL and SVG, especially when so few browsers support SMIL. Is there any movement to make a plug-in to SMIL, or support for conversion to and fro SWF<->SMIL?!? I hope more cool libraries can be made available under Python for this support. :-) > -----Original Message----- > From: pythonmac-sig-admin@python.org > [mailto:pythonmac-sig-admin@python.org]On Behalf Of Jack Jansen > Sent: Tuesday, March 12, 2002 7:10 AM > To: macnerd@dontspam.realmspace.com > Cc: 'Hans verschooten'; pythonmac-SIG@python.org > Subject: Re: [Pythonmac-SIG] Ming on Mac OS X > > > > On Monday, March 11, 2002, at 08:00 , macnerd wrote: > > I still have this lurking dream for someday a W3C XML > > standard that would support an animation format that is > > rich as Flash. > > Just a moment while I borrow Guido's time machine.... > > [>POOF<] > > Have a look at the SVG standard. With the SMIL timing in > there it should > allow you to do most things that you can do in flash. > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- Emma > Goldman - > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From macnerd@dontspam.realmspace.com Tue Mar 12 18:40:04 2002 From: macnerd@dontspam.realmspace.com (macnerd) Date: Tue, 12 Mar 2002 10:40:04 -0800 Subject: [Pythonmac-SIG] How-To type/creator and walking through direc tories? In-Reply-To: <856C8EC2-35CB-11D6-9F4A-0030655234CE@oratrix.com> Message-ID: <000701c1c9f5$54055290$bdc8a8c0@corp.good.com> Could I get some clarification?!? I am not sure what you mean? Can Python somehow have support for auto-set of type/creator? I know Apple bundled this freeware, but they have their own facility through FileExchange (aka PC Exchange), so I don't know which one has precedence, or if they are both consistant. I would prefer Internet Config as this is I think open source. On a different topic, I had an idea about environment variables. Perhaps we can add a tab to Internet Config called Environment can get other script/cli environments to support this. I mentioned the idea on the MacPerl list. - Joaquin > On Tuesday, March 12, 2002, at 01:59 , Schollnick, Benjamin wrote: > > 2) It only contains creator, etc, information for python code.... > > (I seem to remember that the original had a few > additional entries, > > but I'm not motivated enough to verify this): > > It should really use Internet Config to map extension to file > creator/type. > > Any takers? > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- Emma > Goldman - > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From Benjamin.Schollnick@usa.xerox.com Tue Mar 12 18:41:59 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Tue, 12 Mar 2002 13:41:59 -0500 Subject: [Pythonmac-SIG] How-To type/creator and walking through direc tories? Message-ID: Guys, I've sat down and quickly revised fixfiletypes to use IC. But I'm running into a small problem, and it's caused by my ignorance of the present day version of IC. The Type/Creator codes being returned, are _odd_ and IMHO out of date. Neither the FileExchange or "ConfigurationManager" control panels contain these mappings... (The previous problem I was having, was that IC doesn't have a ".PY" entry, so for the present time, I'm ignoring .py....) So can anyone tell me where the IC preferences are stored? And what to use to change the the settings? - Benjamin -----Original Message----- From: Jack Jansen [mailto:Jack.Jansen@oratrix.com] Sent: Tuesday, March 12, 2002 10:12 AM To: Schollnick, Benjamin Cc: 'macnerd@realmspace.com'; pythonmac-SIG@python.org Subject: Re: [Pythonmac-SIG] How-To type/creator and walking through direc tories? On Tuesday, March 12, 2002, at 01:59 , Schollnick, Benjamin wrote: > 2) It only contains creator, etc, information for python code.... > (I seem to remember that the original had a few additional entries, > but I'm not motivated enough to verify this): It should really use Internet Config to map extension to file creator/type. Any takers? -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Benjamin.Schollnick@usa.xerox.com Tue Mar 12 19:14:11 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Tue, 12 Mar 2002 14:14:11 -0500 Subject: [Pythonmac-SIG] IC under Mac OS v9.21 Message-ID: Ok, I figured out part of my confusion... In Mac Os v8.5, Apple incorporated Internet Config in to the "Internet" [Advanced -> Filemapping] control panel.... >sigh< Seldom used feature... But the IC module is *not* returning what is configured under that panel. Can anyone validate that the IC module, specifically mapfile, settypecreator, are working to spec? For example, in the Internet control panel, I have .JPEG & .JPG set to -> JPEG / ogle (picture Viewer). IC is setting it to: "EGog" & "le " (unknown). I'm starting to suspect that the IC module may not (in Python v2.11) be up to spec? Comments? - Benjamin From Jack.Jansen@oratrix.com Tue Mar 12 20:43:19 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 12 Mar 2002 21:43:19 +0100 Subject: [Pythonmac-SIG] IC under Mac OS v9.21 In-Reply-To: Message-ID: On dinsdag, maart 12, 2002, at 08:14 , Schollnick, Benjamin wrote: > But the IC module is *not* returning what is configured under that > panel. > Can anyone validate that the IC module, specifically mapfile, > settypecreator, > are working to spec? > > For example, in the Internet control panel, I have .JPEG & .JPG set > to -> JPEG / ogle (picture Viewer). IC is setting it to: > "EGog" & "le " > (unknown). Oops, big oops! There indeed seems to be an off-by-2 error in MacPython 2.2 ic (actually the underlying icglue module). Could you file a bugreport in sourceforge? And make it priority 7 so I get to fix this before 2.2.1, please. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From macnerd@dontspam.realmspace.com Tue Mar 12 20:09:55 2002 From: macnerd@dontspam.realmspace.com (macnerd) Date: Tue, 12 Mar 2002 12:09:55 -0800 Subject: [Pythonmac-SIG] How-To type/creator and walking through directories? In-Reply-To: Message-ID: <000001c1ca01$e13b6a30$bdc8a8c0@corp.good.com> Akkkkk.... I have 3 different file/type creator mappers on my machine. Akkkkk.... (1) Application -> InternetConfig 1.4 DataStore -> {System Preferences}:"Internet Preferences" RsrcFrk -> CURP, ftag, ICRP, vers (2) Application -> Internet (Apple's version of IC) DataStore -> {System Preferences}:"Internet Preferences" RsrcFrk -> CURP, ftag, ICRP, vers (3) Application -> File Exchange DataStore -> {System Preferences}:"File Exchange Preferences" RsrcFrk -> cxlt, fxlt, mirt, mppn, pcxp, prat, prfa, stup, sxlt, wdpn ConfigData -> prats I think somehow the Internet CP or IC14 has like 40 defaults somewhere, becuase I get a newly created preference with 40 defaults. The FileExchange program stores their own mappings for foreign media, like DOS FAT. I wonder if FileExchange plug's into the Internet control panel's interface to gather additional mappings. I also found this extension that I am unsure of their functionality: (1) {System Extensions}:"Internet Config Extension" Anyway, I hope this helps. I interface to Apple's Internet is really cool, while IC1.4 looks like it was spawned on System 6. Actually I think it was... As far as FileExchange, I talked with Apple Engineer's about opening this up, when I was contacting there, but they told me to wait for their cool new spiffy File System Manager being developed for the new exciting System 9 OS (Copeland/Maxell) that would use this new NuKernal, and back ported to then System 7/8. If anyone's interested I could see if I could contact them, if they are still there. Is IC still maintained?!? It would be nice to get an open source version of Apple's Internet control panel, and maybe add an Environment tab, for applications that want to share environment information. ciao, Joaquin > -----Original Message----- > From: Schollnick, Benjamin [mailto:Benjamin.Schollnick@usa.xerox.com] > Sent: Tuesday, March 12, 2002 10:42 AM > To: 'Jack Jansen'; Schollnick, Benjamin > Cc: 'macnerd@realmspace.com'; pythonmac-SIG@python.org > Subject: RE: [Pythonmac-SIG] How-To type/creator and walking through > directories? > Importance: High > > > Guys, > > I've sat down and quickly revised fixfiletypes to use IC. > > But I'm running into a small problem, and it's caused by my > ignorance of > the present day version of IC. > > The Type/Creator codes being returned, are _odd_ and IMHO out of > date. > Neither the FileExchange or "ConfigurationManager" > control panels > contain > these mappings... > > (The previous problem I was having, was that IC doesn't > have a ".PY" > entry, > so for the present time, I'm ignoring .py....) > > So can anyone tell me where the IC preferences are > stored? And what > to use to change the the settings? > > - Benjamin > -----Original Message----- > From: Jack Jansen [mailto:Jack.Jansen@oratrix.com] > Sent: Tuesday, March 12, 2002 10:12 AM > To: Schollnick, Benjamin > Cc: 'macnerd@realmspace.com'; pythonmac-SIG@python.org > Subject: Re: [Pythonmac-SIG] How-To type/creator and walking through > direc tories? > > > > On Tuesday, March 12, 2002, at 01:59 , Schollnick, Benjamin wrote: > > 2) It only contains creator, etc, information for python code.... > > (I seem to remember that the original had a few > additional entries, > > but I'm not motivated enough to verify this): > > It should really use Internet Config to map extension to file > creator/type. > > Any takers? > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- Emma > Goldman - > From Benjamin.Schollnick@usa.xerox.com Thu Mar 14 18:45:41 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Thu, 14 Mar 2002 13:45:41 -0500 Subject: [Pythonmac-SIG] Adobe / Laserwriter (Mac OS 8.x / 9.x) background printing settin g? Message-ID: Folks, This is going to be a strange question.... (I'm famous for them, at least in my own mind) But I'm running into a situation where I need to go through and set the Adobe PS (v8.6 & v8.7) to turn off background printing (& save the setting) for *ALL* the printers the mac is configured for. Is there someway to directly modify the ADOBE preference file, or to automate the processes with Python? Or any other suggestions on ways to do it? - Benjamin From csmith@blakeschool.org Thu Mar 14 22:37:06 2002 From: csmith@blakeschool.org (Christopher Smith) Date: Thu, 14 Mar 2002 16:37:06 -0600 Subject: [Pythonmac-SIG] islink() in macpath and directory walk In-Reply-To: References: Message-ID: I was using the walk function to go through directories and change modification times on files which, because of a daylight savings issue are 1 hour different than a backup set that I have. I've run into two issues: 1) I don't want to follow aliases to other folders--I just want to update files that are physically in the root folder and its subfolders. So it seems that I must remove aliases in the list of files that is passed to the function that is called as walk() takes place. I noticed that in macpath there is an islink() function that says def islink(s): """Return true if the pathname refers to a symbolic link. Always false on the Mac, until we understand Aliases.""" return 0 Maybe this is just a function that hasn't been used by others and has thus never been updated...is there any reason not to have the function do the following return? return macfs.ResolveAliasFile(s)[2] The [2]th value is 1 or 0 depending on whether or not the file specified by s is an alias. 2) If I *do* want to follow aliases, I don't want to get trapped in an infinite loop caused when two folders contain aliases of each other. Is there a clever "loop detection" algorithm for this short of keeping track of every folder visited? what is this condition called? (I checked ASPN with "loop detection", "walk detection", etc...without a lot of success.) /c From adam@switchedonsoftware.com Thu Mar 14 23:55:25 2002 From: adam@switchedonsoftware.com (Adam Eijdenberg) Date: Fri, 15 Mar 2002 10:55:25 +1100 Subject: [Pythonmac-SIG] islink() in macpath and directory walk In-Reply-To: Message-ID: > Maybe this is just a function that hasn't been used by others and has > thus > never been updated...is there any reason not to have the function do the > following return? > > return macfs.ResolveAliasFile(s)[2] Can't answer that one for you, but... > 2) If I *do* want to follow aliases, I don't want to get trapped in an > infinite loop caused when two folders contain aliases of each other. Is > there a clever "loop detection" algorithm for this short of keeping > track > of every folder visited? what is this condition called? (I checked > ASPN > with "loop detection", "walk detection", etc...without a lot of > success.) This is more of a general programming question. One method I have used for similar projects, is start with two empty lists, say TO_PROCESS and DONE. Add your first job (or in this case "root" folder) to TO_PROCESS and to DONE and then run something like the following: while len (TO_PROCESS) > 0: job = TO_PROCESS.pop () ... process job, possibly getting new child jobs and adding them as below .... if not (newChildJob in DONE): TO_PROCESS.append (newChildJob) DONE.append (newChildJob) Not sure what you would exactly call this condition, but solving it with queues is usually fairly simple. Hope that helps, Adam From junkster@rochester.rr.com Mon Mar 18 03:11:50 2002 From: junkster@rochester.rr.com (Benjamin Schollnick) Date: Sun, 17 Mar 2002 22:11:50 -0500 Subject: [Pythonmac-SIG] Interesting issue? Message-ID: Folks, I'm updating a obviously Unix Centric script.... And I've noticed a slight issue.... In it, the author has explicitly set the sys.stdin & sys.stdout, and I've noticed that sometimes v2.2 seems to "freeze".... I haven't really checked this out too heavily, so it could be a DNS issue....(Taking a EXTRAORDINARILY long time to resolve).... But is there any known issues with using explicit stdout / stdin calls? - Benjamin From Aureli.Soria_Frisch@ipk.fhg.de Mon Mar 18 18:37:08 2002 From: Aureli.Soria_Frisch@ipk.fhg.de (Aureli Soria Frisch) Date: Mon, 18 Mar 2002 19:37:08 +0100 Subject: [Pythonmac-SIG] Gnuplot on Python2.2 under Mac OS 8.6 In-Reply-To: References: Message-ID: Hi all, I was using Python2.0 under Mac OS 8.6 and today I decided to update (better late than never...) I was trying to run Gnuplot.py as I did on Python 2.0 but something works wrong. When I try to import Gnuplot, the module is not found (although the directory being declared in the PythonPrefs). I have made the same modifications on the files of Gnuplot that I did in order to get it run under Python2.0: 1. Adding to StdSuites:Required_Suite.py the methods: open, _print, quit, run (as implemented in StdSuites:Standard_Suite) 2. In gp_mac changing import Required_Suite by import StdSuites.Required_Suite 3. In gp_mac.py class _GNUPLOT declaration changing Required_Suite.Required_Suite by StdSuites.Required_Suite.Required_Suite_Events 4. here in the __init__ method changing aetools.TalkTo.__init__(self, 'GPSE', start=1) by aetools.TalkTo.__init__(self, '{GP}', start=1) but still does not work. Can someone help me bringing Gnuplot to run? Thanks in advance, Aureli Soria-Frisch ################################# Aureli Soria Frisch Fraunhofer IPK Dept. Pattern Recognition post: Pascalstr. 8-9, 10587 Berlin, Germany e-mail: aureli@ipk.fhg.de fon: +49 30 39006-150 fax: +49 30 3917517 web: http://vision.fhg.de/~aureli/web-aureli_en.html ################################# From brobbins333@shaw.ca Mon Mar 18 23:19:40 2002 From: brobbins333@shaw.ca (Bruce Robbins) Date: Mon, 18 Mar 2002 15:19:40 -0800 Subject: [Pythonmac-SIG] MacPython IDE 1.0.1 -- Is this a bug? Message-ID: <000501c1ced3$6144ba80$6501a8c0@gv.shawcable.net> Try running this AS A SCRIPT in the MacPython IDE v.1.0.1: list = [33, 44, 55, 66] for each in list: print each, Make sure you include the comma after the print each statement. Then try it without the comma. No output in the output window when run with the comma -- until the script is run again without the comma! Bruce Robbins Victoria, BC Canada brobbins333@shaw.ca From brobbins333@shaw.ca Mon Mar 18 23:18:35 2002 From: brobbins333@shaw.ca (Bruce Robbins) Date: Mon, 18 Mar 2002 15:18:35 -0800 Subject: [Pythonmac-SIG] MacPython IDE 1.0.1 -- Is this a bug? Message-ID: <000501c1ced3$3a78c860$6501a8c0@gv.shawcable.net> From sdm7g@Virginia.EDU Tue Mar 19 00:18:21 2002 From: sdm7g@Virginia.EDU (Steven Majewski) Date: Mon, 18 Mar 2002 19:18:21 -0500 (EST) Subject: [Pythonmac-SIG] MacPython IDE 1.0.1 -- Is this a bug? In-Reply-To: <000501c1ced3$6144ba80$6501a8c0@gv.shawcable.net> Message-ID: On Mon, 18 Mar 2002, Bruce Robbins wrote: > Try running this AS A SCRIPT in the MacPython IDE v.1.0.1: > > list = [33, 44, 55, 66] > > for each in list: > print each, > > > Make sure you include the comma after the print each statement. > Then try it without the comma. > > No output in the output window when run with the comma -- until > the script is run again without the comma! > If you append either: print or import sys; sys.stdout.flush() after your two lines above, you'll get the output. (The first with a trailing newline, the latter without.) I'm guessing that sys.stdout.close() would also work, but wouldn't be very useful to you. That should make the reason for the behaviour obvious. ( You don't get it in the interpreter window, because the line gets flushed when it prints out a '>>>' prompt for the next input line.) Is it a bug? I'ld vote no -- it matches exactly what would happen if you had a script writing to a file, or executed a script on the unix command line (so you wouldn't get any prompts to the terminal) except that sys.stdout would get flushed and closed at program termination. -- Steve Majewski From Jack.Jansen@oratrix.com Tue Mar 19 13:03:22 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 19 Mar 2002 14:03:22 +0100 Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available Message-ID: MacPython 2.2.1c1 is available via http://www.cwi.nl/~jack/macpython.html . This is a release candidate for MacPython 2.2.1, expected later this month. Please give it a try and report your findings to pythonmac-sig@python.org. This is a patch release, so it should be 100% compatible with MacPython 2.2. This release should run on any MacOS version from 8.1 through 10.1.3 (but for 8.1 you will need to download an additional patch if you want to use the IDE). Many bugs were fixed in this release. The two that deserve special mention are that this release should finally work on a Mac OS X multiprocessor, and that the problems with short read()s from sockets have been addressed. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Benjamin.Schollnick@usa.xerox.com Tue Mar 19 13:21:14 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Tue, 19 Mar 2002 08:21:14 -0500 Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available Message-ID: By any chance does this incorporate the ICGLUE byte alignment fix? - Benjamin -----Original Message----- From: Jack Jansen [mailto:Jack.Jansen@oratrix.com] Sent: Tuesday, March 19, 2002 8:03 AM To: pythonmac-sig@python.org; python-announce-list@python.org Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available MacPython 2.2.1c1 is available via http://www.cwi.nl/~jack/macpython.html . This is a release candidate for MacPython 2.2.1, expected later this month. Please give it a try and report your findings to pythonmac-sig@python.org. This is a patch release, so it should be 100% compatible with MacPython 2.2. This release should run on any MacOS version from 8.1 through 10.1.3 (but for 8.1 you will need to download an additional patch if you want to use the IDE). Many bugs were fixed in this release. The two that deserve special mention are that this release should finally work on a Mac OS X multiprocessor, and that the problems with short read()s from sockets have been addressed. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From Jack.Jansen@oratrix.com Tue Mar 19 13:34:46 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 19 Mar 2002 14:34:46 +0100 Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available In-Reply-To: Message-ID: <145D4574-3B3E-11D6-894E-0030655234CE@oratrix.com> On Tuesday, March 19, 2002, at 02:21 , Schollnick, Benjamin wrote: > By any chance does this incorporate the ICGLUE > byte alignment fix? Yes, it does. It's in the release notes too:-) -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Tue Mar 19 13:40:03 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 19 Mar 2002 14:40:03 +0100 Subject: [Pythonmac-SIG] MacPython IDE 1.0.1 -- Is this a bug? In-Reply-To: Message-ID: On Tuesday, March 19, 2002, at 01:18 , Steven Majewski wrote: > > > On Mon, 18 Mar 2002, Bruce Robbins wrote: > >> Try running this AS A SCRIPT in the MacPython IDE v.1.0.1: >> >> list = [33, 44, 55, 66] >> >> for each in list: >> print each, >> >> >> Make sure you include the comma after the print each statement. >> Then try it without the comma. >> >> No output in the output window when run with the comma -- until >> the script is run again without the comma! >> > > If you append either: > > > print > > or > > import sys; sys.stdout.flush() The latter is the correct fix, I think. And really the IDE should do this for you, but I don't really know when: when a script finishes? When we get back into the main loop? -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From brobbins333@shaw.ca Tue Mar 19 18:22:26 2002 From: brobbins333@shaw.ca (Bruce Robbins) Date: Tue, 19 Mar 2002 10:22:26 -0800 Subject: [Pythonmac-SIG] MacPython IDE -- Is this a bug? Message-ID: <000501c1cf73$05ab8500$6501a8c0@gv.shawcable.net> This runs as expected as a script in the PythonWin IDE, so I guess there would be disagreement whether it constitutes a "bug." If I were the author of the MacPython IDE, I think I would try to fix it. BR On Mon, 18 Mar 2002, Bruce Robbins wrote: > Try running this AS A SCRIPT in the MacPython IDE v.1.0.1: > > list = [33, 44, 55, 66] > > for each in list: > print each, > > > Make sure you include the comma after the print each statement. > Then try it without the comma. > > No output in the output window when run with the comma -- until > the script is run again without the comma! > If you append either: print or import sys; sys.stdout.flush() after your two lines above, you'll get the output. (The first with a trailing newline, the latter without.) I'm guessing that sys.stdout.close() would also work, but wouldn't be very useful to you. That should make the reason for the behaviour obvious. ( You don't get it in the interpreter window, because the line gets flushed when it prints out a '>>>' prompt for the next input line.) Is it a bug? I'ld vote no -- it matches exactly what would happen if you had a script writing to a file, or executed a script on the unix command line (so you wouldn't get any prompts to the terminal) except that sys.stdout would get flushed and closed at program termination. -- Steve Majewski From Benjamin.Schollnick@usa.xerox.com Tue Mar 19 18:26:30 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Tue, 19 Mar 2002 13:26:30 -0500 Subject: [Pythonmac-SIG] MacPython IDE -- Is this a bug? Message-ID: You can fix, I presume... Turn off the Caching of the MacPython display... - Benjamin -----Original Message----- From: Bruce Robbins [mailto:brobbins333@shaw.ca] Sent: Tuesday, March 19, 2002 1:22 PM To: pythonmac-sig@python.org Subject: [Pythonmac-SIG] MacPython IDE -- Is this a bug? This runs as expected as a script in the PythonWin IDE, so I guess there would be disagreement whether it constitutes a "bug." If I were the author of the MacPython IDE, I think I would try to fix it. BR On Mon, 18 Mar 2002, Bruce Robbins wrote: > Try running this AS A SCRIPT in the MacPython IDE v.1.0.1: > > list = [33, 44, 55, 66] > > for each in list: > print each, > > > Make sure you include the comma after the print each statement. > Then try it without the comma. > > No output in the output window when run with the comma -- until > the script is run again without the comma! > If you append either: print or import sys; sys.stdout.flush() after your two lines above, you'll get the output. (The first with a trailing newline, the latter without.) I'm guessing that sys.stdout.close() would also work, but wouldn't be very useful to you. That should make the reason for the behaviour obvious. ( You don't get it in the interpreter window, because the line gets flushed when it prints out a '>>>' prompt for the next input line.) Is it a bug? I'ld vote no -- it matches exactly what would happen if you had a script writing to a file, or executed a script on the unix command line (so you wouldn't get any prompts to the terminal) except that sys.stdout would get flushed and closed at program termination. -- Steve Majewski _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From ryanwilcox@mac.com Tue Mar 19 19:26:45 2002 From: ryanwilcox@mac.com (Ryan Wilcox) Date: Tue, 19 Mar 2002 14:26:45 -0500 Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available In-Reply-To: Message-ID: <20020319142648-r01010800-78321584-0920-010c@129.21.139.65> On Tuesday, March 19, 2002, at 2:03 PM, Jack.Jansen@oratrix.com (Jack Jansen) wrote: >Many bugs were fixed in this release. I installed the latest version, and ConfigurePythonCore LAUNCHED for me (I am running X.1.3) So maybe you fixed that bug also? HTH, -Ryan Wilcox ----------------------------------------------------------------- PGP: 0x2F4E9C31 Weblog: http://radio.weblogs.com/0100544/ From kevino@tulane.edu Tue Mar 19 20:20:56 2002 From: kevino@tulane.edu (Kevin Ollivier) Date: Tue, 19 Mar 2002 15:20:56 -0500 Subject: [Pythonmac-SIG] Re: [wxPython-mac] Porting wxPython to Mac References: Message-ID: <007301c1cf83$a7db0a20$6d01a8c0@kevinnew> Hi Jack, Will do. Also, let me quickly update you on what I've been doing with MachOPython in my spare moments. Right now I'm focusing on the Python.app multiple instances issue, and basically trying to create a hack to have Python.app start command-line Python and then close. execv(path, argv) (in ) starts command line Python fine, but it doesn't terminate Python.app, and I couldn't find an exec variant that did this. I think I could set up an AppleEvents handler to open a second, third, etc. instances of the command-line Python (is that were document open events go?), but I'm trying to avoid having an extra dock icon for Python.app. I looked at the CoreService's LaunchApplication() function, and from the docs it sounds like there's an option for terminating the parent process with that, but I'm unable to get FSMakeFSSpec() to work! It keeps giving me errNo -37, which I believe amounts to "bad path". (Sorry, still getting familiar with Macs!) I've tried both absolute and relative paths, using both UNIX-style and Mac-style delimiters and no luck with any of them. I set volume and dir to 0, and even tried putting "\p" in front of the filename to specify a Pascal string. Grrr....! Am I missing something simple here? The call would look like: FSMakeFSSpec(0,0,"\pMacintosh HD:Applications:Python.app:Contents:MacOS:python", &myfilespec), or with UNIX-style delimiters: FSMakeFSSpec(0,0,"\p/Applications/Python.app/Contents/MacOS/python", &myfilespec) >From my testing, I get the impression that it expects Mac-style delimiters, so maybe I'm bungling up the Mac path? Any ideas on how to get it to correctly find command line python? Thanks, Kevin ----- Original Message ----- From: "Jack Jansen" To: Sent: Tuesday, March 19, 2002 5:55 AM Subject: Re: [wxPython-mac] Porting wxPython to Mac > > On dinsdag, maart 19, 2002, at 05:55 , Kevin Ollivier wrote: > > > Hi all, > > > > I've been helping out with an initiative to port wxPython > > (http://www.wxpython.org) to the Mac OS X platform. > > Kevin, > if you get replies only to yourself (or to the unix-porting > list), could you summarize them to wxpython-mac? > > Thanks, > -- > - Jack Jansen > http://www.cwi.nl/~jack - > - If I can't dance I don't want to be part of your revolution -- > Emma Goldman - > > > _______________________________________________ > wxPython-mac mailing list > wxPython-mac@lists.wxwindows.org > http://lists.wxwindows.org/mailman/listinfo/wxpython-mac > From alexp@strata.com Wed Mar 20 00:12:44 2002 From: alexp@strata.com (Alexandre Parenteau) Date: Tue, 19 Mar 2002 16:12:44 -0800 Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available In-Reply-To: Message-ID: 148 tests OK. 3 tests failed: test_email test_frozen test_time 35 tests skipped: test_al test_bsddb test_cd test_cl test_commands test_crypt test_curses test_dbm test_dl test_fcntl test_fork1 test_gl test_grp test_imgfile test_largefile test_linuxaudiodev test_locale test_longexp test_mmap test_nis test_ntpath test_openpty test_poll test_popen2 test_pty test_pwd test_signal test_socket_ssl test_socketserver test_sunaudiodev test_threaded_import test_timing test_unicode_file test_winreg test_winsound 2 skips unexpected on mac: test_longexp test_threaded_import This on MacOS X 10.3 SMP (2) Alex. > MacPython 2.2.1c1 is available via From Jack.Jansen@oratrix.com Wed Mar 20 10:13:29 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Wed, 20 Mar 2002 11:13:29 +0100 Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available In-Reply-To: <20020319142648-r01010800-78321584-0920-010c@129.21.139.65> Message-ID: <20167610-3BEB-11D6-83F4-0030655234CE@oratrix.com> On Tuesday, March 19, 2002, at 08:26 , Ryan Wilcox wrote: > On Tuesday, March 19, 2002, at 2:03 PM, Jack.Jansen@oratrix.com (Jack > Jansen) wrote: > >> Many bugs were fixed in this release. > > I installed the latest version, and ConfigurePythonCore LAUNCHED for me > (I am running X.1.3) No I didn't. Maybe Apple did:-) On 10.1.2 (which I'm still running at home) ConfigurePython doesn't run, but to my surprise here at work (10.1.3) it did run. I'll leave the warning note in for 2.2.1, as 10.1.2 is still pretty common. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From jnp@anneli.dk Wed Mar 20 13:12:08 2002 From: jnp@anneli.dk (=?iso-8859-1?Q?J=F8rgen?= =?iso-8859-1?Q?_?= =?iso-8859-1?Q?N=F8rgaard?=) Date: Wed, 20 Mar 2002 14:12:08 +0100 Subject: [Pythonmac-SIG] Python 2.2/multi user Message-ID: --============_-1195492281==_ma============ Content-Type: text/plain; charset="iso-8859-1" ; format="flowed" Content-Transfer-Encoding: quoted-printable Hello, I just tried to install python 2.2 (from the full installer download). Installed as administrative user and appears to work fine. If, however, I run the python IDE (and other tools) from another (non-administrative) account will result in the errors like: 'import site' failed; use -v for traceback Traceback (most recent call last): File "hd:Applications:Utilities:Python 2.2:Mac:Tools:IDE:PythonIDE.py", line 31, in ? init() File "hd:Applications:Utilities:Python 2.2:Mac:Tools:IDE:PythonIDE.py", line 13, in init from Carbon import Qd, QuickDraw ImportError: No module named Carbon I did think it would be possible to do so. Or am I doing something wrong? Running on OS X 10.1.3. Regards, -- /j=F8rgen n=F8rgaard ... For privacy ... e-mail: jnp@anneli.dk | Phone: +45 2627 3769 http://anneli.dk/~jnp/ ... PGP! ... |\ _,,,---,,_ /,`.-'`' -. ;-;;,_ |,4- ) )-,_. ,\ ( `'-' '---''(_/--' `-'\_) --============_-1195492281==_ma============ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Python 2.2/multi user
Hello,

I just tried to install python 2.2 (from the full installer download). Installed as administrative user and appears to work fine.

If, however, I run the python IDE (and other tools) from another (non-administrative) account will result in the errors like:

'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "hd:Applications:Utilities:Python 2.2:Mac:Tools:IDE:PythonIDE.py", line 31, in ?
    init()
  File "hd:Applications:Utilities:Python 2.2:Mac:Tools:IDE:PythonIDE.py", line 13, in init
    from Carbon import Qd, QuickDraw
ImportError: No module named Carbon


I did think it would be possible to do so. Or am I doing something wrong?

Running on OS X 10.1.3.



Regards,
-- 
/j=F8rgen n=F8rgaard                               ... For privacy ...
e-mail: jnp@anneli.dk | Phone: +45 2627 3769
http://anneli.dk/~jnp/                            ... PGP! ...
                                        |\      _,,,---,,_
                                        /,`.-'`'    -.  ;-;;,_ 
                                        |,4-  ) )-,_. ,\ (  `'-'
                                       '---''(_/--'  `-'\_)

--============_-1195492281==_ma============-- From Benjamin.Schollnick@usa.xerox.com Wed Mar 20 16:26:22 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Wed, 20 Mar 2002 11:26:22 -0500 Subject: [Pythonmac-SIG] MacPython IDE -- Is this a bug? Message-ID: Opps... Missed the "IDE" part.... I don't use the Mac IDE.... I use IDLE on the PC, but I haven't checked to see if it'll work on the Mac... (Does anyone know if the IDLE fork is usable on the Mac? The Mac IDE is nice, but I prefer the color syntaxing, etc, that is in IDLE...) - Benjamin -----Original Message----- From: Schollnick, Benjamin Sent: Tuesday, March 19, 2002 1:27 PM To: 'Bruce Robbins'; pythonmac-sig@python.org Subject: RE: [Pythonmac-SIG] MacPython IDE -- Is this a bug? Importance: High You can fix, I presume... Turn off the Caching of the MacPython display... - Benjamin -----Original Message----- From: Bruce Robbins [mailto:brobbins333@shaw.ca] Sent: Tuesday, March 19, 2002 1:22 PM To: pythonmac-sig@python.org Subject: [Pythonmac-SIG] MacPython IDE -- Is this a bug? This runs as expected as a script in the PythonWin IDE, so I guess there would be disagreement whether it constitutes a "bug." If I were the author of the MacPython IDE, I think I would try to fix it. BR On Mon, 18 Mar 2002, Bruce Robbins wrote: > Try running this AS A SCRIPT in the MacPython IDE v.1.0.1: > > list = [33, 44, 55, 66] > > for each in list: > print each, > > > Make sure you include the comma after the print each statement. > Then try it without the comma. > > No output in the output window when run with the comma -- until > the script is run again without the comma! > If you append either: print or import sys; sys.stdout.flush() after your two lines above, you'll get the output. (The first with a trailing newline, the latter without.) I'm guessing that sys.stdout.close() would also work, but wouldn't be very useful to you. That should make the reason for the behaviour obvious. ( You don't get it in the interpreter window, because the line gets flushed when it prints out a '>>>' prompt for the next input line.) Is it a bug? I'ld vote no -- it matches exactly what would happen if you had a script writing to a file, or executed a script on the unix command line (so you wouldn't get any prompts to the terminal) except that sys.stdout would get flushed and closed at program termination. -- Steve Majewski _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From Jack.Jansen@oratrix.com Wed Mar 20 22:22:21 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Wed, 20 Mar 2002 23:22:21 +0100 Subject: [Pythonmac-SIG] Python 2.2/multi user In-Reply-To: Message-ID: On woensdag, maart 20, 2002, at 02:12 , J=F8rgen N=F8rgaard wrote: > Hello, > > I just tried to install python 2.2 (from the full installer=20 > download). Installed as administrative user and appears to work=20 > fine. > > If, however, I run the python IDE (and other tools) from=20 > another (non-administrative) account will result in the errors=20 > like: > > > > 'import site' failed; use -v for traceback Hmm, I think this is a problem with the preference file. Or=20 rather a problem with no preferences file being available. Or,=20 more probable, an incorrect preferences file being available. Could you please try the following, and tell me whether it works=20 (all this as the unprivileged user): - Remove any prefs file (in ~/Library/Preferences) with "python"=20 in the name. - Run PythonInterpreter once by double-clicking it. - Quit PythonInterpreter. - Try the IDE. This may fix things. If it does: let me know. If it doesn't:=20 could you option-double-click PythonInterpreter, keep option=20 depressed until the initial dialog appears, select "trace import=20 statements", at the prompt type >>> import sys >>> print sys.path >>> print sys.executable and mail me all of the output in the PythonInterpreter window=20 (so also the import traces)? -- - Jack Jansen =20 http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution --=20 Emma Goldman - From Jack.Jansen@oratrix.com Wed Mar 20 22:55:06 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Wed, 20 Mar 2002 23:55:06 +0100 Subject: [Pythonmac-SIG] Question about AppleScript on OSX Message-ID: <858F0D0F-3C55-11D6-9ACF-003065517236@oratrix.com> Folks, I hope someone here can point me in the right direction. On OSX it seems that the OSA resources of OS9 and earlier (the AETE and AEUT resources) have been replaced by a much nicer mechanism: plist-style files with extensions .scriptSuite (defines the 4-letter codes and parameter types and such for events and classes) and .scriptTerminology (defines the english verb names and descriptions used in AppleScript). All very nice, but there's one bit I can't find, and that's how the direct object of the verbs is defined. For instance, NSCoreSuite.scriptSuite has the the standard stuff, but if you look at the "open" verb then it doesn't have it's direct object defined anywhere. But if you look at it through Project Builder "open dictionary" the direct object type is listed as "list of aliases". Any clues on where I should look? Any pointers to documentation of these files? -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Thu Mar 21 20:41:11 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Thu, 21 Mar 2002 21:41:11 +0100 Subject: [Pythonmac-SIG] Re: Python/Tkinter and QuickTimeTcl In-Reply-To: <3C9A1651.65D5EF89@privat.utfors.se> Message-ID: On donderdag, maart 21, 2002, at 06:20 , Mats Bengtsson wrote: > > Forwarded to tcl-mac@lists.sourceforge.net: > > The thought has struck me, but I've never started an investigation. > But since we have (Jack ?) a Python guy here perhaps we may ask him, > or anyone else; what does it take to port a Tcl/Tk extension > to Python? Have never used Python myself. > QuickTimeTcl: "http://hem.fyristorg.com/matben/qt" I haven't a clue whether a general Tcl extension would work in Tkinter in Python. So, I've added the pythonmac-sig to the recipient list: has anyone there ever tried this? But for the case of QuickTime specifically I do have an answer: there is probably little point in getting QuickTimeTcl to work. The Python quicktime module exports about 90% of quicktime (I think sprite tracks are the only obvious omission; at least: extracting or creating them, I think playback should work fine) so there's probably little point in using QuickTimeTcl from Python. [What follows now is a very biased opinion, if you read on you should bear in mind that I'm responsible for the stuff described here] In general I think that looking at whether functionality can be exported from Python to Tcl, especially for the Mac, may be a more interesting route. The MacOS toolbox modules for MacPython are almost all machine-generated: you feed in Universal Headers .h files on one end and out the other end come complete (or almost complete) glue modules. The package that does this, bgen, could probably be adapted to generate Tcl plugin modules in stead of Python plugin modules, but it would definitely take some real dedication to master it. But once you've mastered it it is great: I did an interface to most of CoreFoundation in a few evenings. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From jingham@apple.com Thu Mar 21 21:11:55 2002 From: jingham@apple.com (Jim Ingham) Date: Thu, 21 Mar 2002 13:11:55 -0800 Subject: [Pythonmac-SIG] Re: [MACTCL] Re: Python/Tkinter and QuickTimeTcl In-Reply-To: Message-ID: <462D1A7C-3D10-11D6-80F8-000393540DDC@apple.com> Jack, I would have tried SWIG for the same purposes. It generates interfaces for Perl, Python, Tcl/Tk, Guile, Ruby and a bunch of others from C & C++. I haven't had opportunity to use it, but other people speak very highly of it. Did you have some bad experiences with it, or had you just not heard of it, or did you mostly want to use a tool written in Python? If it is either of the latter two, then for folks wanting to get quick access to system functionality, going from C headers to Python interfaces to Tcl seems overkill. It would be much easier to just run SWIG on the same headers. BTW - IMO, much of the time C interfaces are not a good match for the interfaces you want from a scripting language - the design goals are different. So this sort of autogeneration is mostly useful as a "first cut" kind of thing. For instance, Tk is MUCH more useful than a straight wrapped version of Carbon would be. Not sure whether this is so true of AppKit since the API's are already at a pretty high level. But I bet Tk would still in the end be more convenient... Similarly, QuickTimeTcl adds a movie object that you create and manipulate, which is not the way the C API's are written, but is more convenient from Tcl... Jim On Thursday, March 21, 2002, at 12:41 PM, Jack Jansen wrote: > [What follows now is a very biased opinion, if you read on you should > bear in mind that I'm responsible for the stuff described here] > > In general I think that looking at whether functionality can be > exported from Python to Tcl, especially for the Mac, may be a more > interesting route. The MacOS toolbox modules for MacPython are almost > all machine-generated: you feed in Universal Headers .h files on one > end and out the other end come complete (or almost complete) glue > modules. The package that does this, bgen, could probably be adapted to > generate Tcl plugin modules in stead of Python plugin modules, but it > would definitely take some real dedication to master it. But once > you've mastered it it is great: I did an interface to most of > CoreFoundation in a few evenings. > -- Jim Ingham jingham@apple.com Developer Tools - gdb Apple Computer From sdm7g@Virginia.EDU Thu Mar 21 22:06:55 2002 From: sdm7g@Virginia.EDU (Steven Majewski) Date: Thu, 21 Mar 2002 17:06:55 -0500 (EST) Subject: [Pythonmac-SIG] Re: [MACTCL] Re: Python/Tkinter and QuickTimeTcl In-Reply-To: <462D1A7C-3D10-11D6-80F8-000393540DDC@apple.com> Message-ID: On Thu, 21 Mar 2002, Jim Ingham wrote: > BTW - IMO, much of the time C interfaces are not a good match for the > interfaces you want from a scripting language - the design goals are > different. So this sort of autogeneration is mostly useful as a "first > cut" kind of thing. For instance, Tk is MUCH more useful than a > straight wrapped version of Carbon would be. Not sure whether this is > so true of AppKit since the API's are already at a pretty high level. > But I bet Tk would still in the end be more convenient... Similarly, > QuickTimeTcl adds a movie object that you create and manipulate, which > is not the way the C API's are written, but is more convenient from > Tcl... >From my experience playing with both Tcl/Tk (and Python/Tkinter) and Cocoa w/Python+pyobjc, I would say that if you have to do everything programatically (which is the case right now) then Tk is definitely easier than Cocoa, but if we can ever get Python+Cocoa to work with Interface Builder nibs, then Cocoa would be much more convenient. Tcl/Tk is very procedure oriented, and the procedures to create and layout objects are very concise. Cocoa is very object oriented, and was really designed to work with I-B's 'frozen objects' -- if you have to actually write procedures to create all of your objects, then Cocoa becomes more of a pain to use. BTW: Jack's code is not as general purpose and flexible as SWIG, but, being special purpose, it produces better wrapper code for MacPython. -- Steve Majewski From jingham@apple.com Thu Mar 21 22:19:36 2002 From: jingham@apple.com (Jim Ingham) Date: Thu, 21 Mar 2002 14:19:36 -0800 Subject: [Pythonmac-SIG] Re: [MACTCL] Re: Python/Tkinter and QuickTimeTcl In-Reply-To: Message-ID: On Thursday, March 21, 2002, at 02:06 PM, Steven Majewski wrote: > > > On Thu, 21 Mar 2002, Jim Ingham wrote: > >> BTW - IMO, much of the time C interfaces are not a good match for the >> interfaces you want from a scripting language - the design goals are >> different. So this sort of autogeneration is mostly useful as a "first >> cut" kind of thing. For instance, Tk is MUCH more useful than a >> straight wrapped version of Carbon would be. Not sure whether this is >> so true of AppKit since the API's are already at a pretty high level. >> But I bet Tk would still in the end be more convenient... Similarly, >> QuickTimeTcl adds a movie object that you create and manipulate, which >> is not the way the C API's are written, but is more convenient from >> Tcl... > > From my experience playing with both Tcl/Tk (and Python/Tkinter) > and Cocoa w/Python+pyobjc, I would say that if you have to do everything > programatically (which is the case right now) then Tk is definitely > easier than Cocoa, but if we can ever get Python+Cocoa to work with > Interface Builder nibs, then Cocoa would be much more convenient. > Yeah, it would be cool to be able to do what the AppleScript Studio folks do in other languages. I don't know how this works, however, so I don't know how easy it would be to retool... > Tcl/Tk is very procedure oriented, and the procedures to create and > layout objects are very concise. > > Cocoa is very object oriented, and was really designed to work with > I-B's 'frozen objects' -- if you have to actually write procedures > to create all of your objects, then Cocoa becomes more of a pain to > use. > Yes that's probably right. > > BTW: Jack's code is not as general purpose and flexible as SWIG, but, > being special purpose, it produces better wrapper code for MacPython. > I see... The new version of SWIG looks pretty nice, particularly for wrapping C++ stuff (you can generate little Class factories, and then the methods hang off the created objects, which is convenient). He says there is also support for ObjC, but I didn't see any docs about it. Jim -- Jim Ingham jingham@apple.com Developer Tools - gdb Apple Computer From Jack.Jansen@oratrix.com Fri Mar 22 09:33:40 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 22 Mar 2002 10:33:40 +0100 Subject: [Pythonmac-SIG] Re: [MACTCL] Re: Python/Tkinter and QuickTimeTcl In-Reply-To: <462D1A7C-3D10-11D6-80F8-000393540DDC@apple.com> Message-ID: On Thursday, March 21, 2002, at 10:11 , Jim Ingham wrote: > Jack, > > I would have tried SWIG for the same purposes. It generates interfaces > for Perl, Python, Tcl/Tk, Guile, Ruby and a bunch of others from C & > C++. I haven't had opportunity to use it, but other people speak very > highly of it. > > Did you have some bad experiences with it, or had you just not heard of > it, or did you mostly want to use a tool written in Python? Bgen predates swig. It was actually written by Guido himself about 8-9 years ago, I think, and I basically inherited it. Swig has the big advantages of being easier to use, and of generating interface modules for other languages than Python. Bgen's main two advantages are that it is more automatic (once it has been setup) and more powerful. More automatic: you can feed it .h files straight from Apple, so the next version of Universal Headers just gets fed through it and often the interface grows with the new functionality automatically. More powerful: it can be told about Python objects wrapping C structs, and you can tell it patterns of C arguments and how to represent them in Python: - RGBColor color - Represent as Python (r, g, b) tuple - const char *foo, int foo_len - Binary input buffer, use a single Python string - WindowRef w - Represent this as a Python PyMac_WindowObject object - WindowRef w as first argument - don't generate this as a function but as a method of the PyMac_WindowObject type. Over the years I've been talking to the swig people about integrating swig and bgen, but all of us always have more urgent things to do, unfortunately:-( -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From bob@redivi.com Fri Mar 22 17:10:19 2002 From: bob@redivi.com (Bob Ippolito) Date: Fri, 22 Mar 2002 12:10:19 -0500 Subject: [Pythonmac-SIG] mod_python for MacOS X Apache Message-ID: I figured this may be of interested to some of you, I ported and packaged mod_python for the version of Apache that is included in Mac OS X 10.1.3. It includes a full python distribution, don't think about trying to use your own (as it requires a singlethreaded interpreter, and certain c modules need to know if the interpreter is threaded or not). It includes a regular python interpreter that gets installed to /Library/WebServer/bin/python, which you may use for distutils setup.py installation of any module you wish, or you could brave it and change the PythonPath to include wherever your current installation is but I don't recommend that unless you're only importing pure python modules. http://redivi.com/~bob/mod_python.html -bob From wrw@ornl.gov Fri Mar 22 17:37:30 2002 From: wrw@ornl.gov (W. R. Wing) Date: Fri, 22 Mar 2002 12:37:30 -0500 Subject: [Pythonmac-SIG] Python 2.2.1 (?) Message-ID: As a new listener on this list I apologize if this has beaten to death, and would appreciate a pointer to where the answer exists. When I tried to run ConfigurePythonCarbon on my 800Mhz DP G4, it hung, and I later came across a note telling me that Python 2.2 won't run on dual-processor systems. Users of dual processor systems will have to wait for v 2.2.1. So, where can I find information, even if only tentative, about the availability of 2.2.1? I REALLY would like to get Python running on my system. Thanks, Bill -- _ /~\ The ASCII | William R. Wing wrw@ornl.gov 865-574-8839 \ / Ribbon Campaign | Network Architect, Oak Ridge National Laboratory X Against HTML | Network Research Group, Computer Sci & Math Div. / \ Email! |_________ From roger@windyridge.biz Fri Mar 22 17:46:57 2002 From: roger@windyridge.biz (Roger Meeks) Date: Fri, 22 Mar 2002 17:46:57 +0000 Subject: [Pythonmac-SIG] Mac Modules Message-ID: Does anyone know of any further documentation concerning the 'Mac' modules other than the doc's that come with the download. If not, is there any Mac programming documentation that might help me find out what they are, what they do and how to use them. TIA - Roger From Jack.Jansen@oratrix.com Fri Mar 22 23:08:55 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sat, 23 Mar 2002 00:08:55 +0100 Subject: [Pythonmac-SIG] Python 2.2.1 (?) In-Reply-To: Message-ID: On vrijdag, maart 22, 2002, at 06:37 , W. R. Wing wrote: > So, where can I find information, even if only tentative, about > the availability of 2.2.1? I REALLY would like to get Python > running on my system. It's due in another week or so. In the mean time you can help by downloading the first final candidate (named 221c1) via http://www.cwi.nl/~jack/macpython.html and test it. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Fri Mar 22 23:10:52 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sat, 23 Mar 2002 00:10:52 +0100 Subject: [Pythonmac-SIG] Mac Modules In-Reply-To: Message-ID: <0E653437-3DEA-11D6-860B-003065517236@oratrix.com> On vrijdag, maart 22, 2002, at 06:46 , Roger Meeks wrote: > Does anyone know of any further documentation concerning the > 'Mac' modules other than the doc's that come with the download. > If not, is there any Mac programming documentation that might > help me find out what they are, what they do and how to use > them. For the toolbox modules (which I assume are the ones you mean) you should read inside Macintosh. For the actual argument list that the Python version uses you should check the __doc__ string of the method or function, but often you can deduce what the Python argument list will be from the C argument list shown in IM. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From danielt3@gte.net Thu Mar 21 02:37:20 2002 From: danielt3@gte.net (Daniel) Date: Wed, 20 Mar 2002 21:37:20 -0500 Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available In-Reply-To: References: Message-ID: At 2:03 PM +0100 3/19/02, Jack Jansen wrote: >MacPython 2.2.1c1 is available via >http://www.cwi.nl/~jack/macpython.html . >This is a release >candidate for MacPython 2.2.1, expected later this month. >Please >give it a try and report your findings to pythonmac-sig@python.org. >This >is a patch release, so it should be 100% compatible with >MacPython 2.2. > >This release should run on any MacOS version from 8.1 through 10.1.3 >(but for >8.1 you will need to download an additional patch if you >want to use the IDE). I'm running 10.1.3 on a Powerbook G3. I installed MacPython from my admin account into the Applications directory, then went to my user account and tried to run the IDE and it locks up on the splash screen. The interpreter seems to work fine. So I booted back into my admin account and tried it there and it worked fine. Then I went back to my user account and tried it again and it worked... :-? Is this considered normal? -- From Jack.Jansen@oratrix.com Sat Mar 23 23:42:43 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sun, 24 Mar 2002 00:42:43 +0100 Subject: [Pythonmac-SIG] MacPython 2.2.1c1 available In-Reply-To: Message-ID: On donderdag, maart 21, 2002, at 03:37 , Daniel wrote: > I'm running 10.1.3 on a Powerbook G3. I installed MacPython > from my admin account into the Applications directory, then > went to my user account and tried to run the IDE and it locks > up on the splash screen. The interpreter seems to work fine. > > So I booted back into my admin account and tried it there and > it worked fine. Then I went back to my user account and tried > it again and it worked... :-? > > Is this considered normal? As of a few days ago (when I got the first report of this behavior): yes, it is considered normal:-) I may not be considered optimal, though... -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From p.oberndoerfer@urheberrecht.org Sun Mar 24 17:12:46 2002 From: p.oberndoerfer@urheberrecht.org (Pascal Oberndoerfer) Date: Sun, 24 Mar 2002 18:12:46 +0100 Subject: [Pythonmac-SIG] ftplib on mac Message-ID: Hello. If I type the following at the interpreter: >>> from ftplib import FTP >>> ftp = FTP('ftp.cwi.nl') the interpreter hangs. Is anybody else seeing this? MacPython 2.2.1c1 on MacOS X 10.1.3 Thanks. Pascal From Jack.Jansen@oratrix.com Sun Mar 24 21:54:10 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sun, 24 Mar 2002 22:54:10 +0100 Subject: [Pythonmac-SIG] ftplib on mac In-Reply-To: Message-ID: On zondag, maart 24, 2002, at 06:12 , Pascal Oberndoerfer wrote: > Hello. > > If I type the following at the interpreter: > >>>> from ftplib import FTP >>>> ftp = FTP('ftp.cwi.nl') > > > the interpreter hangs. > > Is anybody else seeing this? > > MacPython 2.2.1c1 on MacOS X 10.1.3 Yes, I'm also seeing it, on both OS9 and OSX. And I'm not seeing it with 2.2, so it's a new bug. Could you file a bug report with sourceforge (221 group, mac category) and assign it to me? -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Benjamin.Schollnick@usa.xerox.com Mon Mar 25 12:38:49 2002 From: Benjamin.Schollnick@usa.xerox.com (Schollnick, Benjamin) Date: Mon, 25 Mar 2002 07:38:49 -0500 Subject: [Pythonmac-SIG] Mac Modules Message-ID: > For the toolbox modules (which I assume are the ones you mean) > you should read inside Macintosh. For the actual argument list Inside Macintosh? Is this a commercial book, or Documentation available from Apple? Any pointers to the material? - Benjamin From Laurent.Pierron@loria.fr Mon Mar 25 14:24:24 2002 From: Laurent.Pierron@loria.fr (Laurent Pierron) Date: Mon, 25 Mar 2002 15:24:24 +0100 Subject: [Pythonmac-SIG] Mac Modules References: Message-ID: <3C9F3318.2080509@loria.fr> Schollnick, Benjamin wrote: >>For the toolbox modules (which I assume are the ones you mean) >>you should read inside Macintosh. For the actual argument list >> > > Inside Macintosh? > > Is this a commercial book, or Documentation available from Apple? > > Any pointers to the material? > Inside Mac OS X: http://developer.apple.com/techpubs/macosx/macosx.html Other documentations by technology : http://developer.apple.com/techpubs/ -- Laurent PIERRON From pecora@anvil.nrl.navy.mil Mon Mar 25 21:16:14 2002 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Mon, 25 Mar 2002 16:16:14 -0500 Subject: [Pythonmac-SIG] Getting Piddle to work with Python 2.2 Message-ID: --============_-1195031518==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" (Sorry if you saw this on the Python NG. I've posted in a few places I thought I might get an answer. Thanks for your patience.) I have returned to Python after a year away (old version 1.52 on a Mac using sys 9.1). I upgraded to Python 2.2 and got messages that my old version of Piddle was deprecated. I downloaded the latest version and am stuck. After searching the documentation I cannot find how to install it other than the statment in the README.txt that says type in python setup.py install and go. That does nothing for me in the IDE on my Mac. I am probably missing something simple, but unless I get some plotting stuff running my return to Python will be short-lived. Can you tell me what I'm missing so I can install a new version of Piddle on my Mac? Thanks for any help. -- Cheers, Lou Pecora --============_-1195031518==_ma============ Content-Type: text/html; charset="us-ascii" Getting Piddle to work with Python 2.2
(Sorry if you saw this on the Python NG.  I've posted in a few places I thought I might get an answer.  Thanks for your patience.)


I have returned to Python after a year away (old version 1.52 on a Mac
using sys 9.1).  I upgraded to Python 2.2 and got messages that my old
version of Piddle was deprecated.  I downloaded the latest version and
am stuck.  After searching the documentation I cannot find how to
install it other than the statment in  the README.txt that says type in 
python setup.py install  and go.  That does nothing for me in the IDE
on my Mac.  I am probably missing something simple, but unless I get
some plotting stuff running my return to Python will be short-lived.
Can you tell me what I'm missing so I can install a new version of
Piddle on my Mac?  Thanks for any help.

--

Cheers,

Lou Pecora
--============_-1195031518==_ma============-- From humbert@hagen.de Mon Mar 25 22:08:31 2002 From: humbert@hagen.de (Ludger Humbert) Date: Mon, 25 Mar 2002 23:08:31 +0100 Subject: [Pythonmac-SIG] Mac OS X: Problems installing sip 3.0/3.1 Message-ID: <3C9F9FDF.3000908@hagen.de> Hi, I have to deal with some software, which is written in Python and using the Qt-Bindings. I'm working with Mac OS X. On the Mac I installed fink, for to deal with free software. Included is Python. Included is qt-3.0 So I have to install PyQt http://www.riverbankcomputing.co.uk/ At first I have to install sip: http://www.riverbankcomputing.co.uk/pyqt/download.php The following was posted to the guys dealing with PyQt, but until now I had no reply, probably there is nowone, who uses a Mac with OS X. Trying to build sip 3.0 and 3.1 with both versions the configure-script run without problems. But in both cases make failed. (i) sip 3.0 [localhost:~/SOFTWARE/AUSGEPACKT/sip-3.0] hum% ./configure checking for a BSD compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for mawk... no ... checking for Python include files... /sw/include/python2.2 configure: creating ./config.status config.status: creating Makefile config.status: creating sip/Makefile config.status: creating siplib/Makefile config.status: creating sip.spec config.status: creating config.h [localhost:~/SOFTWARE/AUSGEPACKT/sip-3.0] hum% make make all-recursive Making all in sip ... /bin/sh ../libtool --mode=link c++ -fno-exceptions -O2 -o libsip.la -rpath /usr/local/lib -version-info 7:0:0 -L/sw/lib -lqt -L/usr/X11R6/lib -lSM -lICE -lX11 siplib.lo qtlib.lo objmap.lo moc_sipQt.lo rm -fr .libs/libsip.la .libs/libsip.* .libs/libsip.* ../libtool: parse error: condition expected: xno = [3181] c++ -dynamiclib -flat_namespace -undefined suppress -o .libs/libsip.7.0.0.dylib siplib.lo qtlib.lo objmap.lo moc_sipQt.lo -L/sw/lib -lqt -L/usr/X11R6/lib -lSM -lICE -lX11 -lc -install_name /usr/local/lib/libsip.7.dylib -compatibility_version 8 -current_version 8.0 /usr/bin/libtool: can't locate file for: -lqt /usr/bin/libtool: file: -lqt is not an object file (not allowed in a library) make[2]: *** [libsip.la] Fehler 1 make[1]: *** [all-recursive] Fehler 1 make: *** [all] Fehler 2 [localhost:~/SOFTWARE/AUSGEPACKT/sip-3.0] hum% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (ii) sip 3.1 [localhost:~/SOFTWARE/AUSGEPACKT/sip-3.1] hum% ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes ... [localhost:~/SOFTWARE/AUSGEPACKT/sip-3.1] hum% make -d > make_debug.txt ../libtool: parse error: condition expected: xno = [3183] /usr/bin/libtool: internal link edit command failed make[2]: *** [libsip.la] Error 1 make[1]: *** [all-recursive] Error 1 make: *** [all] Error 2 ~~~~~~~~~~~~~~~~~~~~~~~~ make_debug.txt ends with: /bin/sh ../libtool --mode=link c++ -fno-exceptions -O2 -o libsip.la -rpath /sw/lib/python2.2/site-packages -version-info 8:0:0 -L/sw/lib -lqt-mt -L/usr/X11R6/lib -lSM -lICE -lX11 siplib.lo qtlib.lo objmap.lo moc_sipQt.lo Putting child 0x000b8220 (libsip.la) PID 18714 on the chain. Live child 0x000b8220 (libsip.la) PID 18714 mkdir .libs rm -fr .libs/libsip.la .libs/libsip.* .libs/libsip.* (cd . && ln -s siplib.lo siplib.o) (cd . && ln -s qtlib.lo qtlib.o) (cd . && ln -s objmap.lo objmap.o) (cd . && ln -s moc_sipQt.lo moc_sipQt.o) c++ -dynamiclib -flat_namespace -undefined suppress -o .libs/libsip.8.0.0.dylib siplib.lo qtlib.lo objmap.lo moc_sipQt.lo -L/sw/lib -lqt-mt -L/usr/X11R6/lib -lSM -lICE -lX11 -lc -install_name /sw/lib/python2.2/site-packages/libsip.8.dylib -compatibility_version 9 -current_version 9.0 ld: multiple definitions of symbol _sipQObjectClass siplib.lo definition of _sipQObjectClass in section (__DATA,__common) qtlib.lo definition of _sipQObjectClass in section (__DATA,__common) objmap.lo definition of _sipQObjectClass in section (__DATA,__common) Got a SIGCHLD; 1 unreaped children. Reaping losing child 0x000b8220 PID 18714 Removing child 0x000b8220 PID 18714 from chain. make[2]: Leaving directory `/Users/hum/SOFTWARE/AUSGEPACKT/sip-3.1/siplib' Got a SIGCHLD; 1 unreaped children. Reaping losing child 0x000963c0 PID 18373 Removing child 0x000963c0 PID 18373 from chain. make[1]: Leaving directory `/Users/hum/SOFTWARE/AUSGEPACKT/sip-3.1' Got a SIGCHLD; 1 unreaped children. Reaping losing child 0x00094c40 PID 18372 Removing child 0x00094c40 PID 18372 from chain. ANY HELP on this? Ludger Humbert ------------------------------------------------------------------------ Open IFIP-GI-Conference "Social, ethical and cognitive issues of informatics and ICT - SECIII" University of Dortmund, Germany, July 22-26, 2002 email: SECIII@cs.uni-dortmund.de http://seciii.cs.uni-dortmund.de --> Early bird registration until March 31, 2002 <-- Focus: - e-learning - media education - change management - didactics of informatics ------------------------------------------------------------------------ From pecora@anvil.nrl.navy.mil Mon Mar 25 23:06:43 2002 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Mon, 25 Mar 2002 18:06:43 -0500 Subject: [Pythonmac-SIG] Where's python.h ? Message-ID: I need to rebuild a C extension for plotting on the Macintosh with Python 2.2 and Piddle. Python 2.1 had a file "Python.h", but it seems to be missing from 2.2. Anyone know about this? Thanks for any help. -- Cheers, Lou Pecora From pecora@anvil.nrl.navy.mil Tue Mar 26 19:37:14 2002 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Tue, 26 Mar 2002 14:37:14 -0500 Subject: [Pythonmac-SIG] Help with compiling Mac C extension Message-ID: RE: QDRotate.ppc.slb extension used with Piddle graphics for QuickDraw text rotation. The Piddle package has an extension (above named) to help with text rotation in the drawstring routine. This because QD does not rotate text on its own. The latest version of Python that I installed (2.2) complains that the extension QDRotate.ppc.slb is for a previous version of Python. I have the original QDrotate code so I tried compiling it with the latest PythonCore. I've done this before and I had it working in older Pythons but in 2.2 I get a compile error that the Codewarrior project can't find Carbon/Carbonlib.h or other things like that when I try to compile the QDRotate module. If I define a C variable (compile option WITHOUT_FRAMES) to avoid that include and use what appears to be older Mac stuff, I get several arcane errors that leave me puzzled (things like "numbers beyond range" in other headers). Do you know anything about this? I am trying to compile this in Classic mode on my G3 with system 9.1. Thanks for any help. -- Cheers, Lou Pecora From Jack.Jansen@oratrix.com Tue Mar 26 21:40:19 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 26 Mar 2002 22:40:19 +0100 Subject: [Pythonmac-SIG] Getting Piddle to work with Python 2.2 In-Reply-To: Message-ID: <11ACC6B0-4102-11D6-9222-003065517236@oratrix.com> On maandag, maart 25, 2002, at 10:16 , Louis M. Pecora wrote: > I have returned to Python after a year away (old version 1.52 on a Mac > using sys 9.1).=A0 I upgraded to Python 2.2 and got messages that=20 > my old > version of Piddle was deprecated.=A0 I downloaded the latest=20 > version and > am stuck.=A0 After searching the documentation I cannot find how=20 > to > install it other than the statment in=A0 the README.txt that says=20 > type in=A0 > python setup.py install=A0 and go. Double-clicking setup.py should do the trick. You'll get a=20 dialog to create the equivalent of the unix command line. Put=20 "install" there (either through the popup menu or by typing it=20 in). But: this will only work if you have CodeWarrior Pro 7,=20 assuming piddle includes C code. If it is pure Python you don't=20 need CodeWarrior. With CW Pro 6 it will work after some manual=20 fiddling of the .mcp files, or after downloading and installing=20 the "CW Pro 6 developer patch" from=20 http://www.cwi.nl/~jack/macpython.html. > -- - Jack Jansen =20 http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution --=20 Emma Goldman - From Jack.Jansen@oratrix.com Tue Mar 26 21:45:30 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 26 Mar 2002 22:45:30 +0100 Subject: [Pythonmac-SIG] Where's python.h ? In-Reply-To: Message-ID: On dinsdag, maart 26, 2002, at 12:06 , Louis M. Pecora wrote: > I need to rebuild a C extension for plotting on the Macintosh > with Python 2.2 and Piddle. Python 2.1 had a file > "Python.h", but it seems to be missing from 2.2. Anyone know > about this? Thanks for any help. Did you select the developer option when you installed Python? That's what installs :Include and such (where Python.h lives). -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Tue Mar 26 21:49:57 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Tue, 26 Mar 2002 22:49:57 +0100 Subject: [Pythonmac-SIG] Help with compiling Mac C extension In-Reply-To: Message-ID: <6A426325-4103-11D6-9222-003065517236@oratrix.com> On dinsdag, maart 26, 2002, at 08:37 , Louis M. Pecora wrote: > RE: QDRotate.ppc.slb extension used with Piddle graphics for > QuickDraw text rotation. > > The Piddle package has an extension (above named) to help with > text rotation in the drawstring routine. This because QD does > not rotate text on its own. The latest version of Python that > I installed (2.2) complains that the extension QDRotate.ppc.slb > is for a previous version of Python. I have the original > QDrotate code so I tried compiling it with the latest > PythonCore. I've done this before and I had it working in > older Pythons but in 2.2 I get a compile error that the > Codewarrior project can't find Carbon/Carbonlib.h or other > things like that when I try to compile the QDRotate module. If > I define a C variable (compile option WITHOUT_FRAMES) to avoid > that include and use what appears to be older Mac stuff, I get > several arcane errors that leave me puzzled (things like > "numbers beyond range" in other headers). It sounds like you didn't include the right prefix file in your project (mwerks_plugin_config.h for PPC builds, mwerks_carbonplugin_config.h for Carbon builds). It defines WITHOUT_FRAMEWORKS (I assume WITHOUT_FRAMES is a typo, yes?) and for Carbon builds various other defines that are needed to make Universal Headers behave correctly for Carbon. If you look at xx.mcp (in :Mac:Build) it should tell you how to modify your old project to work with Python 2.2 and all else that has changed in the mean time. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From Jack.Jansen@oratrix.com Tue Mar 26 23:33:05 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Wed, 27 Mar 2002 00:33:05 +0100 Subject: [Pythonmac-SIG] MacPython 2.2.1c2 available Message-ID: MacPython 2.2.1c2 is available through http://www.cwi.nl/~jack/macpython.html . There are two relatively major changes since 2.2.1c1: - The IDE module browser should now work on OSX! This shouldn't have broken the IDE on older systems, but you are cordially invited to test this. - Most toolbox modules now weak-link against InterfaceLib, making the modules importable on older systems that miss some of the newer functionality. This should finally make 2.2.1c2 run on MacOS 8.1 and later. But: you are cordially invited to test that this indeed works (if you have 8.1 or 8.6) and doesn't break anything else (if you have OS9 or later). OSX users who previously installed 2.2.1c1 may have to remove their Python preferences file. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From mmiller@adobe.com Wed Mar 27 00:17:30 2002 From: mmiller@adobe.com (Martin Miller) Date: Tue, 26 Mar 2002 16:17:30 -0800 Subject: [Pythonmac-SIG] Re: Where's python.h ? References: Message-ID: <3CA10F9A.C73C8FD6@adobe.com> It should be in your python2.2:include folder -- at least that's where mine is. -Martin =================================================== "Louis M. Pecora" wrote: > I need to rebuild a C extension for plotting on the Macintosh with Python 2.2 and Piddle. > Python 2.1 had a file "Python.h", but it seems to be missing from 2.2. Anyone know about > this? Thanks for any help. > > -- > > Cheers, > > Lou Pecora > > From pecora@anvil.nrl.navy.mil Wed Mar 27 12:35:56 2002 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Wed, 27 Mar 2002 07:35:56 -0500 Subject: [Pythonmac-SIG] Installing 1.014 on a Macintosh (Piddle) Message-ID: I have solved some of my original problems (see old questions below). (1) The deprecated modules are modules that handle Mac APIs. To correct the deprecation problem use an editor to go through the piddle.py code to find each old Mac module name (like Event, Fonts, Evt, Quickdraw, and Qd) and replace them with the same name, but the prefix "Carbon." added. The dot "." at the end of Carbon is necessary. That will cure the deprecation problem. To its credit, Python actually tells you the new name of the module you need. Very nice, Python guys. (2) To install piddle, note that it uses the disutils stuff. So drag setup.py onto the interpreter and in the ensuing dialog box set the command to install and type "install" (no quotes) into the command box. Hit "OK" and things should work fine. I am still having trouble with the QDRotate part of piddle for the Mac. Some of you have made suggestions for curing that. If they work, I will report back and let everyone know the cure. Thanks for all the help. ---------------------------------------------------------- Old questions: I have returned to Python after a year away (old version 1.52 on a Mac using sys 9.1). I upgraded to Python 2.2 and got messages that my old version of Piddle was deprecated. I downloaded the latest version and am stuck. After searching the documentation I cannot find how to install it other than the statment in the README.txt that says type in python setup.py install and go. That does nothing for me in the IDE on my Mac. I am probably missing something simple, but unless I get some plotting stuff running my return to Python will be short-lived. Can you tell me what I'm missing so I can install a new version of Piddle on my Mac? Thanks for any help. ---------------------------------------------------------- -- Cheers, Lou Pecora From jjb5@cornell.edu Wed Mar 27 22:00:39 2002 From: jjb5@cornell.edu (Joel Bender) Date: Wed, 27 Mar 2002 17:00:39 -0500 Subject: [Pythonmac-SIG] Something not right with sockets... Message-ID: Python 2.2 (#124, Dec 22 2001, 17:36:16) [CW PPC GUSI2 THREADS GC] Type "copyright", "credits" or "license" for more information. MacPython IDE 1.0.1 >>> from socket import socket, AF_INET, SOCK_DGRAM >>> s = socket(AF_INET, SOCK_DGRAM) >>> s.sendto('Bing!', ('128.235.245.112',43278) ) Traceback (most recent call last): File "", line 1, in ? error: (57, 'Socket is not connected') In the socket documentation it says: sendto(string[, flags], address) Send data to the socket. The socket should not be connected to a remote socket, since the destination socket is specified by address. The optional flags argument has the same meaning as for recv() above. Return the number of bytes sent. (The format of address depends on the address family -- see above.) I wouldn't expect the socket to need to be connected, since SOCK_DGRAM is connectionless. Help! Joel -- From sdm7g@virginia.edu Wed Mar 27 22:26:49 2002 From: sdm7g@virginia.edu (Steven Majewski) Date: Wed, 27 Mar 2002 17:26:49 -0500 (EST) Subject: [Pythonmac-SIG] Something not right with sockets... In-Reply-To: Message-ID: On Wed, 27 Mar 2002, Joel Bender wrote: > Python 2.2 (#124, Dec 22 2001, 17:36:16) [CW PPC GUSI2 THREADS GC] > Type "copyright", "credits" or "license" for more information. > MacPython IDE 1.0.1 > >>> from socket import socket, AF_INET, SOCK_DGRAM > >>> s = socket(AF_INET, SOCK_DGRAM) > >>> s.sendto('Bing!', ('128.235.245.112',43278) ) > Traceback (most recent call last): > File "", line 1, in ? > error: (57, 'Socket is not connected') ... > I wouldn't expect the socket to need to be connected, since > SOCK_DGRAM is connectionless. Help! Testing it out in mach-o (unix) python on OSX, using the UDP echo service, I get the expected behaviour: To an address that actually running echo, sendto and recvfrom both work. To an address without an echo server, sendto works and recvfrom just hangs. No 'Socket is not connected' message in either case. I haven't tried it to replicate it in MacPython yet, but it looks like a bug. -- Steve Majewski From dwillcox@prairienet.org Fri Mar 29 12:53:26 2002 From: dwillcox@prairienet.org (David Willcox) Date: Fri, 29 Mar 2002 06:53:26 -0600 Subject: [Pythonmac-SIG] Tkinter interfaces in MacPython 2.2 on MacOs 8.1 Message-ID: I wonder if anyone has tried the Tkinter libraries in Python 2.2 on MacOS 8.1. When I try it, the interpreter hangs. I'm not doing anything fancy, just a simple "put up a single button window" straight out of the book. From pecora@anvil.nrl.navy.mil Fri Mar 29 13:12:33 2002 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Fri, 29 Mar 2002 08:12:33 -0500 Subject: [Pythonmac-SIG] Tkinter interfaces in MacPython 2.2 on MacOs 8.1 In-Reply-To: References: Message-ID: >I wonder if anyone has tried the Tkinter libraries in Python 2.2 on MacOS 8.1. > >When I try it, the interpreter hangs. I'm not doing anything fancy, just a >simple "put up a single button window" straight out of the book. I think I recently tried a Piddle (plotting package--quite nice, but it needs some care and feeding) by dropping a test module on the interpreter and that seemed to work with a Tk window. I'm using system 9.1 on a G3, PB, and G4 set of Macs. Can you quit the interpreter? -- Cheers, Lou Pecora From pecora@anvil.nrl.navy.mil Fri Mar 29 16:39:14 2002 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Fri, 29 Mar 2002 11:39:14 -0500 Subject: [Pythonmac-SIG] Getting an image into Piddle Message-ID: I see that Piddle can display images (the .drawImage(image, x1, y1, [x2], [y2]) method). The image appears to be a PIL-compatible file. SO...how does one generate such an image? Let me give an example. I have a 2D data array of numbers representing intensity (keep it grey scale for now, say 0.0=white, 1.0= black, in between are shades of grey). How do I generate an image (say, halftone plot)? Any help appreciated as always. Thanks. -- Lou Pecora P.S. I've looked at the PIL info and it's really not clear. From pecora@anvil.nrl.navy.mil Fri Mar 29 16:44:03 2002 From: pecora@anvil.nrl.navy.mil (Louis M. Pecora) Date: Fri, 29 Mar 2002 11:44:03 -0500 Subject: [Pythonmac-SIG] Numeric.py and CLAPACK? Message-ID: Has anyone been successful getting CLAPACK working with Numeric Python ? I have the source and a codewarrior compiled library for CLAPACK, but I have not clue how to integrate the two and have the real CLAPACK replace the lite version that comes with Numeric.Py. I checked the docs, but found nothing. Maybe I'm overlooking something. Any clues greatly appreciated. -- Cheers, Lou Pecora From dwillcox@prairienet.org Fri Mar 29 17:55:37 2002 From: dwillcox@prairienet.org (David A Willcox) Date: Fri, 29 Mar 2002 11:55:37 -0600 Subject: [Pythonmac-SIG] Tkinter interfaces in MacPython 2.2 on MacOs In-Reply-To: ; from pythonmac-sig-request@python.org on Fri, Mar 29, 2002 at 12:01:02PM -0500 References: Message-ID: <20020329115537.J8793@iguazu.urbana.css.mot.com> > Date: Fri, 29 Mar 2002 08:12:33 -0500 > To: pythonmac-sig@python.org > From: "Louis M. Pecora" > Subject: Re: [Pythonmac-SIG] Tkinter interfaces in MacPython 2.2 on MacOs > 8.1 > > >I wonder if anyone has tried the Tkinter libraries in Python 2.2 on MacOS 8.1. > > > >When I try it, the interpreter hangs. I'm not doing anything fancy, just a > >simple "put up a single button window" straight out of the book. > > I think I recently tried a Piddle (plotting package--quite nice, but > it needs some care and feeding) by dropping a test module on the > interpreter and that seemed to work with a Tk window. I'm using system > 9.1 on a G3, PB, and G4 set of Macs. > > Can you quit the interpreter? No, I can't quit the interpreter. My Tk window appears, but when I click its "quit" button, the window doesn't go away. It stays hidden behind the PythonInterpreter.out window. It accepts some inputs (the "window shade" button works), but I don't see the print that is supposed to happen after return from mainloop(). I have to force-quit the interpreter; it won't quit voluntarily. After playing around, I did manage to get it to work. Kind of kludgy, though. When the program first starts, the Tk window appears in front, but at that point it doesn't seem to accept any input. I can't resize the window, for example. However, if I bring the PythonInterpreter.out window to the front, and then bring the Tk window back to the front, everything is fine. I can resize the window, and clicking the button makes everything terminate successfully. (Well, at least usually. Sometimes it still gets confused. From danielt3@gte.net Fri Mar 29 18:30:23 2002 From: danielt3@gte.net (Daniel T.) Date: Fri, 29 Mar 2002 13:30:23 -0500 Subject: [Pythonmac-SIG] Tkinter for Carbon timetable? In-Reply-To: References: Message-ID: I was just wondering if anyone knew when Tkinter will working in Carbon? Is there any way to use Tkinter in OS X? Does it work using the unix version (no X11) for example? -- From Jack.Jansen@oratrix.com Fri Mar 29 21:47:17 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Fri, 29 Mar 2002 22:47:17 +0100 Subject: [Pythonmac-SIG] Tkinter for Carbon timetable? In-Reply-To: Message-ID: <8A3404FD-435E-11D6-91A0-003065517236@oratrix.com> On vrijdag, maart 29, 2002, at 07:30 , Daniel T. wrote: > I was just wondering if anyone knew when Tkinter will working > in Carbon? It's not going to happen. At least: unless anyone else wants to spend time on this. I hacked at it for a couple of weeks (with debugging help from the whole SIG) and I just can't get it to work. > Is there any way to use Tkinter in OS X? Does it work using > the unix version (no X11) for example? Yes, Tkinter works fine with AquaTk in MachoPython (how's that for buzzwords:-). Somewhere in the pythonmac-sig archives you'll find a set of instructions for how to get it to work. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman - From dp@ulaluma.com Sat Mar 30 19:12:13 2002 From: dp@ulaluma.com (Donovan Preston) Date: Sat, 30 Mar 2002 11:12:13 -0800 Subject: [Pythonmac-SIG] MacOS.Error exceptions Message-ID: <0A8C769B-4412-11D6-8F1A-00039376B1AE@ulaluma.com> Hey everybody, As there is a discussion right now on Python-Dev about Exceptions (string exceptions and others) not inheriting from Exception, I thought I would bring up an issue about MacOS.Error here in Python-Mac first and gauge people's reactions. The issue is that MacOS.Error, which is raised as an exception from many of the toolbox modules, does not descend from Exception. In the pre-python 2.2 class-type model, I'm not sure it could have inherited from Exception, since it is defined in a C module; I'm wondering if it's possible now, and for the sake of consistency if we should try to make MacOS.Error descend from Exception? This definately surprised me the first time I encountered it; I was trying something like try: foo.SomeMacOSCall() except Exception, e: print "whoops, oh well" However, the MacOS.Error still made it through. I'm willing to explore what it would take to fix this if 1) someone tells me it's possible and desirable, and 2) someone points me in the right direction w.r.t. having something (a type? a class? a new style class also being a type...) that's defined in C descend from something else. Donovan From Jack.Jansen@oratrix.com Sat Mar 30 22:19:42 2002 From: Jack.Jansen@oratrix.com (Jack Jansen) Date: Sat, 30 Mar 2002 23:19:42 +0100 Subject: [Pythonmac-SIG] MacOS.Error exceptions In-Reply-To: <0A8C769B-4412-11D6-8F1A-00039376B1AE@ulaluma.com> Message-ID: <3BF5B8C2-442C-11D6-ACD5-003065517236@oratrix.com> On zaterdag, maart 30, 2002, at 08:12 , Donovan Preston wrote: > The issue is that MacOS.Error, which is raised as an exception > from many of the toolbox modules, does not descend from > Exception. In the pre-python 2.2 class-type model, I'm not sure > it could have inherited from Exception, since it is defined in > a C module; I'm wondering if it's possible now, and for the > sake of consistency if we should try to make MacOS.Error > descend from Exception? Purely an oversight on my part. Please post a bug report on the sourceforge tracker. And a patch will also gracefully be accepted, of course:-) I think the exception is created in pymactoolboxglue.c nowadays. -- - Jack Jansen http://www.cwi.nl/~jack - - If I can't dance I don't want to be part of your revolution -- Emma Goldman -