From jbarden at wilcoxd.com Fri Jul 1 15:06:51 2005 From: jbarden at wilcoxd.com (Jared Barden) Date: Fri, 1 Jul 2005 09:06:51 -0400 Subject: [Pythonmac-SIG] NSMovieView question In-Reply-To: <296F9697-D63B-437B-80B3-671E10E34B2C@livingcode.org> References: <76564DFF-AF73-4C33-A944-E91D62191486@wilcoxd.com> <296F9697-D63B-437B-80B3-671E10E34B2C@livingcode.org> Message-ID: Is that framework accessible from PyObjc? I forgot to mention previously that was the language I was using. Thanks for the input. Jared On Jun 30, 2005, at 4:01 PM, Dethe Elza wrote: > You can't really do that using NSMovieView without dropping down to > the C-level Quicktime routines (maybe there is a python wrapper for > these, but if so it is not documented). > > If you are running on Tiger (10.4) you can use the Quicktime > (QTKit) framework, which has much more control over the movie. > > QTKit Reference: http://developer.apple.com/documentation/QuickTime/ > Reference/QTCocoaObjCKit/index.html > Quicktime for Cocoa documentation: http://developer.apple.com/ > documentation/Cocoa/QuickTime-date.html > > Specifically, you could use the QTMovie.currentTime() and > QTMovie.setCurrentTime_(time) methods to do what you're asking. > > --Dethe > > On 30-Jun-05, at 11:49 AM, Jared Barden wrote: > > >> Hello all, >> >> If I'm using an NSMovieView to play a given movie that is let's say >> 5:00 long, how do I tell the NSMovieView to go to 4:45? I've been >> looking around and haven't found a good answer yet. >> >> All help appreciated, >> Jared Barden >> >> Wilcox Development Solutions >> http://www.wilcoxd.com >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > > > Young children play in a way that is strikingly similar to the way > scientists work --Busytown News > > Wilcox Development Solutions http://www.wilcoxd.com From bob at redivi.com Fri Jul 1 17:42:16 2005 From: bob at redivi.com (Bob Ippolito) Date: Fri, 1 Jul 2005 05:42:16 -1000 Subject: [Pythonmac-SIG] NSMovieView question In-Reply-To: References: <76564DFF-AF73-4C33-A944-E91D62191486@wilcoxd.com> <296F9697-D63B-437B-80B3-671E10E34B2C@livingcode.org> Message-ID: <71E3D47F-6305-4C16-9A38-B6B4A87D82ED@redivi.com> Yes, if you're using the latest PyObjC for Mac OS X 10.4. -bob On Jul 1, 2005, at 3:06 AM, Jared Barden wrote: > Is that framework accessible from PyObjc? I forgot to mention > previously that was the language I was using. > > Thanks for the input. > > Jared > > On Jun 30, 2005, at 4:01 PM, Dethe Elza wrote: > > >> You can't really do that using NSMovieView without dropping down to >> the C-level Quicktime routines (maybe there is a python wrapper for >> these, but if so it is not documented). >> >> If you are running on Tiger (10.4) you can use the Quicktime >> (QTKit) framework, which has much more control over the movie. >> >> QTKit Reference: http://developer.apple.com/documentation/QuickTime/ >> Reference/QTCocoaObjCKit/index.html >> Quicktime for Cocoa documentation: http://developer.apple.com/ >> documentation/Cocoa/QuickTime-date.html >> >> Specifically, you could use the QTMovie.currentTime() and >> QTMovie.setCurrentTime_(time) methods to do what you're asking. >> >> --Dethe >> >> On 30-Jun-05, at 11:49 AM, Jared Barden wrote: >> >> >> >>> Hello all, >>> >>> If I'm using an NSMovieView to play a given movie that is let's say >>> 5:00 long, how do I tell the NSMovieView to go to 4:45? I've been >>> looking around and haven't found a good answer yet. >>> >>> All help appreciated, >>> Jared Barden >>> >>> Wilcox Development Solutions >>> http://www.wilcoxd.com >>> >>> >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>> >>> >>> >> >> >> Young children play in a way that is strikingly similar to the way >> scientists work --Busytown News >> >> >> > > Wilcox Development Solutions > http://www.wilcoxd.com > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From jbarden at wilcoxd.com Fri Jul 1 21:14:44 2005 From: jbarden at wilcoxd.com (Jared Barden) Date: Fri, 1 Jul 2005 15:14:44 -0400 Subject: [Pythonmac-SIG] NSMovieView question In-Reply-To: References: <76564DFF-AF73-4C33-A944-E91D62191486@wilcoxd.com> <296F9697-D63B-437B-80B3-671E10E34B2C@livingcode.org> <71E3D47F-6305-4C16-9A38-B6B4A87D82ED@redivi.com> <3D4C8465-9613-4E93-B7B4-F12CB01C83A9@wilcoxd.com> Message-ID: I appreciate all the QTMovieView help. Hopefully this will be the last question on the subject. In my app, I create a QTMovie with the initWithURL_error_() call. When I try to do a setMovie_() with the QTMovieView, I receive the following error: ValueError: NSInvalidArgumentException - *** -[OC_PythonArray quickTimeMovieController]: selector not recognized [self = 0x5247f90]. Any thoughts are appreciated. Jared Barden From jbarden at wilcoxd.com Fri Jul 1 21:46:01 2005 From: jbarden at wilcoxd.com (Jared Barden) Date: Fri, 1 Jul 2005 15:46:01 -0400 Subject: [Pythonmac-SIG] NSMovieView question In-Reply-To: References: <76564DFF-AF73-4C33-A944-E91D62191486@wilcoxd.com> <296F9697-D63B-437B-80B3-671E10E34B2C@livingcode.org> <71E3D47F-6305-4C16-9A38-B6B4A87D82ED@redivi.com> <3D4C8465-9613-4E93-B7B4-F12CB01C83A9@wilcoxd.com> Message-ID: <5BC00410-B038-4A50-9CA7-9F35F5E61CEB@wilcoxd.com> Disregard that last e-mail. I figured it out. Jared On Jul 1, 2005, at 3:14 PM, Jared Barden wrote: > I appreciate all the QTMovieView help. Hopefully this will be the > last question on the subject. In my app, I create a QTMovie with the > initWithURL_error_() call. When I try to do a setMovie_() with the > QTMovieView, I receive the following error: > > ValueError: NSInvalidArgumentException - *** -[OC_PythonArray > quickTimeMovieController]: selector not recognized [self = 0x5247f90]. > > Any thoughts are appreciated. > > Jared Barden > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > Wilcox Development Solutions http://www.wilcoxd.com From bob at redivi.com Fri Jul 1 22:03:38 2005 From: bob at redivi.com (Bob Ippolito) Date: Fri, 1 Jul 2005 10:03:38 -1000 Subject: [Pythonmac-SIG] NSMovieView question In-Reply-To: References: <76564DFF-AF73-4C33-A944-E91D62191486@wilcoxd.com> <296F9697-D63B-437B-80B3-671E10E34B2C@livingcode.org> <71E3D47F-6305-4C16-9A38-B6B4A87D82ED@redivi.com> <3D4C8465-9613-4E93-B7B4-F12CB01C83A9@wilcoxd.com> Message-ID: <291A6FD9-C7C2-40A0-869C-75B1439701F9@redivi.com> On Jul 1, 2005, at 9:14 AM, Jared Barden wrote: > I appreciate all the QTMovieView help. Hopefully this will be the > last question on the subject. In my app, I create a QTMovie with > the initWithURL_error_() call. When I try to do a setMovie_() with > the QTMovieView, I receive the following error: > > ValueError: NSInvalidArgumentException - *** -[OC_PythonArray > quickTimeMovieController]: selector not recognized [self = 0x5247f90]. That means you're passing an array somewhere that you should be passing something else. -bob From steve at spvi.com Fri Jul 1 22:08:18 2005 From: steve at spvi.com (Steve Spicklemire) Date: Fri, 1 Jul 2005 15:08:18 -0500 Subject: [Pythonmac-SIG] NSMovieView question In-Reply-To: <291A6FD9-C7C2-40A0-869C-75B1439701F9@redivi.com> References: <76564DFF-AF73-4C33-A944-E91D62191486@wilcoxd.com> <296F9697-D63B-437B-80B3-671E10E34B2C@livingcode.org> <71E3D47F-6305-4C16-9A38-B6B4A87D82ED@redivi.com> <3D4C8465-9613-4E93-B7B4-F12CB01C83A9@wilcoxd.com> <291A6FD9-C7C2-40A0-869C-75B1439701F9@redivi.com> Message-ID: <5A72D2F6-7498-4D92-B1E8-33C0F48FD7F3@spvi.com> Beware.. initWithURL_error_() returns a tuple.. the first element of the tuple is the QTMovie, the second is (presumably) the error. I think it's because python has no concept of a 'pointer to memory', so rather than pass in a pointer, you get a 'tuple' return value. -steve On Jul 1, 2005, at 3:03 PM, Bob Ippolito wrote: > > On Jul 1, 2005, at 9:14 AM, Jared Barden wrote: > > >> I appreciate all the QTMovieView help. Hopefully this will be the >> last question on the subject. In my app, I create a QTMovie with >> the initWithURL_error_() call. When I try to do a setMovie_() with >> the QTMovieView, I receive the following error: >> >> ValueError: NSInvalidArgumentException - *** -[OC_PythonArray >> quickTimeMovieController]: selector not recognized [self = >> 0x5247f90]. >> > > That means you're passing an array somewhere that you should be > passing something else. > > -bob > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > From nil at redshed.net Sun Jul 3 23:07:12 2005 From: nil at redshed.net (Jonathan 'Wolf' Rentzsch) Date: Sun, 3 Jul 2005 16:07:12 -0500 Subject: [Pythonmac-SIG] Xcode fixes Message-ID: <20050703210713.F3C68636854@mail.redshed.net> Hi all, I'm writing about PyObjC, and found a couple of rough spots. I decided it would be easier to fix them than explain how to work around them :-) The files with the fixes in them are here: The archive contains four files: $ find . -type f ./Library/Application Support/Apple/Developer Tools/Project Templates/Application/PyObjC Application/PROJECTNAMEASIDENTIFIER.xcode/default.pbxuser ./Library/Application Support/Apple/Developer Tools/Project Templates/Application/PyObjC Document-based Application/PROJECTNAMEASIDENTIFIER.xcode/default.pbxuser ./Library/Application Support/Apple/Developer Tools/Project Templates/Application/PyObjC Mixed Application/PROJECTNAMEASIDENTIFIER.xcode/default.pbxuser ./Library/Python/2.3/site-packages/PyObjC/PyObjCTools/XcodeSupport/api.py As the archive name implies, I'm targeting 10.4. My changes shouldn't break anything on 10.3, but I haven't personally verified that. Two things fixed: * Xcode 2.1 py2app build exception. Bob mentioned PyObjC 1.4 will fix the .xcodeproj name-change breakage issue. I don't know the 1.4 timeline, so I'm writing about what's out now. My version of the api.py first tries .xcodeproj, and falls back to .xcode if it's not found. Tested on Xcode 2.1 and 2.0. * New PyObjC app projects created via the New Project Assistant didn't have any executables in the project, so Build+Go on new projects were broken out-of-the-box. Bob documented how to fix up your project here: http://pyobjc.sourceforge.net/doc/xcode-templates.php I dug into this a little bit and discovered Custom Executables are stored in the .pbxuser files, not the .pbxproj files. So, I created a default.pbxuser file with the Custom Executable settings, templatized them and popped them the project templates. Seems to work now, both in Xcode 2.0 and 2.1. It would be super if sometime over the next two or three weeks there could be an official release with these changes (assuming no one minds them, of course). I want to make my text to make it look so easy to pick up PyObjC, that there's no reason not to :-) | Jonathan 'Wolf' Rentzsch http://rentzsch.com | Red Shed Software http://redshed.net | "better" necessarily means "different" From bob at redivi.com Sun Jul 3 23:10:39 2005 From: bob at redivi.com (Bob Ippolito) Date: Sun, 3 Jul 2005 11:10:39 -1000 Subject: [Pythonmac-SIG] Xcode fixes In-Reply-To: <20050703210713.F3C68636854@mail.redshed.net> References: <20050703210713.F3C68636854@mail.redshed.net> Message-ID: <4A6659B7-6939-4B50-98EA-7CDC2EF2BA6F@redivi.com> On Jul 3, 2005, at 11:07 AM, Jonathan 'Wolf' Rentzsch wrote: > I'm writing about PyObjC, and found a couple of rough spots. I > decided it > would be easier to fix them than explain how to work around them :-) > > The files with the fixes in them are here: > > Can you apply these against current svn trunk and send a diff? I know at least one of these things was fixed a while back. -bob From kdurston at uoguelph.ca Mon Jul 4 00:40:49 2005 From: kdurston at uoguelph.ca (Kirk Durston) Date: Sun, 03 Jul 2005 18:40:49 -0400 Subject: [Pythonmac-SIG] Something has gone terribly wrong Message-ID: This past winter semester I was happily using Python on my 1.5 GHz Powerbook G4 to write software for my courses & my research. At the time I was using the latest version of Panther. The semester ended, I took a break for a couple months, but it is time to get back to work on some serious software writing to analyze information contained in biosequences. In the meantime I had installed and updated to Tiger 1.4.1. I tried to launch a program I had written. PythonIDE 2.3.2 start up window flashed but would not launch. I tried to launch PythonIDE directly. No dice. I restarted the computer and tried again. No dice. I then re-installed MacPython 2.3 and tried to launch PythonIDE, still no dice. Every time the start up window briefly flashes and then failure. Any solutions or advice? Thanks, Kirk -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050703/f7bee877/attachment.htm From nil at redshed.net Mon Jul 4 00:50:34 2005 From: nil at redshed.net (Jonathan 'Wolf' Rentzsch) Date: Sun, 3 Jul 2005 17:50:34 -0500 Subject: [Pythonmac-SIG] Xcode fixes Message-ID: <20050703225034.28D2D636ACE@mail.redshed.net> Bob Ippolito, bob at redivi.com, wrote: >Can you apply these against current svn trunk and send a diff? Interesting, it looks like both my fixes are already in trunk. Happiness. >I >know at least one of these things was fixed a while back. Yup, it looks like my api.py fix is also redundant. | Jonathan 'Wolf' Rentzsch http://rentzsch.com | Red Shed Software http://redshed.net | "better" necessarily means "different" From waibel at opix.de Mon Jul 4 14:23:17 2005 From: waibel at opix.de (Peter Waibel) Date: Mon, 4 Jul 2005 14:23:17 +0200 Subject: [Pythonmac-SIG] AppScript, Quarks print_ command broken on Tiger Message-ID: <3C3E56B9-B5EA-4F7F-9FF4-47130F6BC2B5@opix.de> Hi all, executing the following code fails on Tiger 4.1, Xpress 6.x: #!/usr/bin/pythonw from appscript import * qxp = app('QuarkXPress') qxp.documents[1].print_() Xpress will quit unexpectedly. Console: Command: QuarkXPress Path: /Applications/QuarkXPress 6.1/QuarkXPress.app/Contents/MacOS/ QuarkXPress Parent: WindowServer [62] Version: QuarkXPress version 6.1 (6.0) PID: 256 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_INVALID_ADDRESS (0x0001) at 0x54dc1838 This is not an AppScript problem! The AppleScript code fails as well: tell application "QuarkXPress" tell document 1 print end tell end tell There was no problem using the code with Panther 3.9 and XPress 6.x Peter ----------------------------------- Opix AG Peter Waibel waibel at opix.de ----------------------------------- From pecora at anvil.nrl.navy.mil Mon Jul 4 16:28:14 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Mon, 04 Jul 2005 10:28:14 -0400 Subject: [Pythonmac-SIG] Python preferences hosed? What to do? Message-ID: <42C9477E.1040709@anvil.nrl.navy.mil> I run Python from BBEdit although I have used the Python IDE, too. All was fine up to a week ago, then today running from BBEdit through the terminal caused a long delay then an error message that Numeric could not be found. The Python IDE would not start up (long delay then a 'quit' automatically). I suspect something is wrong with the preference file, but I'm not sure. I did some poking around online (Google Python prefs, checked the Mac FAQ, etc.), but caught no clues. I haven't installed or changed anything the in the Apple provided python, 2.3. Does anyone have an idea of what happened? Or what course of action might help? I have checked my own ~/.MacOSX/environment.plist, but as I recall that's just for my paths, not the Python application. I checked and found Numeric in the right place (I think), namely, /Library/Python/2.3/Numeric. I'm using a G4 PB (1.25GHz), Mac OS X 10.3.8. Thanks for any help. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From aab.lists at nb-a.com Mon Jul 4 17:01:35 2005 From: aab.lists at nb-a.com (Aldo Bergamini) Date: Mon, 4 Jul 2005 17:01:35 +0200 Subject: [Pythonmac-SIG] Right init method Message-ID: <20050704160135.29560@mail.nb-a.com> Dear list, I have decided to try to practice pyObjC by translating (or trying to..) the Objective-C examples of Aaron Hillegass' Cocoa Programming for MacOS X, as I need to get up to date on Cocoa through Python. I am trying to figure out how to translate the obj-C init method of the SpeakLine example, chp 4. The original obj-C is: - (id)init { [super init] NSLog(@"init"); speechSynth = [[NSSpeechSynthetizer alloc] initWithVoice:nil]; return self; } This is the init method of an application controller class, created inside InterfaceBuilder.. I tried to translate it as: class PySayTextAppDelegate(NibClassBuilder.AutoBaseClass): # IB defined outlets # textField # speechSynthetizer # # IB defined actions # sayIt_ # stopIt_ def __init__(self): super.__init__(self) NSLog("init") self.speechSynth = NSSpeechSynthetizer.alloc().initWithVoice_(nil) This is a regular Python init method; I do not see the ''init" string in the Console app . And therefore the synthetizer object is not created. The same happens for this 'version': def init_(self): super.init_(self) NSLog("init") self.speechSynth = NSSpeechSynthetizer.alloc().initWithVoice_(nil) The last one does 'build' but does not start: def init(self): super.init(self) NSLog("init") self.speechSynth = NSSpeechSynthetizer.alloc().initWithVoice_(nil) Where can I findout how to initialize objects? Thanks Aldo From aab.lists at nb-a.com Mon Jul 4 18:22:00 2005 From: aab.lists at nb-a.com (Aldo Bergamini) Date: Mon, 4 Jul 2005 18:22:00 +0200 Subject: [Pythonmac-SIG] It Was A Typo! Question redressed... Message-ID: <20050704172200.6384@mail.nb-a.com> Well, it works now; apparently somebody chose a strange name for the **synthetizer** class: NSSpeechSynthesizer !! The following method (actually copying more closely the spelling of Hillegass' example) works: def init(self): NSLog("init") self.speechSynth = NSSpeechSynthesizer.alloc() self.speechSynth.initWithVoice_(None) return self My question is now: why do I have to skip the obj-C [super init]; line in Python? Thanks Aldo From jacob at jacobian.org Mon Jul 4 18:23:29 2005 From: jacob at jacobian.org (Jacob Kaplan-Moss) Date: Mon, 4 Jul 2005 11:23:29 -0500 Subject: [Pythonmac-SIG] Right init method In-Reply-To: <20050704160135.29560@mail.nb-a.com> References: <20050704160135.29560@mail.nb-a.com> Message-ID: <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> Aldo -- PyObjC classes (that is, Python classes that extend ObjC ones, like you're trying there) don't use the standard __init__ mechanism (at least, not in a useful way). They do use the standard alloc/init mechanism from ObjC, so you're on the right track in your last try: > def init(self): > super.init(self) > NSLog("init") > self.speechSynth = NSSpeechSynthetizer.alloc > ().initWithVoice_(nil) The only think you're missing is a "return self" -- ObjC init methods always return self, so you have to do the same from PyObjC. Hope that helps, Jacob From bob at redivi.com Mon Jul 4 19:39:55 2005 From: bob at redivi.com (Bob Ippolito) Date: Mon, 4 Jul 2005 07:39:55 -1000 Subject: [Pythonmac-SIG] Right init method In-Reply-To: <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> References: <20050704160135.29560@mail.nb-a.com> <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> Message-ID: <2E167978-4625-40EE-843E-9EB6CBE90C47@redivi.com> On Jul 4, 2005, at 6:23 AM, Jacob Kaplan-Moss wrote: > Aldo -- > > PyObjC classes (that is, Python classes that extend ObjC ones, like > you're trying there) don't use the standard __init__ mechanism (at > least, not in a useful way). They do use the standard alloc/init > mechanism from ObjC, so you're on the right track in your last try: > > >> def init(self): >> super.init(self) >> NSLog("init") >> self.speechSynth = NSSpeechSynthetizer.alloc >> ().initWithVoice_(nil) >> > > The only think you're missing is a "return self" -- ObjC init methods > always return self, so you have to do the same from PyObjC. def init(self): self = super(PySayTextAppDelegate, self).init() .... return self Also, READ THE DOCS and examples please, this is most definitely covered a thousand times :) -bob From jacob at jacobian.org Mon Jul 4 21:31:50 2005 From: jacob at jacobian.org (Jacob Kaplan-Moss) Date: Mon, 4 Jul 2005 14:31:50 -0500 Subject: [Pythonmac-SIG] Right init method In-Reply-To: <2E167978-4625-40EE-843E-9EB6CBE90C47@redivi.com> References: <20050704160135.29560@mail.nb-a.com> <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> <2E167978-4625-40EE-843E-9EB6CBE90C47@redivi.com> Message-ID: On Jul 4, 2005, at 12:39 PM, Bob Ippolito wrote: > Also, READ THE DOCS and examples please, this is most definitely > covered a thousand times :) Lighten up, Bob; this isn't explicitly mentioned anywhere -- it only shows up once in a comment on the intro page (http:// pyobjc.sourceforge.net/doc/intro.php#objective-c-for-pyobjc-users), and it's easy to miss (I know I did when I was getting started). Perhaps this one should be added to the FAQ? Jacob From bob at redivi.com Mon Jul 4 21:36:05 2005 From: bob at redivi.com (Bob Ippolito) Date: Mon, 4 Jul 2005 09:36:05 -1000 Subject: [Pythonmac-SIG] Right init method In-Reply-To: References: <20050704160135.29560@mail.nb-a.com> <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> <2E167978-4625-40EE-843E-9EB6CBE90C47@redivi.com> Message-ID: <8B1349ED-6822-45F4-9B19-BF090B8CE9FD@redivi.com> On Jul 4, 2005, at 9:31 AM, Jacob Kaplan-Moss wrote: > On Jul 4, 2005, at 12:39 PM, Bob Ippolito wrote: > >> Also, READ THE DOCS and examples please, this is most definitely >> covered a thousand times :) >> > > Lighten up, Bob; this isn't explicitly mentioned anywhere -- it > only shows up once in a comment on the intro page (http:// > pyobjc.sourceforge.net/doc/intro.php#objective-c-for-pyobjc-users), > and it's easy to miss (I know I did when I was getting started). > Perhaps this one should be added to the FAQ? It is used in nearly every single example, though. I guess it should be reworded to be more obvious in the docs. -bob From jacob at jacobian.org Mon Jul 4 21:48:49 2005 From: jacob at jacobian.org (Jacob Kaplan-Moss) Date: Mon, 4 Jul 2005 14:48:49 -0500 Subject: [Pythonmac-SIG] PyObjC FAQ In-Reply-To: References: <20050704160135.29560@mail.nb-a.com> <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> <2E167978-4625-40EE-843E-9EB6CBE90C47@redivi.com> Message-ID: <4AADA08A-84BB-4450-BD2A-8B644BF88375@jacobian.org> On Jul 4, 2005, at 2:31 PM, Jacob Kaplan-Moss wrote: > Perhaps this one should be added to the FAQ? > ... which, I now see, doesn't seem to exist (http:// pyobjc.sourceforge.net/faq/ is a 404). Should we write one? I'm happy to coordinate putting one together if people want to send me questions and/or answers that should be in it... Jacob From bob at redivi.com Mon Jul 4 22:43:30 2005 From: bob at redivi.com (Bob Ippolito) Date: Mon, 4 Jul 2005 10:43:30 -1000 Subject: [Pythonmac-SIG] PyObjC FAQ In-Reply-To: <4AADA08A-84BB-4450-BD2A-8B644BF88375@jacobian.org> References: <20050704160135.29560@mail.nb-a.com> <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> <2E167978-4625-40EE-843E-9EB6CBE90C47@redivi.com> <4AADA08A-84BB-4450-BD2A-8B644BF88375@jacobian.org> Message-ID: <30DA6AE7-1E6C-4B45-9100-684673E77057@redivi.com> On Jul 4, 2005, at 9:48 AM, Jacob Kaplan-Moss wrote: > On Jul 4, 2005, at 2:31 PM, Jacob Kaplan-Moss wrote: > > >> Perhaps this one should be added to the FAQ? >> >> > > ... which, I now see, doesn't seem to exist (http:// > pyobjc.sourceforge.net/faq/ is a 404). > > Should we write one? I'm happy to coordinate putting one together if > people want to send me questions and/or answers that should be in > it... Yes, please :) I just wrote an additional section at the beginning of the intro that specifically covers the Three Big Things right up front and quickly (First Steps). http://svn.red-bean.com/pyobjc/trunk/pyobjc/Doc/intro.txt -bob From delza at livingcode.org Tue Jul 5 00:54:48 2005 From: delza at livingcode.org (Dethe Elza) Date: Mon, 4 Jul 2005 15:54:48 -0700 Subject: [Pythonmac-SIG] PyObjC FAQ In-Reply-To: <30DA6AE7-1E6C-4B45-9100-684673E77057@redivi.com> References: <20050704160135.29560@mail.nb-a.com> <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> <2E167978-4625-40EE-843E-9EB6CBE90C47@redivi.com> <4AADA08A-84BB-4450-BD2A-8B644BF88375@jacobian.org> <30DA6AE7-1E6C-4B45-9100-684673E77057@redivi.com> Message-ID: <79582CF0-CFAD-4DCA-AF77-1452043D69AA@livingcode.org> There is a FAQ on the macpython wiki: http://www.pythonmac.org/wiki/FAQ It seems to have been rather drastically refactored, I remember there being many more questions before. --Dethe On 4-Jul-05, at 1:43 PM, Bob Ippolito wrote: > > On Jul 4, 2005, at 9:48 AM, Jacob Kaplan-Moss wrote: > > >> On Jul 4, 2005, at 2:31 PM, Jacob Kaplan-Moss wrote: >> >> >> >>> Perhaps this one should be added to the FAQ? >>> >>> >>> >> >> ... which, I now see, doesn't seem to exist (http:// >> pyobjc.sourceforge.net/faq/ is a 404). >> >> Should we write one? I'm happy to coordinate putting one together if >> people want to send me questions and/or answers that should be in >> it... >> > > Yes, please :) > > I just wrote an additional section at the beginning of the intro that > specifically covers the Three Big Things right up front and quickly > (First Steps). > > http://svn.red-bean.com/pyobjc/trunk/pyobjc/Doc/intro.txt > > -bob > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > Excel is the Awk of Windows --Joel Spolsky From bob at redivi.com Tue Jul 5 01:00:43 2005 From: bob at redivi.com (Bob Ippolito) Date: Mon, 4 Jul 2005 13:00:43 -1000 Subject: [Pythonmac-SIG] PyObjC FAQ In-Reply-To: <79582CF0-CFAD-4DCA-AF77-1452043D69AA@livingcode.org> References: <20050704160135.29560@mail.nb-a.com> <9F2AC4FC-D352-4ECC-A0F1-2A9BC3AA7832@jacobian.org> <2E167978-4625-40EE-843E-9EB6CBE90C47@redivi.com> <4AADA08A-84BB-4450-BD2A-8B644BF88375@jacobian.org> <30DA6AE7-1E6C-4B45-9100-684673E77057@redivi.com> <79582CF0-CFAD-4DCA-AF77-1452043D69AA@livingcode.org> Message-ID: <105C1301-EB08-4F81-BE2A-6B43EC20D563@redivi.com> It's not refactored, someone truncated it. On Jul 4, 2005, at 12:54 PM, Dethe Elza wrote: > There is a FAQ on the macpython wiki: > > http://www.pythonmac.org/wiki/FAQ > > It seems to have been rather drastically refactored, I remember there > being many more questions before. > > --Dethe > > On 4-Jul-05, at 1:43 PM, Bob Ippolito wrote: > > >> >> On Jul 4, 2005, at 9:48 AM, Jacob Kaplan-Moss wrote: >> >> >> >>> On Jul 4, 2005, at 2:31 PM, Jacob Kaplan-Moss wrote: >>> >>> >>> >>> >>>> Perhaps this one should be added to the FAQ? >>>> >>>> >>>> >>>> >>> >>> ... which, I now see, doesn't seem to exist (http:// >>> pyobjc.sourceforge.net/faq/ is a 404). >>> >>> Should we write one? I'm happy to coordinate putting one >>> together if >>> people want to send me questions and/or answers that should be in >>> it... >>> >>> >> >> Yes, please :) >> >> I just wrote an additional section at the beginning of the intro that >> specifically covers the Three Big Things right up front and quickly >> (First Steps). >> >> http://svn.red-bean.com/pyobjc/trunk/pyobjc/Doc/intro.txt >> >> -bob >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> > > > Excel is the Awk of Windows --Joel Spolsky > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From ronaldoussoren at mac.com Mon Jul 4 15:24:09 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 4 Jul 2005 15:24:09 +0200 Subject: [Pythonmac-SIG] Xcode fixes In-Reply-To: <20050703210713.F3C68636854@mail.redshed.net> References: <20050703210713.F3C68636854@mail.redshed.net> Message-ID: <01876FC3-C0A2-4A58-A0D2-822F730906E4@mac.com> On 3-jul-2005, at 23:07, Jonathan 'Wolf' Rentzsch wrote: > > It would be super if sometime over the next two or three weeks there > could be an official release with these changes (assuming no one minds > them, of course). I want to make my text to make it look so easy to > pick > up PyObjC, that there's no reason not to :-) I'll try to make time to do a 1.3.7 release this week. Ronald From aaberga at nb-a.com Mon Jul 4 18:04:49 2005 From: aaberga at nb-a.com (Aldo Bergamini) Date: Mon, 4 Jul 2005 18:04:49 +0200 Subject: [Pythonmac-SIG] More on init Message-ID: <20050704170449.6126@mail.nb-a.com> An update on my fiddling: from Foundation import * from AppKit import * from PyObjCTools import NibClassBuilder class PySayTextAppDelegate(NibClassBuilder.AutoBaseClass): # IB defined outlets # textField # speechSynthetizer # # IB defined actions # sayIt_ # stopIt_ def init(self): NSLog("init") self.speechSynth = NSSpeechSynthetizer.alloc() self.speechSynth.initWithVoice_(None) return self In this version the init method gets called. I did remove the attempt to call the super class' init method. I know that the method IS called as I get an exception on NSSpeechSynthetizer.alloc() (hooray... ;-) : NSSpeechSynthetizer is not defined, apparently. An attempt to import failed miserably... Any idea? Thanks again, Aldo From bob at redivi.com Wed Jul 6 13:37:44 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 6 Jul 2005 01:37:44 -1000 Subject: [Pythonmac-SIG] More on init In-Reply-To: <20050704170449.6126@mail.nb-a.com> References: <20050704170449.6126@mail.nb-a.com> Message-ID: On Jul 4, 2005, at 6:04 AM, Aldo Bergamini wrote: > An update on my fiddling: > > > > > from Foundation import * > from AppKit import * > > > from PyObjCTools import NibClassBuilder > > class PySayTextAppDelegate(NibClassBuilder.AutoBaseClass): > # IB defined outlets > # textField > # speechSynthetizer > # > # IB defined actions > # sayIt_ > # stopIt_ > > def init(self): > > NSLog("init") > > self.speechSynth = NSSpeechSynthetizer.alloc() > self.speechSynth.initWithVoice_(None) > > return self > > > > > In this version the init method gets called. I did remove the > attempt to > call the super class' init method. NEVER remove the attempt to call the super's init method. ALWAYS call the designated initializer. > I know that the method IS called as I get an exception on > NSSpeechSynthetizer.alloc() (hooray... ;-) : NSSpeechSynthetizer is > not > defined, apparently. It's not defined because you didn't spell the class correctly. > An attempt to import failed miserably... Cocoa imports Foundation, AppKit and potentially CoreData. You need to import those separately from PyObjC. -bob From wolfgang.keller.nospam at gmx.de Wed Jul 6 15:43:25 2005 From: wolfgang.keller.nospam at gmx.de (Wolfgang Keller) Date: Wed, 6 Jul 2005 15:43:25 +0200 Subject: [Pythonmac-SIG] Stability of (I)DEs, particularly WingIDE? (Re: [Boa Constr] Re: ANN: Boa Constructor for OS X available) In-Reply-To: <42B3850E.4070903@wordtech-software.com> References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> Message-ID: <963778435.20050706154325@gmx.de> Hello, > I have yet to encounter a Python editor on the Mac that does this > gracefully. Eric3, Spe, PyOxide,and now Boa--they all crash at times, > and sometimes all the time, when trying to eval/debug scripts. > To be perfectly honest, when it comes to the eval/debug cycle, Emacs + > terminal is about the only thing that works for me. Any opinions on how WingIDE compares to the others concerning this issue? TIA, Sincerely, Wolfgang Keller -- P.S.: My From-address is correct From chinook.nr at tds.net Wed Jul 6 16:56:33 2005 From: chinook.nr at tds.net (Chinook) Date: Wed, 06 Jul 2005 10:56:33 -0400 Subject: [Pythonmac-SIG] Stability of (I)DEs, particularly WingIDE? (Re: Re: ANN: Boa Constructor for OS X available) In-Reply-To: <963778435.20050706154325@gmx.de> References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> Message-ID: An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050706/01a2a81c/attachment.htm From delza at livingcode.org Wed Jul 6 17:52:27 2005 From: delza at livingcode.org (Dethe Elza) Date: Wed, 6 Jul 2005 08:52:27 -0700 Subject: [Pythonmac-SIG] More on init In-Reply-To: <20050704170449.6126@mail.nb-a.com> References: <20050704170449.6126@mail.nb-a.com> Message-ID: <375F480B-85AC-4DDE-8F65-07E776CF42C3@livingcode.org> This works for me: from Foundation import * from AppKit import * from PyObjCTools import NibClassBuilder, AppHelper jabberwocky = '''Twas brillig and the slithy toves did gyre and gimble in the wabe all mimsy were the borogroves and the mome raths outgrabe''' class SpeechDelegate(NSObject): def applicationDidFinishLaunching_(self, notification): synth = NSSpeechSynthesizer.alloc() synth = synth.initWithVoice_ ('com.apple.speech.synthesis.voice.Victoria') synth.startSpeakingString_(jabberwocky) app = NSApplication.sharedApplication() delegate = SpeechDelegate.alloc().init() app.setDelegate_(delegate) AppHelper.runEventLoop() From sw at wordtech-software.com Wed Jul 6 18:37:51 2005 From: sw at wordtech-software.com (Kevin Walzer) Date: Wed, 06 Jul 2005 12:37:51 -0400 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths and weaknesses (long) In-Reply-To: <42CBF230.6070904@e.co.za> References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> <42CBF230.6070904@e.co.za> Message-ID: <42CC08DF.206@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Wolfgang, - --- Riaan Booysen wrote: | | Kevin's comments here relate to an incorrect way in which subprocesses | were launced under OS X for those IDEs. | Riaan makes a good point here. Geoff Canyon offered a very useful hint on configuring the various Python IDE's to launch GUI programs. For instance, with Boa Constructor, you would set the path this way: /Library/Frameworks/Python.Framework/Versions/2.4/Resources/Python/Contents/MacOS/Python Wolfgang's question has prompted me to think more generally about each Python IDE for OS Xthat has been discussed. I've used, or tried to use, every one of them over the past several months, and I'd like to offer a brief discussion of each, plus some that have not been discussed at length. So, in no particular order: 1. Boa Constructor. This is the one that I've packaged most recently for OS X. I haven't yet done a "real" project in it, so I don't know all of its capabilities, but I can definitely say that it is a powerful tool that reflects several years of development work by Riaan and others. While its learning curve is not trivial, I found that just in following the "getting started" tutorial that I was able to create a simple wxPython GUI project more easily than with any other toolset. Boa is also, without a doubt, the best-documented of any open-source Python IDE that I've seen: its documents are clear, thorough, extremely extensive, and well-written. I can definitely understand the acclaim that Boa has gotten on other platforms. The work I've done with Boa has mainly been to get a stable configuration for it to run on OS X. As I noted above, I haven't worked with Boa as extensively as the other tools I've packaged, so there may be more work to be done with stability, identifying and fixing bugs, etc. There may also be limits to what can be done, limits that are attributable to the underlying wxPython/wxMac libraries. As I get more experience working with Boa, and as users continue to provide bug reports, I will be able to contribute more to the Mac version. 2. Spe, which also includes wxGlade and other tools. My most extensive experience has been with the Spe/wxGlade combination. Spe itself is a Python editor, and bundles the other programs (including wxGlade) to provide a complete environment. Spe's big strength, especially for wxPython development, is its code completion/code tips capability, and its class browsing features: both are well-done. I also like Spe's built-in console: it's my favorite tool for doing interactive playing/learning with Python. Here Spe's "code-sense" capabilities are also very helfpul. Supplementing Spe's general capabilities is wxGlade, which is a good GUI-building tool for wxWidgets. wxGlade does have a learning curve, but once you get a feel for how it works, it's useful for developing the GUI component of a wxPython script. It doesn't link widgets with events; you have to do that by hand. In the past wxGlade had serious stability issues on OS X; it would crash randomly, and frequently. The newest version (v. 0.4.0 in CVS, which includes some patches submitted by me) is more stable, and running it against the latest Python/wxPython versions also helps. I've been able to use it successfully on a couple of small projects. Spe also had stability issues, which have been reduced greatly by moving to the latest Python/wxPython. A plus for both Spe and wxGlade is that they provide good documentation. 3. Moving away from non-wxPython tools: Eric3 is a Python IDE that's written in PyQt, which I also maintain for the Mac. Eric3 is a very nice editing environment, including project management, integration with Qt's GUI building tools, unit testing, integration with CVS/Subversion, etc. These capabilities are marred by serious stability issues that I don't currently know how to address: it crashes constantly on OS X. I don't see these reports of chronic instability for Eric3 on Linux, so my guess it's related more to the underlying PyQt libraries. Qt 4 has just been released, with a version of PyQt 4 probably a few months away, so I'm hoping that an upgrade of Qt will help with Eric3's problems. Another conspicuous lack for Eric3 is documentation; I'm going to work on writing some basic documentation for this IDE, once I get it running reasonably well. The instability is a real shame, because it's a nice environment otherwise. 4. WingIDE: Wing is a (rather expensive) commercial IDE, and as you should expect, it doesn't have the stability issues. It also has all kinds of slick features, including code/class browsing, extensive and well-written documentation, and so on. Wing provides a free license for open-source development, which is nice. Wing's howling flaw is that it's a GTK-based (meaning X11) application, which I eventually found to be such a distraction that I stopped using it. Wing uses Aqua-type theming to try and fit in, but it still is uncomfortably jarring at least for me. The disjuncture between X11 and Aqua is tolerable when I'm using Gimp for lightweight image editing, but for more serious development work, I want a native tool. 5. I'd also like to say a word for two tools that are often denigrated on OS X: IDLE and PythonIDE, which is part of MacPython. Being a Tkinter app with no Mac optimization at all, IDLE is ugly, but it's quite usable for basic editing: it has syntax coloring, code/class browsing, and other useful features. Whatever its cosmetic flaws, IDLE is a well-designed editing program: I wish other languages (i.e. Tcl/Tk) provided as useful a tool! PythonIDE lacks a few things like syntax coloring (reflecting the fact that it hasn't been updated since 2001), but it is otherwise a superb tool especially for its Mac-specific features: module-browsing including the MacPython Carbon modules, which are undocumented except in the code itself; its user help, including the Python documentation itself, which is integrated into the Apple Help system; and other little goodies. It doesn't look like PythonIDE will be updated at all, because its foundation (the W widget set, WASTE text engine, etc.) is literally prehistoric: dating back to Python's days on OS 8. Too bad, because what is on top of that foundation is really, really good. 6. PyOxide. I've seen PyOxide touted as PythonIDE's eventual replacement, and perhaps it will be, but it's not there yet. I've found it no more stable than Spe--i.e., crash-prone and buggy, though not as badly as Eric3 is--but that's harder to overlook in this case because it's a Cocoa application. It's also minimally documented, has some odd interface features (i.e. it opens with a console that *isn't* a Python interpreter), and is so oriented to PyObjC in terms of class browsing, etc. that I can't see how it would be useful for somone working on, say, a wxPython application. Another tool that's coming on the horizon is ActiveState's Komodo; a beta version will supposedly be released this fall. Komodo is a commercial IDE, like Wing, that supports Python, Tcl/Tk, Perl, and other interpreted langauges. It's expensive for commercial development but has a trivial cost ($30) for personal, noncommercial use; there's also very little, feature-wise, that separates them. (I think a Tk GUI builder is the only thing--but Tk code is easy to write by hand, much easier than wxPython in my experience.) Komodo will run as a native Aqua application, so it should be very interesting to test; it's gotten good reviews on other platforms. Of course, there is also always (Emacs/Vim/insert-your-preferred-text-editor-here) + Terminal as a productive editing environment as well. I hope this helps, and isn't Too Much Information (TM). Cheers, Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.kevin-walzer.com http://www.smallbizmac.com. mailto:sw at wordtech-software.com -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCzAjeJmdQs+6YVcoRAv3kAJ9/g2yZ4WNMdqPYa8OvIKXXik3kZQCfTAU5 M9AYVT62fhZh3dwF6IL1lfQ= =chqZ -----END PGP SIGNATURE----- From delza at livingcode.org Wed Jul 6 19:45:35 2005 From: delza at livingcode.org (Dethe Elza) Date: Wed, 6 Jul 2005 10:45:35 -0700 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths and weaknesses (long) In-Reply-To: <42CC08DF.206@wordtech-software.com> References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> <42CBF230.6070904@e.co.za> <42CC08DF.206@wordtech-software.com> Message-ID: <85360970-A668-4DAD-8A67-D44DE72275A9@livingcode.org> Hi Kevin, Thanks for that summary. Testing out all of these various IDEs has been on my to-do list for a long time, but I never seem to get around to it (I rely on vim and TextWrangler for most of my coding needs). It's very helpful to have a good summary of the features and status of the IDEs handy. --Dethe From ronaldoussoren at mac.com Wed Jul 6 21:53:05 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 6 Jul 2005 21:53:05 +0200 Subject: [Pythonmac-SIG] [ANN] PyObjC 1.3.7 Message-ID: <185033AD-9C16-4A98-9120-AC16733481C6@mac.com> I've just uploaded PyObjC 1.3.7. This is a minor upgrade to PyObjC and features support for Xcode 2.1 in the Xcode templates, several new and improved framework wrappers, the port to Intel as well as some (minor) bugfixes. The new release can be downloaded from http:// pyobjc.sourceforge.net/ For those of you who live under a rock: PyObjC is a bridge between Python and Objective-C. It allows full featured Cocoa applications to be written in pure Python. It is also easy to use other frameworks containing Objective-C class libraries from Python and to mix in Objective-C, C and C++ source. The installer package includes a number of Xcode templates for easily creating new Cocoa-Python projects, as well as py2app, a suite of tools for building redistributable Python applications and plugins. Ronald From rowen at cesmail.net Wed Jul 6 23:27:25 2005 From: rowen at cesmail.net (Russell E. Owen) Date: Wed, 06 Jul 2005 14:27:25 -0700 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths and weaknesses (long) References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> <42CBF230.6070904@e.co.za> <42CC08DF.206@wordtech-software.com> Message-ID: In article <42CC08DF.206 at wordtech-software.com>, Kevin Walzer wrote: > Wolfgang's question has prompted me to think more generally about each > Python IDE for OS Xthat has been discussed.... > 4. WingIDE: Wing is a (rather expensive) commercial IDE, and as you > should expect, it doesn't have the stability issues. It also has all > kinds of slick features, including code/class browsing, extensive and > well-written documentation, and so on. Wing provides a free license for > open-source development, which is nice. Wing's howling flaw is that it's > a GTK-based (meaning X11) application, which I eventually found to be > such a distraction that I stopped using it. Have you tried WingIDE 2.0.3 (the current version)? It is *MUCH* more mac-like than the previous release. The key bindings are almost all natural now and it feels very Mac-like. The things I like about it are: - It is rock solid - Phenomenal support - Supports debugging application that use any of the GUI toolkits. Also, I disagree about the price -- it's not that much money and the increase in productivity is a major win. Also, good code is worth paying for. But I realize it's easier to say that when its not my own money. I qualified for a free license and if I hadn't then my job would have paid for it. I've tried a few others. EricIDE looks somewhat promising but as you noted it is very unstable on the Mac. I found Eclipse too arcane and cluttered, but perhaps it's just a matter of learning it. I plan to try Komodo when it arrives, but if it's written using Tcl/Tk then I worry that it won't be great on the Mac. Aqua Tcl/Tk has many cosmetic bugs that don't show any sign of getting fixed. -- Russell From gary at modernsongs.com Wed Jul 6 23:37:56 2005 From: gary at modernsongs.com (Gary Poster) Date: Wed, 6 Jul 2005 17:37:56 -0400 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths and weaknesses (long) In-Reply-To: References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> <42CBF230.6070904@e.co.za> <42CC08DF.206@wordtech-software.com> Message-ID: On Jul 6, 2005, at 5:27 PM, Russell E. Owen wrote: > I plan to try > Komodo when it arrives, but if it's written using Tcl/Tk then I worry > that it won't be great on the Mac. Aqua Tcl/Tk has many cosmetic bugs > that don't show any sign of getting fixed. On the other platforms Komodo supports, I'm pretty sure they use Mozilla Gecko. I would expect the same on the Mac...but Trent's on this list now, and he'd know for sure. :-) Gary From dleewo at gmail.com Thu Jul 7 00:21:19 2005 From: dleewo at gmail.com (Derek Lee-Wo) Date: Wed, 6 Jul 2005 18:21:19 -0400 Subject: [Pythonmac-SIG] Can MacPython 2.4.1 and Tiger's Python co-exist Message-ID: <17b1a9f105070615213f0df45d@mail.gmail.com> I want to be able to create wxPython apps that can run on Tiger out of the box. That is, using the version of Python and wxWidgets that ship with Tiger. I also want to try Boa Constructor, but it requires MacPython 2.4.1 and wxWdigets 2.6.X Can I insall the latest MacPython and wxWidgets, but have it coexist with the original Tiger versions of these packages? What I'd like to do is use Python 2.4.1 for Boa Contructor, but be able to run any apps I create using the original MacPython that comes with Tiger and thus confirm that the apps would run on iger out-of-the-box. The ReadMe that comes with MacPythion says the executables would go in /usr/local/bin, but it seems that it will put some stuff within the /Library/Frameworks/Python.framework directory. In Windows, I would install the different Python versions to different directories. Same for wxWidgets. --- Derek M. A. Lee-Wo From sw at wordtech-software.com Thu Jul 7 00:31:42 2005 From: sw at wordtech-software.com (Kevin Walzer) Date: Wed, 06 Jul 2005 18:31:42 -0400 Subject: [Pythonmac-SIG] Can MacPython 2.4.1 and Tiger's Python co-exist In-Reply-To: <17b1a9f105070615213f0df45d@mail.gmail.com> References: <17b1a9f105070615213f0df45d@mail.gmail.com> Message-ID: <42CC5BCE.2030901@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yes, you can install Macpython 2.4.1 and wxPython 2.6 separately from what ships with Apple. The Apple stuff in in /System/Frameworks. They will never see each other. I also use your strategy of developing with Python 2.4.1/wxPython 2.6 and testing/deploying against Py 2.3.5/wxPy 2.5. The Apple system installation is a very convenient deployment target. One caveat: the Apple system stuff is older, and especially (with wxPython) a bit buggier. That's why, for instance, Boa won't run on the Apple stuff. wxPython was a moving target until 2.6. However, I haven't seen any huge problems in the stuff I'm developing/working with. Your mileage may vary. Cheers, Kevin Walzer, PhD WordTech Software--Open Source Applications and Packages for OS X http://www.wordtech-software.com http://www.kevin-walzer.com http://www.smallbizmac.com. mailto:sw at wordtech-software.com Derek Lee-Wo wrote: | I want to be able to create wxPython apps that can run on Tiger out of | the box. That is, using the version of Python and wxWidgets that ship | with Tiger. | | I also want to try Boa Constructor, but it requires MacPython 2.4.1 | and wxWdigets 2.6.X | | Can I insall the latest MacPython and wxWidgets, but have it coexist | with the original Tiger versions of these packages? What I'd like to | do is use Python 2.4.1 for Boa Contructor, but be able to run any apps | I create using the original MacPython that comes with Tiger and thus | confirm that the apps would run on iger out-of-the-box. | | The ReadMe that comes with MacPythion says the executables would go in | /usr/local/bin, but it seems that it will put some stuff within the | /Library/Frameworks/Python.framework directory. | | In Windows, I would install the different Python versions to different | directories. Same for wxWidgets. | | --- | Derek M. A. Lee-Wo | _______________________________________________ | Pythonmac-SIG maillist - Pythonmac-SIG at python.org | http://mail.python.org/mailman/listinfo/pythonmac-sig | | -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCzFvMJmdQs+6YVcoRArXJAJ9hZF19IgUTt9dsWfRnGmW2Ntdr4QCfaGjH U41PaJKwpPp2iF3eCrijpN0= =ZvqH -----END PGP SIGNATURE----- From trentm at ActiveState.com Thu Jul 7 00:51:46 2005 From: trentm at ActiveState.com (Trent Mick) Date: Wed, 6 Jul 2005 15:51:46 -0700 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths and weaknesses (long) In-Reply-To: References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> <42CBF230.6070904@e.co.za> <42CC08DF.206@wordtech-software.com> Message-ID: <20050706225146.GB20201@ActiveState.com> [Gary Poster wrote] > On the other platforms Komodo supports, I'm pretty sure they use > Mozilla Gecko. I would expect the same on the Mac...but Trent's on > this list now, and he'd know for sure. :-) That's right: Komodo on OS X uses the Mozilla/Gecko runtime, which effective means that Komodo's UI uses native Carbon widgets. [Russell E. Owen wrote] > > I plan to try > > Komodo when it arrives, but if it's written using Tcl/Tk then I worry > > that it won't be great on the Mac. Aqua Tcl/Tk has many cosmetic bugs > > that don't show any sign of getting fixed. An aside on Tk on OS X: poke around here to see some of the Tcl/Tk work being done for native theming on OS X: http://tktable.sourceforge.net/tile/screenshots/macosx.html This work will be going into *Tcl* 8.5 (its next release). I'm not sure about Python's Tkinter, though. Cheers, Trent -- Trent Mick TrentM at ActiveState.com From sw at wordtech-software.com Thu Jul 7 01:27:03 2005 From: sw at wordtech-software.com (Kevin Walzer) Date: Wed, 06 Jul 2005 19:27:03 -0400 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths and weaknesses (long) In-Reply-To: <20050706225146.GB20201@ActiveState.com> References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> <42CBF230.6070904@e.co.za> <42CC08DF.206@wordtech-software.com> <20050706225146.GB20201@ActiveState.com> Message-ID: <42CC68C7.9030404@wordtech-software.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 | | An aside on Tk on OS X: poke around here to see some of the Tcl/Tk work | being done for native theming on OS X: | http://tktable.sourceforge.net/tile/screenshots/macosx.html | | This work will be going into *Tcl* 8.5 (its next release). I'm not sure | about Python's Tkinter, though. | There's a Tkinter wrapper for Tile for here: http://mfranklin.is-a-geek.org/docs/Tile/Tile.py -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCzGjGJmdQs+6YVcoRAqpVAKCBrVE3rak3dNZ927mQbzKdN1q8ZQCfVp6j DvsHelb+8xjw8+hIfmSPrZ0= =/CZz -----END PGP SIGNATURE----- From Henning.Ramm at mediapro-gmbh.de Thu Jul 7 10:10:21 2005 From: Henning.Ramm at mediapro-gmbh.de (Henning.Ramm@mediapro-gmbh.de) Date: Thu, 7 Jul 2005 10:10:21 +0200 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths andweaknesses (long) Message-ID: Thank you very much for this overview! I tried several IDEs about a month ago to find the suiting one for my little projects and made partly the same, partly different experiences. Several apps showed the same problem on my german Tiger: The text in interpreter windows is not readable (only top part of characters is shown); if I had an option to enable antialiasing, it showed up, but not every app provided that. (Perhaps an issue with some system preference?) Another common problem is non-working (or even crashing) drag-and-drop of files to the IDE's windows or dock icon. Several IDE's I didn't get to use Python 2.4.1 (and the new wxPython), AFAIR it was Boa and PyOxide. And I don't like how most Python editors (even if they use Scintilla) handle (or mostly not-handle) non-Python files - be it config, HTML, text or other-language files. >2. Spe, which also includes wxGlade and other tools. I like SPE on WinXP, even if it tends to run into exceptions after that you seem to be able to work, but you can't save anymore - very dangerous! Other non-options like printing behave the same. On OSX I don't like how SPE's windows are split (notebook tabs, but separate windows, focus change doesn't really work). There were a lot of development for a while, but lately Stani stays quiet - perhaps he choked on his debugger-integration plans. >3. Eric3 Again I didn't manage to let it use Python 2.4.1 Strangely the app starts only every second time. Some more: 7. Eclipse is a mighty Java IDE, or more an application framework that ships with a Java IDE, but there are also two or three Python modules (PyDev, TruStudio). Eclipse's interface has nothing to do with any OS's standards, but I think one will get used to it. But at least on my G4/400 it's just too slow (esp. startup), and I can't wrap my mind around it's concepts. Perhaps that's why I got lost in the preferences and didn't find source browser, code completion etc. 8. DrPython a rather nice little light-weight (wx)Python IDE, extensible with plugins (i.e. a lot of important features are outsourced to plugins), but most plugins are outdated, have bugs or don't work for other reasons. I think it would be suited to replace IDLE more than most other candidates, but needs a bit of work for all the nice features to actually work. There's no Mac bundle yet, you must run it from Terminal. Best regards, Henning Hraban Ramm S?dkurier Medienhaus / MediaPro Support/Admin/Development Dept. From wolfgang.keller.nospam at gmx.de Thu Jul 7 10:43:48 2005 From: wolfgang.keller.nospam at gmx.de (Wolfgang Keller) Date: Thu, 7 Jul 2005 10:43:48 +0200 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths and weaknesses (long) In-Reply-To: <42CC08DF.206@wordtech-software.com> References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> <42CBF230.6070904@e.co.za> <42CC08DF.206@wordtech-software.com> Message-ID: <1289822259.20050707104348@gmx.de> Hello, > Wolfgang's question has prompted me to think more generally about each > Python IDE for OS Xthat has been discussed. I've used, or tried to use, > every one of them over the past several months, and I'd like to offer a > brief discussion of each, plus some that have not been discussed at > length. So, in no particular order: > 1. Boa Constructor. > 2. Spe, > 3. Eric3 > 4. WingIDE: > 5. IDLE and PythonIDE, > 6. PyOxide. > ActiveState's Komodo; > I hope this helps, and isn't Too Much Information (TM). You could easily make a Pyzine article out of that. You didn't happen to try out Pythoncard yet...? *duck* Sincerely, Wolfgang -- P.S.: My From-address is correct From dleewo at gmail.com Thu Jul 7 13:45:40 2005 From: dleewo at gmail.com (Derek Lee-Wo) Date: Thu, 7 Jul 2005 07:45:40 -0400 Subject: [Pythonmac-SIG] Discussion of Python IDE's: strengths andweaknesses (long) In-Reply-To: References: Message-ID: <17b1a9f10507070445533cc8bd@mail.gmail.com> I'll add my 2 cents....Eclipse and PyDev is the ONLY solution I've found that I can work with. I can edit my files and debug them without crashing anything. It is robust and I have yet to find any stability problems. I have tried all the other IDEs that have been mentioned in this thread and they fall into 2 categories: - Disorganized: They are a mess with regards to how windows and displays are organized or just look just horrible. Maybe this is my bias in coming from a Windows background - Unstable: Several would constantly crash, some more than others, but to me, if I get just one crash a day, that's unacceptable. Who know what I can potentially lose. The most common complaint I hear about Eclipse is the size and complexity, but I guess I have an advantage there as I've been doing Java development with Eclipse and IBM's WSAD which is based on Eclipse for a number of years, so I'm VERY comfortable in the Eclipse environment. It does take a while to start, but I'm accustomed to the wait and once it's started, it runs fine. I do agree though that it takes a bit of effort to understand the concepts....workspaces, perspectives, etc > 7. Eclipse > is a mighty Java IDE, or more an application framework that ships > with a Java IDE, but there are also two or three Python modules > (PyDev, TruStudio). > Eclipse's interface has nothing to do with any OS's standards, but I > think one will get used to it. But at least on my G4/400 it's just > too slow (esp. startup), and I can't wrap my mind around it's concepts. > Perhaps that's why I got lost in the preferences and didn't find > source browser, code completion etc. -- --- Derek M. A. Lee-Wo From riaan at e.co.za Wed Jul 6 17:01:04 2005 From: riaan at e.co.za (Riaan Booysen) Date: Wed, 06 Jul 2005 17:01:04 +0200 Subject: [Pythonmac-SIG] Stability of (I)DEs, particularly WingIDE? (Re: [Boa Constr] Re: ANN: Boa Constructor for OS X available) In-Reply-To: <963778435.20050706154325@gmx.de> References: <42B24C62.6020101@wordtech-software.com> <279C16B8-B774-4C19-9DD3-3562196FBF8F@conncoll.edu> <42B36660.6010102@wordtech-software.com> <42B3850E.4070903@wordtech-software.com> <963778435.20050706154325@gmx.de> Message-ID: <42CBF230.6070904@e.co.za> Hi Wolfgang, Wolfgang Keller wrote: > Hello, > > >>I have yet to encounter a Python editor on the Mac that does this >>gracefully. Eric3, Spe, PyOxide,and now Boa--they all crash at times, >>and sometimes all the time, when trying to eval/debug scripts. > > >>To be perfectly honest, when it comes to the eval/debug cycle, Emacs + >>terminal is about the only thing that works for me. > > > Any opinions on how WingIDE compares to the others concerning this > issue? Kevin's comments here relate to an incorrect way in which subprocesses were launced under OS X for those IDEs. That problem has been addressed and the comment no longer applies. Cheers, Riaan. From Jack.Jansen at cwi.nl Thu Jul 7 23:08:55 2005 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu, 7 Jul 2005 23:08:55 +0200 Subject: [Pythonmac-SIG] Did anyone play with TransformProcessType yet? Message-ID: <4946F96D-4918-40AF-95D8-F7BC689C987B@cwi.nl> No, I've not come out of hiding just yet (still far too busy with Ambulant to do any Python work), but I came across TransformProcessType just tonight, so I did a quick experiment and it seems to work. What it does is turn any process into a full-fledged windowing application, with a dock icon, the possibility of a menu bar, etc. So this may be the way to get rid of "pythonw". I quickly added a method MacOS.SetWMAvailable(), and it seems good enough for running the IDE with "python" in stead of "pythonw". The icon is ugly (a terminal- style script), and the application menu title is "python" in stead of whatever script you're running, but that can all be fixed. Did anyone else have a look at this call? Is it worth it to invest some time into it? If it is I'll check it in and people who build Python from CVS can play around with it. Please reply also to me personally, I still have 847 pythonmac-sig mails waiting for me so if you reply only to the list it'll be a long time before I see 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 arsptr at optusnet.com.au Fri Jul 8 01:57:22 2005 From: arsptr at optusnet.com.au (Alastair Rankine) Date: Fri, 08 Jul 2005 09:57:22 +1000 Subject: [Pythonmac-SIG] urllib2 error Message-ID: <42CDC162.9040402@optusnet.com.au> Hi, I just installed MacPython 2.4.1 and TigerPython24Fix from http://undefined.org/python/ onto my Tiger system. All is not well with the urllib2 module: $ python Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import urllib2 >>> urllib2.urlopen("http://www.python.org") Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py", line 130, in urlopen return _opener.open(url, data) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py", line 358, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py", line 376, in _open '_open', req) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py", line 337, in _call_chain result = func(*args) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py", line 1021, in http_open return self.do_open(httplib.HTTPConnection, req) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py", line 996, in do_open raise URLError(err) urllib2.URLError: >>> This does not seem to be a problem with my network: $ host www.python.org www.python.org is an alias for fang.python.org. fang.python.org has address 194.109.137.226 Nor with Apple's python 2.3: $ /usr/bin/python Python 2.3.5 (#1, Mar 20 2005, 20:38:20) [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import urllib2 >>> urllib2.urlopen("http://www.python.org") > >>> Seems like something pretty fundamentally wrong is going on here. Any suggestions? From rkern at ucsd.edu Fri Jul 8 02:39:52 2005 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 07 Jul 2005 17:39:52 -0700 Subject: [Pythonmac-SIG] urllib2 error In-Reply-To: <42CDC162.9040402@optusnet.com.au> References: <42CDC162.9040402@optusnet.com.au> Message-ID: <42CDCB58.105@ucsd.edu> Alastair Rankine wrote: > Hi, > > I just installed MacPython 2.4.1 and TigerPython24Fix from > http://undefined.org/python/ onto my Tiger system. All is not well with > the urllib2 module: > > $ python > Python 2.4.1 (#2, Mar 31 2005, 00:05:10) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> import urllib2 > >>> urllib2.urlopen("http://www.python.org") > Traceback (most recent call last): > File "", line 1, in ? > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/urllib2.py", > line 130, in urlopen > return _opener.open(url, data) [snip] Works for me. [~]$ python Python 2.4.1 (#2, Mar 31 2005, 00:05:10) [GCC 3.3 20030304 (Apple Computer, Inc. build 1666)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import urllib2 >>> urllib2.urlopen('http://www.python.org') > >>> -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From arsptr at optusnet.com.au Fri Jul 8 03:40:36 2005 From: arsptr at optusnet.com.au (Alastair Rankine) Date: Fri, 08 Jul 2005 11:40:36 +1000 Subject: [Pythonmac-SIG] urllib2 error In-Reply-To: <42CDC162.9040402@optusnet.com.au> References: <42CDC162.9040402@optusnet.com.au> Message-ID: <42CDD994.90705@optusnet.com.au> Alastair Rankine wrote: >Hi, > >I just installed MacPython 2.4.1 and TigerPython24Fix from >http://undefined.org/python/ onto my Tiger system. All is not well with >the urllib2 module: > > Found the problem. Turns out that the new urllib searches Internet Config for proxy settings. For some reason I have this set to my work proxy (which currently doesn't resolve). This is probably left over from the last time I ran Classic. Is there a plan to start supporting the System Configuration parameters on MacOS X instead of Internet Config? From gary at modernsongs.com Fri Jul 8 05:15:06 2005 From: gary at modernsongs.com (Gary Poster) Date: Thu, 7 Jul 2005 23:15:06 -0400 Subject: [Pythonmac-SIG] Fredericksburg, VA ZPUG Meeting July 13: PyObjC presentation Message-ID: <062EB0FB-A7F5-44C3-A4A3-94ACE8A5E3E6@modernsongs.com> Won't normally bother the PythonMac SIG with these announcements, but the main event this time is a PyObjC presentation... :-) ------ Please join us July 13, 7:30-9:00 PM, for the second meeting of the Fredericksburg, VA Zope and Python User Group ("ZPUG"). Zac Bir, Zope Corporation Senior Software Engineer, will present on PyObjC. Further meetings are planned for the second Wednesday of every month. Location will be at the Zope Corporation offices. More information http://www.zope.org/Members/poster/ fxbgzpug_announce_2 and below. Hope to see you there! Gary General ZPUG information ------------------------------------ When: second Wednesday of every month, 7:30-9:00. Where: Zope Corporation offices. 513 Prince Edward Street; Fredericksburg, VA 22408 (tinyurl for map is http://tinyurl.com/duoab). Parking: Zope Corporation parking lot; entrance on Prince Edward Street. Topics: As desired (and offered) by participants, within the constraints of having to do with Python. Contact: Gary Poster (gary at zope.com) Second meeting information -------------------------------------- When: July 13, 7:30. Speaker: Zac Bir, Zope Corporation Senior Software Engineer. Topic: Python applications on Mac OS X with PyObjC (http:// pyobjc.sourceforge.net/) Lightning talk: Benji York, Zope Corporation Senior Software Engineer will present a lightning talk on reading parallel ports in Python, using a Super Nintendo game controller as an example. From delza at livingcode.org Fri Jul 8 06:10:08 2005 From: delza at livingcode.org (Dethe Elza) Date: Thu, 7 Jul 2005 21:10:08 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] another tableview question In-Reply-To: <88B446CB-9916-484C-9508-6C65B22393D3@bubblehouse.org> References: <88B446CB-9916-484C-9508-6C65B22393D3@bubblehouse.org> Message-ID: <2F9AD61E-C3F1-4DA9-A3CA-1C1E926D67E4@livingcode.org> On 7-Jul-05, at 7:29 PM, Phil Christensen wrote: > ################################# > # class defined in MainMenu.nib > class ContentsTreeViewDelegate(NibClassBuilder.AutoBaseClass): > # the actual base class is NSObject > # The following outlets are added to the class: > # controller > # tableView > > def init(self): > self.contents = [] > return self > You should call your superclass init() here. Bob Ippolito wrote about proper use of super on this list a few days ago, so I'm paraphrasing from him: def init(self): self = super(ontentsTreeViewDelegate, self).init() self.contents = [] return self > def awakeFromNib(self): > self.tableView.documentView().setDataSource_(self) > You can (and perhaps should) set the data source in your nib using InterfaceBuilder. > def numberOfRowsInTableView_(self, sender): > return (len(self.contents)) > numberOfRowsInTableView_ = objc.selector(numberOfRowsInTableView_, > argumentTypes='O', > returnType='i') > I have never needed to use objc.selector. I think this method should be OK without it. > def tableView_objectValueForTableColumn_row_(self, sender, > tableColumn, row): > if (len(self.contents) > row): > self.contents[row] > tableView_objectValueForTableColumn_row_ = objc.selector > (tableView_objectValueForTableColumn_row_, > > argumentTypes='OOi', > > returnType='O') > I think this may be the problem, you're not returning a value from this method. Also, the value you return should inherit from NSObject, and you should keep a reference to it, because the tableView doesn't, IIRC. > ################################# > > but when I run the application I get: > > 2005-07-07 22:19:30.911 controller[7740] *** Illegal NSTableView > data source (). Must > implement numberOfRowsInTableView: and > tableView:objectValueForTableColumn:row: > I think this is due to you not returning a value from the method above. Try it and see. > > Which I thought I had! Incidentally, I've also tried defining the > selector with and without the 'selector' argument, and I've also > tried using the 'signature' argument instead of the argumentTypes/ > returnType keywords. > You shouldn't need these, the PyObjC does a great job of hiding these details. > Any help would be greatly appreciated. > > Thanks in advance, > > -phil christensen > phil at bubblehouse.org > --Dethe Windows has detected the mouse has moved. Please restart your system for changes to take effect. From bob at redivi.com Fri Jul 8 06:39:03 2005 From: bob at redivi.com (Bob Ippolito) Date: Thu, 7 Jul 2005 18:39:03 -1000 Subject: [Pythonmac-SIG] [Pyobjc-dev] another tableview question In-Reply-To: <2F9AD61E-C3F1-4DA9-A3CA-1C1E926D67E4@livingcode.org> References: <88B446CB-9916-484C-9508-6C65B22393D3@bubblehouse.org> <2F9AD61E-C3F1-4DA9-A3CA-1C1E926D67E4@livingcode.org> Message-ID: <059C0198-07F4-40DE-A69E-6949A99B4323@redivi.com> On Jul 7, 2005, at 6:10 PM, Dethe Elza wrote: > > On 7-Jul-05, at 7:29 PM, Phil Christensen wrote: > >> def numberOfRowsInTableView_(self, sender): >> return (len(self.contents)) >> numberOfRowsInTableView_ = objc.selector >> (numberOfRowsInTableView_, >> argumentTypes='O', >> returnType='i') > > I have never needed to use objc.selector. I think this method should > be OK without it. Since the types are specified by an existing class in the runtime, you definitely don't need or want to specify something else. The objc.selector(...) is actually breaking things, because you can't just pull type codes out of your ass and expect it to do the right thing. 'O' doesn't mean object, '@' does. >> ################################# >> >> but when I run the application I get: >> >> 2005-07-07 22:19:30.911 controller[7740] *** Illegal NSTableView >> data source (). Must >> implement numberOfRowsInTableView: and >> tableView:objectValueForTableColumn:row: I think this is because you're using bogus type codes. Don't use objc.selector unless you need to AND know what you're doing ;) -bob From delza at livingcode.org Fri Jul 8 07:04:27 2005 From: delza at livingcode.org (Dethe Elza) Date: Thu, 7 Jul 2005 22:04:27 -0700 Subject: [Pythonmac-SIG] [Pyobjc-dev] another tableview question In-Reply-To: <2D509742-B74B-4F6B-B2D2-C453A0CA6458@bubblehouse.org> References: <88B446CB-9916-484C-9508-6C65B22393D3@bubblehouse.org> <2F9AD61E-C3F1-4DA9-A3CA-1C1E926D67E4@livingcode.org> <2D509742-B74B-4F6B-B2D2-C453A0CA6458@bubblehouse.org> Message-ID: <33C261EE-9227-4C08-BFE3-F198BD1A5EE8@livingcode.org> > One thing I'm not sure about is making the class a dataSource in > InterfaceBuilder. I made the connection (and obviously defined the > methods in the source), but I couldn't define the appropriate > actions on the class I created in IB. When I tried to create an > action for 'tableView:objectValueForTableColumn:row:', IB told me > it was not a valid action name. I guess that would make sense > anyways, since these aren't actions at all. You don't have to tell IB about actions unless you want to bind them. In this case, all you need to do is tell it you have this custom class, and an instance of your class is the dataSource for your table. The rest should happen at runtime. --Dethe Thought is an infection. In certain cases it becomes an epidemic. -- Wallace Stevens From ronaldoussoren at mac.com Fri Jul 8 10:45:15 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri, 08 Jul 2005 10:45:15 +0200 Subject: [Pythonmac-SIG] [Pyobjc-dev] another tableview question In-Reply-To: <059C0198-07F4-40DE-A69E-6949A99B4323@redivi.com> References: <88B446CB-9916-484C-9508-6C65B22393D3@bubblehouse.org> <2F9AD61E-C3F1-4DA9-A3CA-1C1E926D67E4@livingcode.org> <059C0198-07F4-40DE-A69E-6949A99B4323@redivi.com> Message-ID: <7091783.1120812315909.JavaMail.ronaldoussoren@mac.com> On Friday, July 08, 2005, at 06:40AM, Bob Ippolito wrote: > >On Jul 7, 2005, at 6:10 PM, Dethe Elza wrote: > >> >> On 7-Jul-05, at 7:29 PM, Phil Christensen wrote: >> >>> def numberOfRowsInTableView_(self, sender): >>> return (len(self.contents)) >>> numberOfRowsInTableView_ = objc.selector >>> (numberOfRowsInTableView_, >>> argumentTypes='O', >>> returnType='i') >> >> I have never needed to use objc.selector. I think this method should >> be OK without it. > >Since the types are specified by an existing class in the runtime, >you definitely don't need or want to specify something else. The >objc.selector(...) is actually breaking things, because you can't >just pull type codes out of your ass and expect it to do the right >thing. 'O' doesn't mean object, '@' does.\ This is actually correct, although it could be said that the functionality sucks :-( The argumentTypes and returnType arguments of selector get PyArg_Parse-style type specifiers. I wouldn't be surprised if this code is barely tested, I never used the functionality although it looked like a great idea at the time. > >>> ################################# >>> >>> but when I run the application I get: >>> >>> 2005-07-07 22:19:30.911 controller[7740] *** Illegal NSTableView >>> data source (). Must >>> implement numberOfRowsInTableView: and >>> tableView:objectValueForTableColumn:row: > >I think this is because you're using bogus type codes. Don't use >objc.selector unless you need to AND know what you're doing ;) > >-bob > > > >------------------------------------------------------- >This SF.Net email is sponsored by the 'Do More With Dual!' webinar happening >July 14 at 8am PDT/11am EDT. We invite you to explore the latest in dual >core and dual graphics technology at this free one hour event hosted by HP, >AMD, and NVIDIA. To register visit http://www.hp.com/go/dualwebinar >_______________________________________________ >Pyobjc-dev mailing list >Pyobjc-dev at lists.sourceforge.net >https://lists.sourceforge.net/lists/listinfo/pyobjc-dev > > From Teemu.Rinne at helsinki.fi Sat Jul 9 19:08:54 2005 From: Teemu.Rinne at helsinki.fi (Teemu Rinne) Date: Sat, 09 Jul 2005 10:08:54 -0700 Subject: [Pythonmac-SIG] building rpy Message-ID: Hi, Based on google searches, it seems that rpy (interface for R) should build ok on 10.3.9... how to do it? Is there a binary installer available (compatible with pythonmac.org/packages/)? Building for R version 2.1.1 ... running build running build_py running build_ext building '_rpy' extension gcc -Wl,-F. -Wl,-F. -bundle -framework Python build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/rpymodule.o build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/R_eval.o build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/io.o -L/Library/Frameworks/R.framework/Resources/Frameworks -lR -o build/lib.darwin-7.9.0-Power_Macintosh-2.3/_rpy.so ld: warning -L: directory name (/Library/Frameworks/R.framework/Resources/Frameworks) does not exist ld: can't locate file for: -lR error: command 'gcc' failed with exit status 1 -- Teemu Rinne Human Cognitive Neurophysiology Laboratory, UC Davis and Dept Psych, Univ Helsinki From bob at redivi.com Sat Jul 9 20:34:24 2005 From: bob at redivi.com (Bob Ippolito) Date: Sat, 9 Jul 2005 08:34:24 -1000 Subject: [Pythonmac-SIG] building rpy In-Reply-To: References: Message-ID: On Jul 9, 2005, at 7:08 AM, Teemu Rinne wrote: > Based on google searches, it seems that rpy (interface for R) > should build > ok on 10.3.9... how to do it? Is there a binary installer available > (compatible with pythonmac.org/packages/)? > > Building for R version 2.1.1 ... > running build > running build_py > running build_ext > building '_rpy' extension > gcc -Wl,-F. -Wl,-F. -bundle -framework Python > build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/rpymodule.o > build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/R_eval.o > build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/io.o > -L/Library/Frameworks/R.framework/Resources/Frameworks -lR -o > build/lib.darwin-7.9.0-Power_Macintosh-2.3/_rpy.so > ld: warning -L: directory name > (/Library/Frameworks/R.framework/Resources/Frameworks) does not exist > ld: can't locate file for: -lR > error: command 'gcc' failed with exit status 1 It looks like you need to install R. -bob From Teemu.Rinne at helsinki.fi Sat Jul 9 21:09:06 2005 From: Teemu.Rinne at helsinki.fi (Teemu Rinne) Date: Sat, 09 Jul 2005 12:09:06 -0700 Subject: [Pythonmac-SIG] building rpy In-Reply-To: References: Message-ID: --On Saturday, July 9, 2005 8:34 AM -1000 Bob Ippolito wrote: > On Jul 9, 2005, at 7:08 AM, Teemu Rinne wrote: > >> Based on google searches, it seems that rpy (interface for R) >> should build >> ok on 10.3.9... how to do it? Is there a binary installer available >> (compatible with pythonmac.org/packages/)? >> >> Building for R version 2.1.1 ... >> running build >> running build_py >> running build_ext >> building '_rpy' extension >> gcc -Wl,-F. -Wl,-F. -bundle -framework Python >> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/rpymodule.o >> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/R_eval.o >> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/io.o >> -L/Library/Frameworks/R.framework/Resources/Frameworks -lR -o >> build/lib.darwin-7.9.0-Power_Macintosh-2.3/_rpy.so >> ld: warning -L: directory name >> (/Library/Frameworks/R.framework/Resources/Frameworks) does not exist >> ld: can't locate file for: -lR >> error: command 'gcc' failed with exit status 1 > > It looks like you need to install R. > > -bob > I installed the binaries from , R-2.1.1.dmg. demo(graphics) works ok, R seems to be installed. Contents of /Library/Frameworks/R.framework/Resources look like this: AUTHORS FAQ RESOURCES etc man1 COPYING NEWS THANKS include modules COPYING.LIB ONEWS bin lib share COPYRIGHTS R doc library That is, /Library/Frameworks/R.framework/Resources/Frameworks is missing, thus, there is something wrong with my R installation? How should it be installed then to get the missing Frameworks dir? Thanks, Teemu From bob at redivi.com Sat Jul 9 21:14:59 2005 From: bob at redivi.com (Bob Ippolito) Date: Sat, 9 Jul 2005 09:14:59 -1000 Subject: [Pythonmac-SIG] building rpy In-Reply-To: References: Message-ID: <4BF04EA3-F81C-4A9B-8400-6CCB490AABF9@redivi.com> On Jul 9, 2005, at 9:09 AM, Teemu Rinne wrote: > > > --On Saturday, July 9, 2005 8:34 AM -1000 Bob Ippolito > > wrote: > > >> On Jul 9, 2005, at 7:08 AM, Teemu Rinne wrote: >> >> >>> Based on google searches, it seems that rpy (interface for R) >>> should build >>> ok on 10.3.9... how to do it? Is there a binary installer available >>> (compatible with pythonmac.org/packages/)? >>> >>> Building for R version 2.1.1 ... >>> running build >>> running build_py >>> running build_ext >>> building '_rpy' extension >>> gcc -Wl,-F. -Wl,-F. -bundle -framework Python >>> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/rpymodule.o >>> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/R_eval.o >>> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/io.o >>> -L/Library/Frameworks/R.framework/Resources/Frameworks -lR -o >>> build/lib.darwin-7.9.0-Power_Macintosh-2.3/_rpy.so >>> ld: warning -L: directory name >>> (/Library/Frameworks/R.framework/Resources/Frameworks) does not >>> exist >>> ld: can't locate file for: -lR >>> error: command 'gcc' failed with exit status 1 >>> >> >> It looks like you need to install R. >> >> -bob >> >> > > I installed the binaries from , > R-2.1.1.dmg. > > demo(graphics) works ok, R seems to be installed. > > Contents of /Library/Frameworks/R.framework/Resources look like this: > > AUTHORS FAQ RESOURCES etc man1 > COPYING NEWS THANKS include > modules > COPYING.LIB ONEWS bin lib share > COPYRIGHTS R doc library > > > That is, /Library/Frameworks/R.framework/Resources/Frameworks is > missing, > thus, there is something wrong with my R installation? How should > it be > installed then to get the missing Frameworks dir? I don't know, perhaps you should ask the rpy author or porter. That path doesn't really look right in the first place at closer inspection. -bob From piet at cs.uu.nl Sun Jul 10 16:27:08 2005 From: piet at cs.uu.nl (Piet van Oostrum) Date: Sun, 10 Jul 2005 16:27:08 +0200 Subject: [Pythonmac-SIG] building rpy In-Reply-To: References: Message-ID: >>>>> Teemu Rinne (TR) wrote: >TR> Hi, >TR> Based on google searches, it seems that rpy (interface for R) should build >TR> ok on 10.3.9... how to do it? Is there a binary installer available >TR> (compatible with pythonmac.org/packages/)? >TR> Building for R version 2.1.1 ... >TR> running build >TR> running build_py >TR> running build_ext >TR> building '_rpy' extension >TR> gcc -Wl,-F. -Wl,-F. -bundle -framework Python >TR> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/rpymodule.o >TR> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/R_eval.o >TR> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/io.o >TR> -L/Library/Frameworks/R.framework/Resources/Frameworks -lR -o >TR> build/lib.darwin-7.9.0-Power_Macintosh-2.3/_rpy.so >TR> ld: warning -L: directory name >TR> (/Library/Frameworks/R.framework/Resources/Frameworks) does not exist I tried this also. It appears that the required lib is in /Library/Frameworks/R.framework/Resources/lib rather than /Library/Frameworks/R.framework/Resources/Frameworks. You can either make a symbolic link from lib to Frameworks or issue the following command (all in one line): /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/config/PantherPythonFix/run-gcc -Wl,-F. -Wl,-F. -bundle -undefined dynamic_lookup build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/rpymodule.o build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/R_eval.o build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/io.o -L/Library/Frameworks/R.framework/Resources/lib -lR -o build/lib.darwin-7.9.0-Power_Macintosh-2.3/_rpy.so and redo the python setup.py install afterwards. -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet at vanoostrum.org From cdamundsen at gmail.com Sun Jul 10 18:42:13 2005 From: cdamundsen at gmail.com (Craig Amundsen) Date: Sun, 10 Jul 2005 09:42:13 -0700 Subject: [Pythonmac-SIG] building rpy In-Reply-To: References: Message-ID: <8dc0c28f05071009421e4a5e55@mail.gmail.com> Hi - I've built R and rpy on a couple of Macs using a bashed together combination of the instructions in http://rpy.sourceforge.net/faq.html and http://www.economia.unimi.it/R/RMACOSX-FAQ.html The key bit is that R needs to be built as a shared library. >From the rpy FAQ: ./configure --enable-R-shlib To make R a Framework build, from the Building R FAQ: ./configure --with-blas='-framework vecLib' --with-lapack --with-aqua Combining these two collections of configure options gets us ./configure --with-blas='-framework vecLib' --with-lapack --with-aqua --enable-R-shlib After configuring, making and installing R as above, rpy should build just fine. - Craig From Teemu.Rinne at helsinki.fi Sun Jul 10 20:17:39 2005 From: Teemu.Rinne at helsinki.fi (Teemu Rinne) Date: Sun, 10 Jul 2005 11:17:39 -0700 Subject: [Pythonmac-SIG] building rpy In-Reply-To: References: Message-ID: <09ACD84285282C0878F33D8F@[10.0.1.3]> Thanks! '-L/Library/Frameworks/R.framework/Resources/lib' worked ok. -- Teemu --On Sunday, July 10, 2005 4:27 PM +0200 Piet van Oostrum wrote: >>>>>> Teemu Rinne (TR) wrote: > >> TR> Hi, >> TR> Based on google searches, it seems that rpy (interface for R) should >> build TR> ok on 10.3.9... how to do it? Is there a binary installer >> available TR> (compatible with pythonmac.org/packages/)? > >> TR> Building for R version 2.1.1 ... >> TR> running build >> TR> running build_py >> TR> running build_ext >> TR> building '_rpy' extension >> TR> gcc -Wl,-F. -Wl,-F. -bundle -framework Python >> TR> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/rpymodule.o >> TR> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/R_eval.o >> TR> build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/io.o >> TR> -L/Library/Frameworks/R.framework/Resources/Frameworks -lR -o >> TR> build/lib.darwin-7.9.0-Power_Macintosh-2.3/_rpy.so >> TR> ld: warning -L: directory name >> TR> (/Library/Frameworks/R.framework/Resources/Frameworks) does not exist > > I tried this also. It appears that the required lib is in > /Library/Frameworks/R.framework/Resources/lib rather than > /Library/Frameworks/R.framework/Resources/Frameworks. > You can either make a symbolic link from lib to Frameworks or issue the > following command (all in one line): > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/co > nfig/PantherPythonFix/run-gcc -Wl,-F. -Wl,-F. -bundle -undefined > dynamic_lookup > build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/rpymodule.o > build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/R_eval.o > build/temp.darwin-7.9.0-Power_Macintosh-2.3/src/io.o > -L/Library/Frameworks/R.framework/Resources/lib -lR -o > build/lib.darwin-7.9.0-Power_Macintosh-2.3/_rpy.so > > and redo the python setup.py install afterwards. > > -- > Piet van Oostrum > URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] > Private email: piet at vanoostrum.org From brad.allen at omsdal.com Sun Jul 10 21:51:21 2005 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Sun, 10 Jul 2005 14:51:21 -0500 Subject: [Pythonmac-SIG] appscript raises deprecation warning for macerrors Message-ID: I just started using appscript for the first time (it's great!), and ran across this deprecation warning when I import appscript. It looks like the problem is not with appscript itself but with the macerrors module that it utilizes. I'm using appscript with Tiger's built-in Python, because that's what the appscript installer defaults to using. (I don't think the Python 2.4 version is available yet). Maybe this isn't news to anyone, but just in case, here is the message. Python 2.3.5 (#1, Mar 20 2005, 20:38:20) [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from appscript import * /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/aem/send/errors.py:5: DeprecationWarning: Non-ASCII character '\x80' in file /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/macerrors.py on line 326, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details import macerrors >>> To make this message go away, I had to open up macerrors.py and get rid of the non-ASCII characters. It turns out those characters were in the comments, not the actual code. There were a number of them, so to save time I ended up doing a Select All in BBEdit and chose Text-> Convert to ASCII. Brad Allen IT Desktop Support brad.allen at omsdal.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050710/eacfa725/attachment-0001.htm -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: image/jpeg Size: 18067 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20050710/eacfa725/attachment-0001.jpeg From bob at redivi.com Sun Jul 10 22:04:00 2005 From: bob at redivi.com (Bob Ippolito) Date: Sun, 10 Jul 2005 10:04:00 -1000 Subject: [Pythonmac-SIG] appscript raises deprecation warning for macerrors In-Reply-To: References: Message-ID: <3E317C8C-F055-4D2D-84C7-52B68C22FA07@redivi.com> On Jul 10, 2005, at 9:51 AM, brad.allen at omsdal.com wrote: > l; charset="US-ASCII" > I just started using appscript for the first time (it's great!), > and ran across this deprecation warning when I import appscript. It > looks like the problem is not with appscript itself but with the > macerrors module that it utilizes. I'm using appscript with Tiger's > built-in Python, because that's what the appscript installer > defaults to using. (I don't think the Python 2.4 version is > available yet). > > Maybe this isn't news to anyone, but just in case, here is the > message. > > Python 2.3.5 (#1, Mar 20 2005, 20:38:20) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin > Type "help", "copyright", "credits" or "license" for more information. > >>> from appscript import * > /System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/aem/send/errors.py:5: DeprecationWarning: > Non-ASCII character '\x80' in file /System/Library/Frameworks/ > Python.framework/Versions/2.3/lib/python2.3/plat-mac/macerrors.py > on line 326, but no encoding declared; see http://www.python.org/ > peps/pep-0263.html for details > import macerrors > >>> > > To make this message go away, I had to open up macerrors.py and get > rid of the non-ASCII characters. It turns out those characters were > in the comments, not the actual code. There were a number of them, > so to save time I ended up doing a Select All in BBEdit and chose > Text-> Convert to ASCII. That's really the wrong way to solve that problem, if you read the PEP that the warning references then you'll see how to add a -*- coding: -*- to the file such that it will simply interpret the source characters in the correct encoding. In this case, it's almost certainly macroman. -bob From hengist.podd at virgin.net Sun Jul 10 22:22:21 2005 From: hengist.podd at virgin.net (has) Date: Sun, 10 Jul 2005 21:22:21 +0100 Subject: [Pythonmac-SIG] appscript raises deprecation warning for macerrors In-Reply-To: References: Message-ID: Brad Allen wrote: >I just started using appscript for the first time (it's great!), and ran across this deprecation warning when I import appscript. It looks like the problem is not with appscript itself but with the macerrors module that it utilizes. I'm using appscript with Tiger's built-in Python, because that's what the appscript installer defaults to using. Yep, it's Apple's Python that's the problem; I had another report of this just this morning. Not sure what the best way to deal with it is. I hate having to kludge around other folks' goof-ups (I've enough of my own to deal with), but since it's not really practical to patch Apple's Python I reckon I'll either have to get rid of the macerrors dependency, supply my own copy of macerrors.py, or try to squelch that particular warning with a filter. Anyone any thoughts? > (I don't think the Python 2.4 version is available yet). No installer for Python 2.4 yet, though you can build appscript et-al from source if you want. There's a new release due shortly though, so hopefully there'll be 2.3 and 2.4 installers for that. has -- http://freespace.virgin.net/hamish.sanderson/ From chinook.nr at tds.net Mon Jul 11 03:31:01 2005 From: chinook.nr at tds.net (Chinook) Date: Sun, 10 Jul 2005 21:31:01 -0400 Subject: [Pythonmac-SIG] Mac OS X volume ownership Message-ID: I hope this is not too far of the mark for this forum, but I'm having a problem with a point in a maintenance module I'm trying to create. I've started from the bottom here in trying to work things out in a bash script first. The point I'm having a problem with is how to uncheck/unset "Ignore ownership on this volume" as one might with the Get Info pane. I've managed to construct the mount point and device node, but this issue causes me a problem in further access. Anyone know? Thanks, Lee C -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050710/12aff02a/attachment.htm From bob at redivi.com Mon Jul 11 03:42:48 2005 From: bob at redivi.com (Bob Ippolito) Date: Sun, 10 Jul 2005 15:42:48 -1000 Subject: [Pythonmac-SIG] Mac OS X volume ownership In-Reply-To: References: Message-ID: On Jul 10, 2005, at 3:31 PM, Chinook wrote: > I hope this is not too far of the mark for this forum, but I'm > having a problem with a point in a maintenance module I'm trying to > create. > > I've started from the bottom here in trying to work things out in a > bash script first. The point I'm having a problem with is how to > uncheck/unset "Ignore ownership on this volume" as one might > with the Get Info pane. I've managed to construct the mount point > and device node, but this issue causes me a problem in further access. > > Anyone know? http://www.macosxhints.com/article.php?story=20020925051644480 -bob From chinook.nr at tds.net Mon Jul 11 04:15:31 2005 From: chinook.nr at tds.net (Chinook) Date: Sun, 10 Jul 2005 22:15:31 -0400 Subject: [Pythonmac-SIG] Mac OS X volume ownership In-Reply-To: References: Message-ID: Bob Ippolito wrote: >On Jul 10, 2005, at 3:31 PM, Chinook wrote: > > > >>I hope this is not too far of the mark for this forum, but I'm >>having a problem with a point in a maintenance module I'm trying to >>create. >> >>I've started from the bottom here in trying to work things out in a >>bash script first. The point I'm having a problem with is how to >>uncheck/unset "Ignore ownership on this volume" as one might >>with the Get Info pane. I've managed to construct the mount point >>and device node, but this issue causes me a problem in further access. >> >>Anyone know? >> >> > >http://www.macosxhints.com/article.php?story=20020925051644480 > >-bob > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > > Hey, great Bob :~) Doesn't say much for my googling does it, sorry. The specific reference link http://developer.apple.com/techpubs/macosx/ReleaseNotes/Permissions.html doesn't seem to exist anymore, but there seems to be a lot of other code there if I hit another issue. Thanks again, Lee C From brad.allen at omsdal.com Mon Jul 11 07:29:45 2005 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Mon, 11 Jul 2005 00:29:45 -0500 Subject: [Pythonmac-SIG] appscript raises deprecation warning for macerrors In-Reply-To: <3E317C8C-F055-4D2D-84C7-52B68C22FA07@redivi.com> Message-ID: Bob Ippolito wrote on 07/10/2005 03:04:00 PM: > That's really the wrong way to solve that problem, if you read the > PEP that the warning references then you'll see how to add a -*- > coding: -*- to the file such that it will simply interpret the source > characters in the correct encoding. In this case, it's almost > certainly macroman. Aha, so those garbage characters might have made sense if I had reopened the document using Mac Roman encoding. However, it seemed odd that most of those were just individual characters here and there typed in the comments, and they didn't look like anything a human would have typed on purpose. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050711/0e1d3da9/attachment.htm From bob at redivi.com Mon Jul 11 07:45:43 2005 From: bob at redivi.com (Bob Ippolito) Date: Sun, 10 Jul 2005 19:45:43 -1000 Subject: [Pythonmac-SIG] appscript raises deprecation warning for macerrors In-Reply-To: References: Message-ID: On Jul 10, 2005, at 7:29 PM, brad.allen at omsdal.com wrote: > > Bob Ippolito wrote on 07/10/2005 03:04:00 PM: > > > That's really the wrong way to solve that problem, if you read the > > PEP that the warning references then you'll see how to add a -*- > > coding: -*- to the file such that it will simply interpret the > source > > characters in the correct encoding. In this case, it's almost > > certainly macroman. > > Aha, so those garbage characters might have made sense if I had > reopened the document using Mac Roman encoding. However, it seemed > odd that most of those were just individual characters here and > there typed in the comments, and they didn't look like anything > a human would have typed on purpose. Of course it looks like garbage when using an incorrect encoding :) Whether it is actually garbage or not is another question... I'm pretty sure that file is automatically generated from Universal Headers, so whatever it is presumably came from the (ancient) Apple header files. -bob From hengist.podd at virgin.net Mon Jul 11 14:52:48 2005 From: hengist.podd at virgin.net (has) Date: Mon, 11 Jul 2005 13:52:48 +0100 Subject: [Pythonmac-SIG] [ann] appscript 0.13.0 posted Message-ID: Hi all, Just posted new versions of appscript, aem and osaterminology to: http://freespace.virgin.net/hamish.sanderson/appscript_source.html Mostly bug-fixes and minor improvements. If folk'd like to pound on 'em a bit and let me know if there's any problems, it'd be much appreciated. If all's well, we can see about getting some installers knocked out. has -- http://freespace.virgin.net/hamish.sanderson/ From ronaldoussoren at mac.com Mon Jul 11 19:24:16 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 11 Jul 2005 19:24:16 +0200 Subject: [Pythonmac-SIG] appscript raises deprecation warning for macerrors In-Reply-To: References: Message-ID: On 10-jul-2005, at 22:22, has wrote: > Brad Allen wrote: > > >> I just started using appscript for the first time (it's great!), >> and ran across this deprecation warning when I import appscript. >> It looks like the problem is not with appscript itself but with >> the macerrors module that it utilizes. I'm using appscript with >> Tiger's built-in Python, because that's what the appscript >> installer defaults to using. >> > > Yep, it's Apple's Python that's the problem; I had another report > of this just this morning. Not sure what the best way to deal with > it is. I hate having to kludge around other folks' goof-ups (I've > enough of my own to deal with), but since it's not really practical > to patch Apple's Python I reckon I'll either have to get rid of the > macerrors dependency, supply my own copy of macerrors.py, or try to > squelch that particular warning with a filter. Anyone any thoughts? I'd surpress the warning by surpressing DepricationWarning during the import of macerrors. Then work on a patch for Python (probably bgen) to make sure that future versions (2.4.2 and 2.5) no longer give the warning when importing macerrors. BTW. It is not "Apple's Python" that has a problem, the problem is a generic python bug. Python 2.4 has the same problem, you might not see it if the .py files we're byte-compiled during installation because the warning is only emited during byte compilation. Ronald From hengist.podd at virgin.net Mon Jul 11 20:10:53 2005 From: hengist.podd at virgin.net (has) Date: Mon, 11 Jul 2005 19:10:53 +0100 Subject: [Pythonmac-SIG] appscript raises deprecation warning for macerrors In-Reply-To: References: Message-ID: Ronald Oussoren wrote: >>>I just started using appscript for the first time (it's great!), and ran across this deprecation warning when I import appscript >> >>Yep, it's Apple's Python that's the problem; I had another report of this just this morning. > >I'd surpress the warning by surpressing DepricationWarning during the import of macerrors. Since it's not essential (I was scraping its __dict__ to generate basic error names), I've just removed the macerrors dependency for now and reverted to using MacOS.GetErrorMessage(), which produces some nonsense descriptions but will do for now. >Then work on a patch for Python (probably bgen) to make sure that future versions (2.4.2 and 2.5) no longer give the warning when importing macerrors. Maybe after bgen gets properly documented. ;) Anyway, thanks for the explanation - that'll be why I never saw the error here. has -- http://freespace.virgin.net/hamish.sanderson/ From ronaldoussoren at mac.com Mon Jul 11 22:28:34 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 11 Jul 2005 22:28:34 +0200 Subject: [Pythonmac-SIG] appscript raises deprecation warning for macerrors In-Reply-To: References: Message-ID: <0B21ABDF-A49B-4601-82FE-1E33FA642D27@mac.com> On 11-jul-2005, at 20:10, has wrote: > >> Then work on a patch for Python (probably bgen) to make sure that >> future versions (2.4.2 and 2.5) no longer give the warning when >> importing macerrors. >> > > Maybe after bgen gets properly documented. ;) This one should be pretty easy: generate a encoding declaration at the start of every python file emitted by bgen. ... I've investigated some more (that is performed two find(1) commands) and it seems that macerrors.py is *not* generated by bgen.py but using Mac/scripts/mkestrres.py. The version of that script in the Py2.4.1 source tree doesn't work (it uses EasyDialogs without importing it). This means someone could get away with a very simple patch: just erase the offending character from macerrors.py. Ronald From stokes at mac.com Mon Jul 11 22:54:43 2005 From: stokes at mac.com (Dave Stokes) Date: Mon, 11 Jul 2005 16:54:43 -0400 Subject: [Pythonmac-SIG] Tiger's default Python set-up Message-ID: <8815565C8042534F9D665B733A7406ED042A6D@rodan.cyberlore.com> Hello, all. this is my first post to the pythonmac-sig mailing list, so please forgive me if my question is not fully in line with the purpose of the group. Anyway, could someone provide me with some information about how Python is supposed to be set up under Mac OS 10.4? Specifically, what would a clean system install look like? I had some difficulty with Python after upgrading from 10.3 which I attempted to repair myself. I realize now, after looking over the system and doing some research on-line, that I had no idea what I was doing - the majority of Python work I'd done had been either under Windows or Linux, so trying to apply that knowledge to my Mac installation ended up completely breaking things. Every Python shell/IDE is running a different version, and none of them can 'see' my site-packages directories (of which there are four in various locations). Everything I've subjected my poor machine to has just made it worse, so I've come to the conclusion that I should just chuck it and start over. Can anyone offer any advice? Environment variables, directory structure, et cetera. I'd appreciate it. Thanks, Dave Stokes -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050711/cc65b1dd/attachment.htm From misterhyde18 at hotmail.com Tue Jul 12 15:27:41 2005 From: misterhyde18 at hotmail.com (Mathieu Renauld) Date: Tue, 12 Jul 2005 13:27:41 +0000 Subject: [Pythonmac-SIG] open() does'nt work with py2app Message-ID: Hi! First forgive me for the language mistakes (I'm french)!! I try to make a program using wxPython and Python 2.4. There's a function which creates a file like that: file = open('myfile.py','w') when I launch the program from a shell (python test.py), it work perfectly and the file is created, but once I've 'compiled' it with py2app, the created app doesn't create anything. If somebody has already met that problem, please help me !! thanks! From joaoleao at gmx.net Tue Jul 12 15:48:32 2005 From: joaoleao at gmx.net (=?ISO-8859-1?Q?Jo=E3o_Le=E3o?=) Date: Tue, 12 Jul 2005 14:48:32 +0100 Subject: [Pythonmac-SIG] py2app and Python 2.3.5 Message-ID: <83470C09-F9D9-43CE-8E70-E98FBA128108@gmx.net> I have both Apple's Python (2.3.5) and MacPython 2.4.1 installed under 10.4.1. Before Tiger (Panther + Python 2.3 with Panther addons) i had been using py2applet to build an application that makes extensive use of CoreGraphics. As previously noted by others, this module isn't available through Python 2.4, so my question is: How do I tell py2app to build an application using the vendor Python 2.3.5 (embedded or not) instead of Python2.4? Can it be done with py2applet? Thanks in advance, jo?o From dangoor at gmail.com Tue Jul 12 16:03:36 2005 From: dangoor at gmail.com (Kevin Dangoor) Date: Tue, 12 Jul 2005 10:03:36 -0400 Subject: [Pythonmac-SIG] open() does'nt work with py2app In-Reply-To: References: Message-ID: <3f085ecd05071207035e798d32@mail.gmail.com> On 7/12/05, Mathieu Renauld wrote: > Hi! > First forgive me for the language mistakes (I'm french)!! Your English is more understandable than some native English writers I've seen :) > > I try to make a program using wxPython and Python 2.4. > There's a function which creates a file like that: > file = open('myfile.py','w') > > when I launch the program from a shell (python test.py), it work perfectly > and the file is created, but once I've 'compiled' it with py2app, the > created app doesn't create anything. > If somebody has already met that problem, please help me !! thanks! I'd imagine it did create the file... you just have to know where to look. When you fire up an app, your working directory is *inside the app bundle*. This is good for many things, but not for writing files. (If you look inside the .app bundle, you'll find your myfile.py down in there...) For the purposes of testing, you might try something like this: import user import os fn = os.path.join(user.home, "myfile.py") file = open(fn, "w") That will create the file in your home directory. Kevin From ronaldoussoren at mac.com Tue Jul 12 16:13:56 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 12 Jul 2005 16:13:56 +0200 Subject: [Pythonmac-SIG] open() does'nt work with py2app In-Reply-To: <3f085ecd05071207035e798d32@mail.gmail.com> References: <3f085ecd05071207035e798d32@mail.gmail.com> Message-ID: On 12-jul-2005, at 16:03, Kevin Dangoor wrote: > > import user Don't import user just to get at user.home! The user module looks for a ~/.pythonrc.py and executes that. Setting user.home is just a side- effect of its (mostly unwanted) functionality. Use os.path.expanduser('~') to get the home directory of the current user. Ronald From dfh at forestfield.co.uk Tue Jul 12 16:43:00 2005 From: dfh at forestfield.co.uk (David Hughes) Date: Tue, 12 Jul 2005 15:43 +0100 (BST) Subject: [Pythonmac-SIG] Building a multi-component application with py2app Message-ID: I have a wxPython application where the main process has a number of components that can be started as separate processes when required, for example, an independent GUI help viewer and several console-type helper tasks. With py2exe under MSW I can build them all into the same 'Dist' with a single setup.py so they share the same support modules and libraries. Is the same thing achievable with py2app? I can obviously build each component as a separate application, with no sharing, but the overhead is 10+ Mb per component. The py2app examples for drpython imply that the 'app' parameter in the call to setup can be a list of .pyw(?) files but when I try something similar, I get "error: Multiple targets not currently supported". Is it possible to achieve this, or maybe to 'merge' a number of standalone apps? Regards, David Hughes Forestfield Software From drcairns at gmail.com Tue Jul 12 18:17:35 2005 From: drcairns at gmail.com (David Cairns) Date: Tue, 12 Jul 2005 12:17:35 -0400 Subject: [Pythonmac-SIG] where is PyInterpreterView Message-ID: Hi everybody, At WWDC, I saw the Python in OS X talk, and I am really interested in integrating PyInterpreterView in my application, in order to implement a sort of scripting/debugging system, but I can't seem to find the .palette file the widget is contained in. Is this something else I need to download and/or install ? Also, how would i go about setting up my application so that the PyInterpreterView would be able to access my application's globals? Any help is greatly appreciated. -- david From ronaldoussoren at mac.com Tue Jul 12 19:12:08 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 12 Jul 2005 19:12:08 +0200 Subject: [Pythonmac-SIG] where is PyInterpreterView In-Reply-To: References: Message-ID: On 12-jul-2005, at 18:17, David Cairns wrote: > Hi everybody, > > At WWDC, I saw the Python in OS X talk, and I am really interested in > integrating PyInterpreterView in my application, in order to implement > a sort of scripting/debugging system, but I can't seem to find the > .palette file the widget is contained in. Is this something else I > need to download and/or install ? You can download the sample code here: http://pythonmac.org/wwdc2005/ > > Also, how would i go about setting up my application so that the > PyInterpreterView would be able to access my application's globals? PyObjC cannot automaticly see globals. The easiest way to access them from python is writing a class with methods for getting/setting the globals. Ronald > Any help is greatly appreciated. > > -- david > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From bob at redivi.com Tue Jul 12 21:04:17 2005 From: bob at redivi.com (Bob Ippolito) Date: Tue, 12 Jul 2005 09:04:17 -1000 Subject: [Pythonmac-SIG] py2app and Python 2.3.5 In-Reply-To: <83470C09-F9D9-43CE-8E70-E98FBA128108@gmx.net> References: <83470C09-F9D9-43CE-8E70-E98FBA128108@gmx.net> Message-ID: <22D262B1-1876-4659-8862-A2FA29C94F86@redivi.com> On Jul 12, 2005, at 3:48 AM, Jo?o Le?o wrote: > I have both Apple's Python (2.3.5) and MacPython 2.4.1 installed > under 10.4.1. > > Before Tiger (Panther + Python 2.3 with Panther addons) i had been > using py2applet to build an application that makes extensive use of > CoreGraphics. As previously noted by others, this module isn't > available through Python 2.4, so my question is: > > How do I tell py2app to build an application using the vendor Python > 2.3.5 (embedded or not) instead of Python2.4? > Can it be done with py2applet? py2app uses the Python that it was invoked with. Invoke it with Python 2.3 and it will use Python 2.3. For py2applet, you'd have to start it up like /usr/bin/python /usr/local/bin/py2applet. -bob From bob at redivi.com Tue Jul 12 21:06:26 2005 From: bob at redivi.com (Bob Ippolito) Date: Tue, 12 Jul 2005 09:06:26 -1000 Subject: [Pythonmac-SIG] Building a multi-component application with py2app In-Reply-To: References: Message-ID: <4870514A-D248-4FEC-837F-9BF960D12E63@redivi.com> On Jul 12, 2005, at 4:43 AM, David Hughes wrote: > I have a wxPython application where the main process has a number of > components that can be started as separate processes when required, > for > example, an independent GUI help viewer and several console-type > helper > tasks. With py2exe under MSW I can build them all into the same 'Dist' > with a single setup.py so they share the same support modules and > libraries. Is the same thing achievable with py2app? I can > obviously build > each component as a separate application, with no sharing, but the > overhead is 10+ Mb per component. > > The py2app examples for drpython imply that the 'app' parameter in the > call to setup can be a list of .pyw(?) files but when I try something > similar, I get "error: Multiple targets not currently supported". > Is it > possible to achieve this, or maybe to 'merge' a number of > standalone apps? No. Patches accepted. -bob From davidh at mac.com Wed Jul 13 00:22:53 2005 From: davidh at mac.com (David Hill) Date: Tue, 12 Jul 2005 17:22:53 -0500 Subject: [Pythonmac-SIG] pyui font troubles Message-ID: Hi, I'm relatively new to Python and I'm trying to work through some examples in Sean Riley's "Game Programming with Python" book. Unfortunately, I'm having some trouble with most of the examples that use his pyui library. It looks like the examples fail when trying to create a font object for the arial font. I took a look in the pyui code that creates the font (using pygame) and it has this suspicious line: > faceFile = os.environ['WINDIR'] + "/Fonts/" + fontRegistery[faceFile] where fontRegistery[faceFile] == "arial.ttf" That didn't fill me with a great deal of confidence (since it produces a KeyError exception on WINDIR), so I tried a quick hack: > if os.environ.has_key( 'WINDIR' ): > faceFile = os.environ['WINDIR'] + "/Fonts/" + > fontRegistery[faceFile] > else: > faceFile = "/Library/Fonts/Arial" That gets me the bus error shown below. Clearly, the font format on Mac OS X isn't what pygame is expecting. Has anybody else had any luck getting the code from this book to work? The error in the console looks like this: > davidh% /usr/local/bin/pythonw terrainView.py > Creating font: arial > {'impact': 'impact.ttf', 'arial': 'arial.ttf', 'courier': > 'cour.ttf', 'courier new': 'cour.ttf', 'times': 'times.ttf', 'comic > sans ms': 'comic.ttf', 'times new roman': 'times.ttf'} arial > Fatal Python error: (pygame parachute) Bus Error > Abort The stack crawl from the crash report looks like this: > Exception: EXC_BAD_ACCESS (0x0001) > Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x00000000 > > Thread 0 Crashed: > 0 font.so 0x007bb464 initfont + 4972 > 1 org.python.python 0x10052e38 type_call + 284 > (typeobject.c:435) > 2 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 3 org.python.python 0x1007c9e4 do_call + 136 (ceval.c: > 3755) > 4 org.python.python 0x1007c6dc call_function + 1068 > (ceval.c:3572) > 5 org.python.python 0x1007a140 PyEval_EvalFrame + > 8888 (ceval.c:2163) > 6 org.python.python 0x1007b284 PyEval_EvalCodeEx + > 2152 (ceval.c:2730) > 7 org.python.python 0x10026274 function_call + 344 > (funcobject.c:548) > 8 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 9 org.python.python 0x10015a88 instancemethod_call + > 796 (classobject.c:2432) > 10 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 11 org.python.python 0x1007c26c > PyEval_CallObjectWithKeywords + 256 (ceval.c:3420) > 12 org.python.python 0x1000eddc PyInstance_New + 320 > (classobject.c:576) > 13 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 14 org.python.python 0x1007c9e4 do_call + 136 (ceval.c: > 3755) > 15 org.python.python 0x1007c6dc call_function + 1068 > (ceval.c:3572) > 16 org.python.python 0x1007a140 PyEval_EvalFrame + > 8888 (ceval.c:2163) > 17 org.python.python 0x1007c83c fast_function + 212 > (ceval.c:3631) > 18 org.python.python 0x1007c6c4 call_function + 1044 > (ceval.c:3568) > 19 org.python.python 0x1007a140 PyEval_EvalFrame + > 8888 (ceval.c:2163) > 20 org.python.python 0x1007b284 PyEval_EvalCodeEx + > 2152 (ceval.c:2730) > 21 org.python.python 0x10026274 function_call + 344 > (funcobject.c:548) > 22 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 23 org.python.python 0x10015a88 instancemethod_call + > 796 (classobject.c:2432) > 24 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 25 org.python.python 0x1007c9e4 do_call + 136 (ceval.c: > 3755) > 26 org.python.python 0x1007c6dc call_function + 1068 > (ceval.c:3572) > 27 org.python.python 0x1007a140 PyEval_EvalFrame + > 8888 (ceval.c:2163) > 28 org.python.python 0x1007b284 PyEval_EvalCodeEx + > 2152 (ceval.c:2730) > 29 org.python.python 0x10026274 function_call + 344 > (funcobject.c:548) > 30 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 31 org.python.python 0x10015a88 instancemethod_call + > 796 (classobject.c:2432) > 32 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 33 org.python.python 0x1007c26c > PyEval_CallObjectWithKeywords + 256 (ceval.c:3420) > 34 org.python.python 0x1000eddc PyInstance_New + 320 > (classobject.c:576) > 35 org.python.python 0x1000c348 PyObject_Call + 48 > (abstract.c:1752) > 36 org.python.python 0x1007c9e4 do_call + 136 (ceval.c: > 3755) > 37 org.python.python 0x1007c6dc call_function + 1068 > (ceval.c:3572) > 38 org.python.python 0x1007a140 PyEval_EvalFrame + > 8888 (ceval.c:2163) > 39 org.python.python 0x1007b284 PyEval_EvalCodeEx + > 2152 (ceval.c:2730) > 40 org.python.python 0x1007c8cc fast_function + 356 > (ceval.c:3644) > 41 org.python.python 0x1007c6c4 call_function + 1044 > (ceval.c:3568) > 42 org.python.python 0x1007a140 PyEval_EvalFrame + > 8888 (ceval.c:2163) > 43 org.python.python 0x1007c83c fast_function + 212 > (ceval.c:3631) > 44 org.python.python 0x1007c6c4 call_function + 1044 > (ceval.c:3568) > 45 org.python.python 0x1007a140 PyEval_EvalFrame + > 8888 (ceval.c:2163) > 46 org.python.python 0x1007b284 PyEval_EvalCodeEx + > 2152 (ceval.c:2730) > 47 org.python.python 0x1007e678 PyEval_EvalCode + 48 > (ceval.c:484) > 48 org.python.python 0x100b2ee0 run_node + 76 > (pythonrun.c:1265) > 49 org.python.python 0x100b266c > PyRun_SimpleFileExFlags + 592 (pythonrun.c:863) > 50 org.python.python 0x100bf640 Py_Main + 2596 (main.c: > 484) > 51 org.python.python 0x000018d0 0x1000 + 2256 > 52 dyld 0x8fe01048 _dyld_start + 60 Does anybody have any ideas or suggestions? Is pyui just not Mac (or Linux, evidently) friendly? Could I have screwed up my installation of Python 2.4 somehow? Thanks, Dave From gabor at nekomancer.net Wed Jul 13 00:35:57 2005 From: gabor at nekomancer.net (=?ISO-8859-1?Q?G=E1bor_Farkas?=) Date: Wed, 13 Jul 2005 00:35:57 +0200 Subject: [Pythonmac-SIG] appscript + iPhoto problem Message-ID: <42D445CD.8010009@nekomancer.net> hi, what i want to achieve is the following. i want to find a photo in iphoto (i can do that), and then assign some keywords to it. i can find the photo with: iphoto = appscript.app('iPhoto') photos = iphoto.photos() and then i find my photo in 'photos'. and i can also list it's keywords. but how should i SET the keywords? i tried to call the 'help()' method on those objects, but all i get are properties, and i can't find a way to set them. so where should i look? gabor From bob at redivi.com Wed Jul 13 00:55:59 2005 From: bob at redivi.com (Bob Ippolito) Date: Tue, 12 Jul 2005 12:55:59 -1000 Subject: [Pythonmac-SIG] pyui font troubles In-Reply-To: References: Message-ID: <7E1C2F12-DE10-4BC2-ACD3-2A94528FE448@redivi.com> On Jul 12, 2005, at 12:22 PM, David Hill wrote: > I'm relatively new to Python and I'm trying to work through some > examples in Sean Riley's "Game Programming with Python" book. > Unfortunately, I'm having some trouble with most of the examples that > use his pyui library. > > It looks like the examples fail when trying to create a font object > for the arial font. I took a look in the pyui code that creates the > font (using pygame) and it has this suspicious line: > > >> faceFile = os.environ['WINDIR'] + "/Fonts/" + fontRegistery >> [faceFile] >> > > where fontRegistery[faceFile] == "arial.ttf" > > That didn't fill me with a great deal of confidence (since it > produces a KeyError exception on WINDIR), so I tried a quick hack: > > >> if os.environ.has_key( 'WINDIR' ): >> faceFile = os.environ['WINDIR'] + "/Fonts/" + >> fontRegistery[faceFile] >> else: >> faceFile = "/Library/Fonts/Arial" >> > > That gets me the bus error shown below. Clearly, the font format on > Mac OS X isn't what pygame is expecting. Yeah, those aren't going to work. > Has anybody else had any luck getting the code from this book to work? > > The error in the console looks like this: > > >> davidh% /usr/local/bin/pythonw terrainView.py >> Creating font: arial >> {'impact': 'impact.ttf', 'arial': 'arial.ttf', 'courier': >> 'cour.ttf', 'courier new': 'cour.ttf', 'times': 'times.ttf', 'comic >> sans ms': 'comic.ttf', 'times new roman': 'times.ttf'} arial >> Fatal Python error: (pygame parachute) Bus Error >> Abort >> > > The stack crawl from the crash report looks like this: --- > Does anybody have any ideas or suggestions? Is pyui just not Mac (or > Linux, evidently) friendly? Could I have screwed up my installation > of Python 2.4 somehow? Just use the default font (pass None for the path), or get ttfs from somewhere and use those. It sounds like the book (and quite possibly pyui) author didn't test anywhere but Windows, so you'll probably run into a bunch of stuff like this. -bob From davidh at mac.com Wed Jul 13 01:16:45 2005 From: davidh at mac.com (David Hill) Date: Tue, 12 Jul 2005 18:16:45 -0500 Subject: [Pythonmac-SIG] pyui font troubles In-Reply-To: <7E1C2F12-DE10-4BC2-ACD3-2A94528FE448@redivi.com> References: <7E1C2F12-DE10-4BC2-ACD3-2A94528FE448@redivi.com> Message-ID: <9F89454E-2B79-4A57-BD55-2F036390232D@mac.com> Thanks! Now I'm getting somewhere. The examples now run and draw their initial screens but they don't update. Everything seems to be running OK in the background but the window doesn't update at all after the initial drawing. Oh, and I'm getting strange libpng errors in the console: > libpng warning: Incomplete compressed datastream in iCCP chunk > libpng warning: Profile size field missing from iCCP chunk Sigh, it looks like I'll need to dig into this a bit more. At least passing None in the font code is working. Thanks, Dave On Jul 12, 2005, at 5:55 PM, Bob Ippolito wrote: > > On Jul 12, 2005, at 12:22 PM, David Hill wrote: > > >> I'm relatively new to Python and I'm trying to work through some >> examples in Sean Riley's "Game Programming with Python" book. >> Unfortunately, I'm having some trouble with most of the examples that >> use his pyui library. >> >> It looks like the examples fail when trying to create a font object >> for the arial font. I took a look in the pyui code that creates the >> font (using pygame) and it has this suspicious line: >> >> >> >>> faceFile = os.environ['WINDIR'] + "/Fonts/" + fontRegistery >>> [faceFile] >>> >>> >> >> where fontRegistery[faceFile] == "arial.ttf" >> >> That didn't fill me with a great deal of confidence (since it >> produces a KeyError exception on WINDIR), so I tried a quick hack: >> >> >> >>> if os.environ.has_key( 'WINDIR' ): >>> faceFile = os.environ['WINDIR'] + "/Fonts/" + >>> fontRegistery[faceFile] >>> else: >>> faceFile = "/Library/Fonts/Arial" >>> >>> >> >> That gets me the bus error shown below. Clearly, the font format on >> Mac OS X isn't what pygame is expecting. >> > > Yeah, those aren't going to work. > > >> Has anybody else had any luck getting the code from this book to >> work? >> >> The error in the console looks like this: >> >> >> >>> davidh% /usr/local/bin/pythonw terrainView.py >>> Creating font: arial >>> {'impact': 'impact.ttf', 'arial': 'arial.ttf', 'courier': >>> 'cour.ttf', 'courier new': 'cour.ttf', 'times': 'times.ttf', 'comic >>> sans ms': 'comic.ttf', 'times new roman': 'times.ttf'} arial >>> Fatal Python error: (pygame parachute) Bus Error >>> Abort >>> >>> >> >> The stack crawl from the crash report looks like this: >> > > --- > > >> Does anybody have any ideas or suggestions? Is pyui just not Mac (or >> Linux, evidently) friendly? Could I have screwed up my installation >> of Python 2.4 somehow? >> > > Just use the default font (pass None for the path), or get ttfs > from somewhere and use those. It sounds like the book (and quite > possibly pyui) author didn't test anywhere but Windows, so you'll > probably run into a bunch of stuff like this. > > -bob > > From gabor at nekomancer.net Wed Jul 13 11:16:45 2005 From: gabor at nekomancer.net (gabor) Date: Wed, 13 Jul 2005 11:16:45 +0200 Subject: [Pythonmac-SIG] appscript + iPhoto problem In-Reply-To: <42D445CD.8010009@nekomancer.net> References: <42D445CD.8010009@nekomancer.net> Message-ID: <42D4DBFD.4000901@nekomancer.net> G?bor Farkas wrote: > hi, > > what i want to achieve is the following. > > i want to find a photo in iphoto (i can do that), > and then assign some keywords to it. > > i can find the photo with: > > iphoto = appscript.app('iPhoto') > photos = iphoto.photos() > > and then i find my photo in 'photos'. > > and i can also list it's keywords. > but how should i SET the keywords? > > i tried to call the 'help()' method on those objects, > but all i get are properties, and i can't find a way to set them. > ok, now i know more ;) i can use: iphoto = appscript.app('iPhoto') photos = iphoto.photos.get() photo = photos[0] photo.title.set('newTitle') and this works. my other problem now is the keywords... which seems to be an array... how do you work with an array-property in appscript? i tried to simply get it's keywords, append a new keyword to the array, and set it, but it did not work: keys = photo.keywords.get() allkeys = iphoto.keywords.get() lastkey = allkeys[-1] keys.append(lastkey) photo.keywords.set(keys) i get an "Application error 8 (NSInternalScriptError)" :( gabor From hengist.podd at virgin.net Wed Jul 13 14:31:25 2005 From: hengist.podd at virgin.net (has) Date: Wed, 13 Jul 2005 13:31:25 +0100 Subject: [Pythonmac-SIG] appscript + iPhoto problem In-Reply-To: <42D4DBFD.4000901@nekomancer.net> References: <42D445CD.8010009@nekomancer.net> <42D4DBFD.4000901@nekomancer.net> Message-ID: G?bor Farkas wrote: >>what i want to achieve is the following. >> >>i want to find a photo in iphoto (i can do that), >>and then assign some keywords to it. >[...] >ok, now i know more ;) > >i can use: > >iphoto = appscript.app('iPhoto') >photos = iphoto.photos.get() >photo = photos[0] >photo.title.set('newTitle') Simpler: iphoto = appscript.app('iPhoto') iphoto.photos[1].title.set('newTitle') >and this works. > >my other problem now is the keywords... > >which seems to be an array... Actually a one-to-many relationship, called 'elements' in appscript/AppleScript jargon. OK, quick summary since I've not finished writing this stuff up properly yet: Mac application scripting is based on procedural RPC + relational queries. Appscript and AppleScript tend to obfuscate this mechanism under OO-like syntactic sugar, but don't let this fool you. The syntax is merely there to make it nicer to use; you'll see a similar sort of approach used in SQLObject. Basically what you do is construct a query identifying the object or objects you want to manipulate, then send a command to that application with that query as [usually] its direct parameter. The application evaluates that query against its Apple Event Object Model, finds the object(s) to manipulate and performs the appropriate action on it/them. The application's dictionary, which you can view with htmldoc or the built-in help() system, [inadequately] documents the application's AEOM and all the commands the application can respond to. There are various classes of object comprising the AEOM, with the root node being the 'application' object. Every object may have zero or more attributes (e.g. name, class, size, bounds, etc. properties), zero or more one-to-one relationships (e.g. Finder's home property, iTunes' current_album and current_track properties), and zero or more one-to-many relationships (e.g. Finder's items, containers, disks, folders, etc. elements). Attributes usually contain simple values (strings, numbers, etc.) describing an object (e.g. its name, size, position or colour). One-to-many relationships usually (but not always) reflect the objects' containment structure (e.g. a Finder folder object can contain any number of folder, alias_file, application_file, document_file, etc. objects). One-to-one relationships often provide shortcuts to objects of special interest (e.g. iTunes' currently playing track). The appscript documentation will keep you right on legal syntactic forms, special cases, etc., so make sure you read that too. >i tried to simply get it's keywords, append a new keyword to the array, and set it, but it did not work: Hopefully the above makes clear why array manipulation doesn't (and can't) work. >i get an "Application error 8 (NSInternalScriptError)" Cocoa apps tend to provide spectacularly bad error messages. (Feel free to file lots of irritatedly impatient feature requests on this.) This is one of those areas where most application's documentation is sorely inadequate, and you have to resort to educated guesswork based on general knowledge of how the AEOM works. In general, new elements are created using the 'make' command, so try something like: iphoto = appscript.app('iPhoto') iphoto.photos[1].keywords.end.make(new=k.keyword, with_properties={k.name: 'some name'}) Can't test that here since I accidentally trashed my copy of iPhoto 2 on my last system reinstall and refuse to pony up $50 for iLife just to replace it. But I reckon it should be close. If not, post back. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From brad.allen at omsdal.com Wed Jul 13 15:47:08 2005 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Wed, 13 Jul 2005 08:47:08 -0500 Subject: [Pythonmac-SIG] Zope.Interface won't build on 10.4 Message-ID: Maybe I should take this to one of the Twisted or Zope lists, but this appears to be a Mac-specific issue so I thought it worth mentioning here. The problem is that Zope Interface 3.01 won't build on Mac OS 10.3 using either the stock Python 2.3 or Python 2.4.1 (error transcript at the bottom). A Google search of the problem turned up a discussion on one of the Zope lists about this, but I didn't understand how to implement the suggested solution. One message in the thread suggests the problem is that Python was compiled under gcc 3.x and Mac OS 10.4 defaults to using gcc 4.x, and that using gcc select can fix the problem. Any thoughts on how to do that? http://mail.zope.org/pipermail/zope3-users/2005-June/000725.html Here is the error transcript. A similar error happens when running setup.py install. oms-ballen:~/Desktop/TwistedSumo-2005-05-25/ZopeInterface-3.0.1 ballen$ sudo python setup.py build Password: running build running build_py running build_ext building 'zope.interface._zope_interface_coptimizations' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -IDependencies/zope.interface-ZopeInterface-3.0.1/zope.interface -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 -c Dependencies/zope.interface-ZopeInterface-3.0.1/zope.interface/_zope_interface_coptimizations.c -o build/temp.darwin-8.1.0-Power_Macintosh-2.3/Dependencies/zope.interface-ZopeInterface-3.0.1/zope.interface/_zope_interface_coptimizations.o Dependencies/zope.interface-ZopeInterface-3.0.1/zope.interface/_zope_interface_coptimizations.c:339: error: static declaration of 'SpecType' follows non-static declaration Dependencies/zope.interface-ZopeInterface-3.0.1/zope.interface/_zope_interface_coptimizations.c:73: error: previous declaration of 'SpecType' was here error: command 'gcc' failed with exit status 1 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050713/62490071/attachment.htm From dangoor at gmail.com Wed Jul 13 15:55:47 2005 From: dangoor at gmail.com (Kevin Dangoor) Date: Wed, 13 Jul 2005 09:55:47 -0400 Subject: [Pythonmac-SIG] Zope.Interface won't build on 10.4 In-Reply-To: References: Message-ID: <3f085ecd05071306554436eda7@mail.gmail.com> I encountered this as well. I *think* something needs to change within zope.interface to work with gcc 4.x. Anyhow, all you need to do is: sudo gcc_select 3.3 Kevin On 7/13/05, brad.allen at omsdal.com wrote: > > Maybe I should take this to one of the Twisted or Zope lists, but this > appears to be a Mac-specific issue so I thought it worth mentioning here. > The problem is that Zope Interface 3.01 won't build on Mac OS 10.3 using > either the stock Python 2.3 or Python 2.4.1 (error transcript at the > bottom). > > A Google search of the problem turned up a discussion on one of the Zope > lists about this, but I didn't understand how to implement the suggested > solution. One message in the thread suggests the problem is that Python was > compiled under gcc 3.x and Mac OS 10.4 defaults to using gcc 4.x, and that > using gcc select can fix the problem. Any thoughts on how to do that? From gary at modernsongs.com Wed Jul 13 16:00:33 2005 From: gary at modernsongs.com (Gary Poster) Date: Wed, 13 Jul 2005 10:00:33 -0400 Subject: [Pythonmac-SIG] Zope.Interface won't build on 10.4 In-Reply-To: <3f085ecd05071306554436eda7@mail.gmail.com> References: <3f085ecd05071306554436eda7@mail.gmail.com> Message-ID: On Jul 13, 2005, at 9:55 AM, Kevin Dangoor wrote: > I encountered this as well. I *think* something needs to change within > zope.interface to work with gcc 4.x. Anyhow, all you need to do is: > > sudo gcc_select 3.3 > > Kevin And FWIW I (and others here at Zope Corp) build it just fine on gcc 4 with a non-system Python. Gary From brad.allen at omsdal.com Wed Jul 13 17:41:12 2005 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Wed, 13 Jul 2005 10:41:12 -0500 Subject: [Pythonmac-SIG] Zope.Interface won't build on 10.4 In-Reply-To: <3f085ecd05071306554436eda7@mail.gmail.com> Message-ID: Kevin Dangoor wrote on 07/13/2005 08:55:47 AM: > I encountered this as well. I *think* something needs to change within > zope.interface to work with gcc 4.x. Anyhow, all you need to do is: > > sudo gcc_select 3.3 Thanks! That worked. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050713/127fe3a5/attachment.htm From bob at redivi.com Wed Jul 13 19:10:54 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 13 Jul 2005 07:10:54 -1000 Subject: [Pythonmac-SIG] Zope.Interface won't build on 10.4 In-Reply-To: References: <3f085ecd05071306554436eda7@mail.gmail.com> Message-ID: <95414FA7-85B6-4C49-9E39-64B0A1A4D681@redivi.com> On Jul 13, 2005, at 4:00 AM, Gary Poster wrote: > > On Jul 13, 2005, at 9:55 AM, Kevin Dangoor wrote: > > >> I encountered this as well. I *think* something needs to change >> within >> zope.interface to work with gcc 4.x. Anyhow, all you need to do is: >> >> sudo gcc_select 3.3 >> >> Kevin >> > > And FWIW I (and others here at Zope Corp) build it just fine on gcc 4 > with a non-system Python. You're clearly not using 3.0.1, then, because GCC 4 is rejecting code that's in Zope.Interface.. it has nothing to do with the Python being used. The easiest way to install Zope.Interface is just to get the ones that I built on 10.3: http://pythonmac.org/packages/ -bob From gary at modernsongs.com Wed Jul 13 19:21:19 2005 From: gary at modernsongs.com (Gary Poster) Date: Wed, 13 Jul 2005 13:21:19 -0400 Subject: [Pythonmac-SIG] Zope.Interface won't build on 10.4 In-Reply-To: <95414FA7-85B6-4C49-9E39-64B0A1A4D681@redivi.com> References: <3f085ecd05071306554436eda7@mail.gmail.com> <95414FA7-85B6-4C49-9E39-64B0A1A4D681@redivi.com> Message-ID: On Jul 13, 2005, at 1:10 PM, Bob Ippolito wrote: > > On Jul 13, 2005, at 4:00 AM, Gary Poster wrote: > > >> >> On Jul 13, 2005, at 9:55 AM, Kevin Dangoor wrote: >> >> >> >>> I encountered this as well. I *think* something needs to change >>> within >>> zope.interface to work with gcc 4.x. Anyhow, all you need to do is: >>> >>> sudo gcc_select 3.3 >>> >>> Kevin >>> >>> >> >> And FWIW I (and others here at Zope Corp) build it just fine on gcc 4 >> with a non-system Python. >> > > You're clearly not using 3.0.1, then, because GCC 4 is rejecting > code that's in Zope.Interface.. it has nothing to do with the > Python being used. Ah; good point. Sorry, yes, we're on the head (and/or Zope 3.1 beta). Gary From gabor at nekomancer.net Wed Jul 13 23:49:01 2005 From: gabor at nekomancer.net (=?ISO-8859-1?Q?G=E1bor_Farkas?=) Date: Wed, 13 Jul 2005 23:49:01 +0200 Subject: [Pythonmac-SIG] appscript + iPhoto problem In-Reply-To: References: <42D445CD.8010009@nekomancer.net> <42D4DBFD.4000901@nekomancer.net> Message-ID: <42D58C4D.1020800@nekomancer.net> has wrote: > G?bor Farkas wrote: > > > In general, new elements are created using the 'make' command, so try something like: > > iphoto = appscript.app('iPhoto') > iphoto.photos[1].keywords.end.make(new=k.keyword, with_properties={k.name: 'some name'}) > well, i want to set an already existing keyword, so i did this: iphoto = appscript.app('iPhoto') k = iphoto.keywords.get()[-1] p = iphoto.photos.get()[0] p.keywords.end.set(k) this simply waits, and never ends. when i end it with ctrl+c, i get: ^CTraceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/appscript/specifier.py", line 203, in __call__ raise CommandError(self, (args, kargs), e) appscript.specifier.CommandError: (-1711, 'in AESend, the user cancelled out of wait loop for reply or receipt') Failed command: app(u'/Applications/iPhoto.app').photos.ID(4294967325L).keywords.end.set(app(u'/Applications/iPhoto.app').keywords[u'girl']) > Can't test that here since I accidentally trashed my copy of iPhoto 2 on my last system reinstall and refuse to pony up $50 for iLife just to replace it. But I reckon it should be close. If not, post back. > hmmm if you got the iPhoto with your computer, then it should be on some of the install cds/dvds..shouldn't it? gabor From matsakis at mit.edu Thu Jul 14 06:05:10 2005 From: matsakis at mit.edu (Nick Matsakis) Date: Thu, 14 Jul 2005 00:05:10 -0400 (EDT) Subject: [Pythonmac-SIG] Unicode Filenames on the Mac Message-ID: What is the best way to deal with non-ASCII paths when working with the python standard library? Specifically, when using functions like open() and the os and glob modules, what should be passed in? What should I expect out? In experimenting with it, it appears that these libraries accept str objects containing UTF-8 encoded bytes and similarly that is what they return. It would seem better to me if they could be made to accept and return unicode objects, but I could see that that might cause backwards compatibility problems. Still, is UTF-8 encoded strs really a safe bet? Are there circumstances, including non HFS filesystems, where it will bite me if I make this assumption? Nick From bob at redivi.com Thu Jul 14 06:24:03 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 13 Jul 2005 18:24:03 -1000 Subject: [Pythonmac-SIG] Unicode Filenames on the Mac In-Reply-To: References: Message-ID: <8D4A36AF-CCFE-4C16-B1DE-6CB309D9F675@redivi.com> On Jul 13, 2005, at 6:05 PM, Nick Matsakis wrote: > > What is the best way to deal with non-ASCII paths when working with > the > python standard library? Specifically, when using functions like > open() > and the os and glob modules, what should be passed in? What should I > expect out? If you pass unicode in, you get unicode out: >>> import os >>> set(map(type, os.listdir('.'))) set([]) >>> set(map(type, os.listdir(u'.'))) set([]) Otherwise you pass and receive byte strings. The encoding of those byte strings is fixed: >>> import sys >>> sys.getfilesystemencoding() 'utf-8' > In experimenting with it, it appears that these libraries accept str > objects containing UTF-8 encoded bytes and similarly that is what they > return. It would seem better to me if they could be made to accept > and > return unicode objects, but I could see that that might cause > backwards > compatibility problems. Still, is UTF-8 encoded strs really a safe > bet? > Are there circumstances, including non HFS filesystems, where it > will bite > me if I make this assumption? HFS actually uses UTF-16 internally, but the POSIX layer is UTF-8. It will bite you if you expect the code to work on other platforms. Not all platforms use UTF-8 for their filesystem encoding. -bob From delza at livingcode.org Thu Jul 14 07:01:33 2005 From: delza at livingcode.org (Dethe Elza) Date: Wed, 13 Jul 2005 22:01:33 -0700 Subject: [Pythonmac-SIG] PySight Message-ID: Hi folks, I'm looking for advice about packaging a library. Jonathan Wight of Toxic Software has built a simple framework around SequenceGrabber to expose it to Cocoa. I've made a trivial PyObjC wrapper and tested it sucessfully with Python. I'd like to build a disk image that contains a) an installer for the framework + wrapper, b) sample apps (Cocoa and Python versions of the same program), and c) the source code to all of these. Does this sound like a good idea, or should I separate it out into multiple .dmg files? Finally, I haven't really used the bdist_mpkg command to build an installer (except for running it on the PyObjC trunk periodically). All I'm installing is a framework and an __init__.py file. Is bdist_mpkg the way to go? TIA --Dethe From matsakis at mit.edu Thu Jul 14 21:17:37 2005 From: matsakis at mit.edu (Nick Matsakis) Date: Thu, 14 Jul 2005 15:17:37 -0400 (EDT) Subject: [Pythonmac-SIG] Unicode Filenames on the Mac In-Reply-To: <8D4A36AF-CCFE-4C16-B1DE-6CB309D9F675@redivi.com> References: <8D4A36AF-CCFE-4C16-B1DE-6CB309D9F675@redivi.com> Message-ID: On Wed, 13 Jul 2005, Bob Ippolito wrote: > HFS actually uses UTF-16 internally, but the POSIX layer is UTF-8. > It will bite you if you expect the code to work on other platforms. > Not all platforms use UTF-8 for their filesystem encoding. I don't care about other platforms, but I assume from your message that sending 'unicode' strings to system modules is safe (and a best practice too?). Nick From bob at redivi.com Thu Jul 14 21:39:59 2005 From: bob at redivi.com (Bob Ippolito) Date: Thu, 14 Jul 2005 09:39:59 -1000 Subject: [Pythonmac-SIG] Unicode Filenames on the Mac In-Reply-To: References: <8D4A36AF-CCFE-4C16-B1DE-6CB309D9F675@redivi.com> Message-ID: <4D5E748E-E8A2-429A-A08E-87561F633084@redivi.com> On Jul 14, 2005, at 9:17 AM, Nick Matsakis wrote: > > On Wed, 13 Jul 2005, Bob Ippolito wrote: > > >> HFS actually uses UTF-16 internally, but the POSIX layer is UTF-8. >> It will bite you if you expect the code to work on other platforms. >> Not all platforms use UTF-8 for their filesystem encoding. >> > > I don't care about other platforms, but I assume from your message > that > sending 'unicode' strings to system modules is safe (and a best > practice > too?). yes -bob From njriley at uiuc.edu Fri Jul 15 08:20:58 2005 From: njriley at uiuc.edu (Nicholas Riley) Date: Fri, 15 Jul 2005 01:20:58 -0500 Subject: [Pythonmac-SIG] appscript help - supposed to work? Message-ID: <20050715062058.GA32024@uiuc.edu> I just installed the appscript 0.13.0 and its multitude of dependencies, and tried to get docs on Preview's scripting support; I was rewarded with the following: >>> from appscript import * >>> p = app('Preview') >>> help(p) Traceback (most recent call last): File "", line 1, in ? File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site.py", line 308, in __call__ return pydoc.help(*args, **kwds) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/pydoc.py", line 1547, in __call__ self.help(request) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/pydoc.py", line 1583, in help else: doc(request, 'Help on %s:') File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/pydoc.py", line 1368, in doc object, name = resolve(thing, forceload) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/pydoc.py", line 1363, in resolve return thing, getattr(thing, '__name__', None) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/appscript/specifier.py", line 257, in __getattr__ raise RuntimeError, "Unknown property, element or command: %r" % name RuntimeError: Unknown property, element or command: '__name__' I seem to remember this used to work... I tried with a couple of other apps too; same problem. -- Nicholas Riley | From njriley at uiuc.edu Fri Jul 15 08:23:45 2005 From: njriley at uiuc.edu (Nicholas Riley) Date: Fri, 15 Jul 2005 01:23:45 -0500 Subject: [Pythonmac-SIG] appscript help - supposed to work? In-Reply-To: <20050715062058.GA32024@uiuc.edu> References: <20050715062058.GA32024@uiuc.edu> Message-ID: <20050715062345.GB32024@uiuc.edu> On Fri, Jul 15, 2005 at 01:20:58AM -0500, Nicholas Riley wrote: > I seem to remember this used to work... I tried with a couple of > other apps too; same problem. And five seconds after sending that, I realize you're supposed to use foo.help() instead. It would be nice if help() didn't barf quite as badly though. -- Nicholas Riley | From arye at bibliocast.fr Fri Jul 15 15:51:08 2005 From: arye at bibliocast.fr (Arye HALIOUA) Date: Fri, 15 Jul 2005 15:51:08 +0200 Subject: [Pythonmac-SIG] py2app with vtk Message-ID: <008a01c58944$415fb560$f30101c0@dev03> Hello list, I am a new Mac user trying to use py2app so please bear with me. I use py2app version 0.2 on MacOS 10.3.9. When I feed py2app a python program of a simple wxpython GUI, all works just great! I can run the app, copy it into an other mac and run it as well. However when try to turn into an app, a python script that imports vtk modules and try to run it: * nothing happens on the Mac used to create the app * on a different Mac, into which I simply copied the app, I have an error message saying "cannot open library". It seems that the app is trying to fetch the libraries using the path into which they are installed on the Mac I used to create the app instead of from the bundle (in the Frameworks directory). Any expanation on what I am doing wrong would be greatly appreciated. I would grealy appreciate also any tips on how to turn an app into a proper Mac install program (with a dmg extension). Good day, Arye. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050715/6d108842/attachment.htm From hengist.podd at virgin.net Fri Jul 15 12:48:20 2005 From: hengist.podd at virgin.net (has) Date: Fri, 15 Jul 2005 11:48:20 +0100 Subject: [Pythonmac-SIG] appscript help - supposed to work? In-Reply-To: <20050715062345.GB32024@uiuc.edu> References: <20050715062058.GA32024@uiuc.edu> <20050715062345.GB32024@uiuc.edu> Message-ID: Nicholas Riley wrote: > > I seem to remember this used to work... I tried with a couple of >> other apps too; same problem. > >And five seconds after sending that, I realize you're supposed to use >foo.help() instead. It would be nice if help() didn't barf quite as >badly though. Yep. Though I dunno if there's much can be done beyond squelching the pydoc-triggered error message. I'll patch this in the next release, though I don't think it really helps since you still won't get any help info from it. Pydoc makes assumptions about an object's structure that don't work very well on 'magic' objects like appscript's. Only solution I can think of would be to put in a feature request for a new magic method, __help__, that objects could optionally implement when they want to supply pydoc with their own choice of help data instead of it scraping this info itself. has -- http://freespace.virgin.net/hamish.sanderson/ From piet at cs.uu.nl Fri Jul 15 19:30:36 2005 From: piet at cs.uu.nl (Piet van Oostrum) Date: Fri, 15 Jul 2005 19:30:36 +0200 Subject: [Pythonmac-SIG] Unicode Filenames on the Mac In-Reply-To: <8D4A36AF-CCFE-4C16-B1DE-6CB309D9F675@redivi.com> (Bob Ippolito's message of "Wed, 13 Jul 2005 18:24:03 -1000") References: <8D4A36AF-CCFE-4C16-B1DE-6CB309D9F675@redivi.com> Message-ID: >>>>> Bob Ippolito (BI) wrote: >>>>> import sys >>>>> sys.getfilesystemencoding() >BI> 'utf-8' It is UTF-8, but you must be careful: the filenames are in normalized (or whatever they call it) UTF-8, meaning that accented letters are split up into the letter followed by the accent. The filename API does accept the composed accented letters, but normalizes them, and that is what the listdir calls return. >>> fn = u'\u00E1' >>> f = open(fn,'w') >>> f.close() We now have a file with name '?' >>> import os >>> os.listdir (u'.') [u'a\u0301'] The accent follows the 'a'. -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4] Private email: piet at vanoostrum.org From ckd at ckdhr.com Tue Jul 19 01:48:43 2005 From: ckd at ckdhr.com (Christopher K. Davis) Date: Mon, 18 Jul 2005 19:48:43 -0400 Subject: [Pythonmac-SIG] QuickTime, Mac/Modules/qt/qtsupport.py, and ComponentInstance Message-ID: <2147483647.1121716123@barrayar.ckdhr.com> I'm trying to use the QuickTime support in 2.4.1, by way of Bob Ippolito's "official unofficial" framework build installer, on Mac OS X 10.4.2 (Tiger). However, in trying even the simplest of GraphicsImport manipulations, I hit a TypeError: from Carbon.Qt import * fn = "/tmp/testpic.jpg" ci = GetGraphicsImporterForFile(fn) pic = GraphicsImportGetAsPicture(ci) results in: Traceback (most recent call last): File "pyqt2.py", line 6, in ? pic = GraphicsImportGetAsPicture(ci) TypeError: Component required Looking at the documentation[1] for the routine, it expects a GraphicsImportComponent. Looking at the Component Types document[2], that's typedef'ed as a ComponentInstance. However, Mac/Modules/qt/qtsupport.py in 2.4.1 says: GraphicsImportComponent = OpaqueByValueType('GraphicsImportComponent', 'CmpObj') This defines it as a Component, rather than a ComponentInstance (CmpInstObj). Several other types have the same problem. [1] http://developer.apple.com/documentation/QuickTime/APIREF/graphicsimportget aspicture.htm [2] http://developer.apple.com/documentation/QuickTime/APIREF/ComponentTypes.htm From pecora at anvil.nrl.navy.mil Tue Jul 19 15:36:42 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Tue, 19 Jul 2005 09:36:42 -0400 Subject: [Pythonmac-SIG] 'import site' failed. Trouble starting python. What does this mean? Message-ID: <42DD01EA.202@anvil.nrl.navy.mil> I've been having trouble running Python from BBEdit and the MacPython IDE (neither works) so I tried to start from the terminal. I get this message: louispec% python -v # installing zipimport hook import zipimport # builtin # installed zipimport hook 'import site' failed; traceback: ImportError: No module named site Python 2.3 (#1, Sep 13 2003, 00:49:11) [GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> If I type "help", I get: >>> help Traceback (most recent call last): File "", line 1, in ? NameError: name 'help' is not defined What's going on? Anyone know? Right now I'm Pythonless. Any info appreciated. Running on a G4 Al PB (1.25 GHz), OS X 10.3.8. Panther Add ons installed. WxPython installed. Matplotlib installed. Using Apple's Python AFAIK. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From dangoor at gmail.com Tue Jul 19 16:56:02 2005 From: dangoor at gmail.com (Kevin Dangoor) Date: Tue, 19 Jul 2005 10:56:02 -0400 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility Message-ID: <3f085ecd050719075639cc4dd9@mail.gmail.com> I have been packaging up some of my python packages in eggs: http://peak.telecommunity.com/DevCenter/PythonEggs Basically, an egg has everything you need to use a package, ready-to-run... including binary versions of extensions. It's a nice format because it enables people to just run an "easy_install" program to get a package, no compiler required. (Which is a bigger win on Windows, to be sure, but even on the Mac it means that casual scripters wouldn't need to install Developer Tools). The way eggs are created right now generates a package name that looks something like this: [PackageName]-[Version]-py[PythonVersion]-darwin-8.2.0-Power_Macintosh.egg As coded currently, updating from Mac OS 10.4.1 to 10.4.2 (which bumped the Darwin version from 8.1.0 to 8.2.0), means that any eggs compiled under 10.4.1 won't work any more under 10.4.2, because setuptools is checking the full platform to see if it matches. That's more than a little aggressive, compatibility-wise. We can redefine for Mac OS what an appropriate platform string would be and what the compatibility rules are. That's where I need some help, because I don't know for certain what the compatibility rules are. From reading this list for the past several months, I have an idea: 1) an extension built for Python 2.4 on 10.3 should work under 10.4 2) an extension built for Python 2.4 on 10.4 might work on 10.3, but don't count on it. Would it then make sense for setuptools to do something like this: - declare the platform as it does now (eg, darwin-8.2.0) - specify that an egg is compatible if it's major version (8) is <= your machine's major version. Are there other compatibility gotchas or would that do the trick? Kevin From ronaldoussoren at mac.com Tue Jul 19 22:14:23 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 19 Jul 2005 22:14:23 +0200 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility In-Reply-To: <3f085ecd050719075639cc4dd9@mail.gmail.com> References: <3f085ecd050719075639cc4dd9@mail.gmail.com> Message-ID: <3BF0BA83-9494-42F4-85D0-E7ECFCDE50CD@mac.com> On 19-jul-2005, at 16:56, Kevin Dangoor wrote: > > That's where I need some help, because I don't know for certain what > the compatibility rules are. From reading this list for the past > several months, I have an idea: > > 1) an extension built for Python 2.4 on 10.3 should work under 10.4 > 2) an extension built for Python 2.4 on 10.4 might work on 10.3, but > don't count on it. > > Would it then make sense for setuptools to do something like this: > > - declare the platform as it does now (eg, darwin-8.2.0) > - specify that an egg is compatible if it's major version (8) is <= > your machine's major version. > > Are there other compatibility gotchas or would that do the trick? The kernel release (e.g. 8.2.0) isn't very interesting. Luckily the kernel version increases in sync with the OS version at the moment, which means your suggestion works just fine in practice. I wouldn't worry about the semantic difference between kernel versions and OS releases at the moment. To make live even more interesting, that may change in the future :-). The developer tools have an SDK feature, this makes it possible to build software on 10.4 that will run reliably on an earlier version of the OS. Python's build system currently doesn't support this (aka "autoconf sucks"), but that will probably change in the future. Ronald From bob at redivi.com Tue Jul 19 23:45:35 2005 From: bob at redivi.com (Bob Ippolito) Date: Tue, 19 Jul 2005 11:45:35 -1000 Subject: [Pythonmac-SIG] 'import site' failed. Trouble starting python. What does this mean? In-Reply-To: <42DD01EA.202@anvil.nrl.navy.mil> References: <42DD01EA.202@anvil.nrl.navy.mil> Message-ID: <14CF438D-76F7-4198-BD43-417DADB89693@redivi.com> On Jul 19, 2005, at 3:36 AM, Louis Pecora wrote: > I've been having trouble running Python from BBEdit and the MacPython > IDE (neither works) so I tried to start from the terminal. I get this > message: > > louispec% python -v > # installing zipimport hook > import zipimport # builtin > # installed zipimport hook > 'import site' failed; traceback: That's no good. Have you been screwing with environment variables? PYTHONPATH, etc.? Did the files get deleted from /System/Library/Frameworks/ Python.framework/Versions/2.3/lib/python2.3 ? Or were the permissions mangled? -bob From bob at redivi.com Tue Jul 19 23:51:56 2005 From: bob at redivi.com (Bob Ippolito) Date: Tue, 19 Jul 2005 11:51:56 -1000 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility In-Reply-To: <3f085ecd050719075639cc4dd9@mail.gmail.com> References: <3f085ecd050719075639cc4dd9@mail.gmail.com> Message-ID: <55201167-4CE6-4EAC-BF87-2CDE65AAC95C@redivi.com> On Jul 19, 2005, at 4:56 AM, Kevin Dangoor wrote: > I have been packaging up some of my python packages in eggs: > http://peak.telecommunity.com/DevCenter/PythonEggs > > Basically, an egg has everything you need to use a package, > ready-to-run... including binary versions of extensions. It's a nice > format because it enables people to just run an "easy_install" program > to get a package, no compiler required. (Which is a bigger win on > Windows, to be sure, but even on the Mac it means that casual > scripters wouldn't need to install Developer Tools). > > The way eggs are created right now generates a package name that looks > something like this: > > [PackageName]-[Version]-py[PythonVersion]-darwin-8.2.0- > Power_Macintosh.egg > > As coded currently, updating from Mac OS 10.4.1 to 10.4.2 (which > bumped the Darwin version from 8.1.0 to 8.2.0), means that any eggs > compiled under 10.4.1 won't work any more under 10.4.2, because > setuptools is checking the full platform to see if it matches. > > That's more than a little aggressive, compatibility-wise. We can > redefine for Mac OS what an appropriate platform string would be and > what the compatibility rules are. Pick out the sw_vers function from here: http://svn.red-bean.com/bob/py2app/trunk/src/bdist_mpkg/tools.py Use that instead of the uname (darwin-8.2.0-Power_Macintosh). e.g. 'macosx-' + '.'.join(map(str, sw_vers().version[:2])) Then contribute it to setuptools so it gets used in bdist_egg (or distutils, really). -bob From pecora at anvil.nrl.navy.mil Wed Jul 20 01:33:20 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Tue, 19 Jul 2005 19:33:20 -0400 Subject: [Pythonmac-SIG] 'import site' failed. Trouble starting python. What does this mean? In-Reply-To: <14CF438D-76F7-4198-BD43-417DADB89693@redivi.com> References: <42DD01EA.202@anvil.nrl.navy.mil> <14CF438D-76F7-4198-BD43-417DADB89693@redivi.com> Message-ID: <42DD8DC0.3030806@anvil.nrl.navy.mil> Bob Ippolito wrote: >On Jul 19, 2005, at 3:36 AM, Louis Pecora wrote: > > > >>I've been having trouble running Python from BBEdit and the MacPython >>IDE (neither works) so I tried to start from the terminal. I get this >>message: >> >>louispec% python -v >># installing zipimport hook >>import zipimport # builtin >># installed zipimport hook >>'import site' failed; traceback: >> >> > >That's no good. Have you been screwing with environment variables? >PYTHONPATH, etc.? > > Yeah, I know I have trouble. I haven't messed with any variables. The whole thing worked fine, then after a trip to a conference where I barely used the computer, Python was dead. Disk First Aid repaired some of the directory (I think that's what it does) involving some Python Frameworks, but then ground to a halt with a cryptic message that it couldn't fix whatever it is that broken. I have ordered DiskWarrior and will try that. I suspect something is broken in the directory. But then I'm not an expert, maybe it's something in Python. >Did the files get deleted from /System/Library/Frameworks/ >Python.framework/Versions/2.3/lib/python2.3 ? Or were the >permissions mangled? > Not that I know of, but down in the directory you mention just above I have the following files shown below (sorry for the long list). I notice that no files with names beginning with a letter past 'p' are there. I'm not sure what's supposed to be there, but this looks suspicious. Opinions? Files in /System/Library ... lib/python2.3: __future__.py __future__.pyc __future__.pyo __phello__.foo.py __phello__.foo.pyc __phello__.foo.pyo _strptime.py _strptime.pyc _strptime.pyo aifc.py aifc.pyc aifc.pyo anydbm.py anydbm.pyc anydbm.pyo asynchat.py asynchat.pyc asynchat.pyo asyncore.py asyncore.pyc asyncore.pyo atexit.py atexit.pyc atexit.pyo audiodev.py audiodev.pyc audiodev.pyo base64.py base64.pyc base64.pyo BaseHTTPServer.py BaseHTTPServer.pyc BaseHTTPServer.pyo Bastion.py Bastion.pyc Bastion.pyo bdb.py bdb.pyc bdb.pyo binhex.py binhex.pyc binhex.pyo bisect.py bisect.pyc bisect.pyo bsddb calendar.py calendar.pyc calendar.pyo cgi.py cgi.pyc cgi.pyo CGIHTTPServer.py CGIHTTPServer.pyc CGIHTTPServer.pyo cgitb.py cgitb.pyc cgitb.pyo chunk.py chunk.pyc chunk.pyo cmd.py cmd.pyc cmd.pyo code.py code.pyc code.pyo codecs.py codecs.pyc codecs.pyo codeop.py codeop.pyc codeop.pyo colorsys.py colorsys.pyc colorsys.pyo commands.py commands.pyc commands.pyo compileall.py compileall.pyc compileall.pyo compiler config ConfigParser.py ConfigParser.pyc ConfigParser.pyo Cookie.py Cookie.pyc Cookie.pyo copy_reg.py copy_reg.pyc copy_reg.pyo copy.py copy.pyc copy.pyo csv.py csv.pyc csv.pyo curses dbhash.py dbhash.pyc dbhash.pyo difflib.py difflib.pyc difflib.pyo dircache.py dircache.pyc dircache.pyo dis.py dis.pyc dis.pyo distutils doctest.py doctest.pyc doctest.pyo DocXMLRPCServer.py DocXMLRPCServer.pyc DocXMLRPCServer.pyo dumbdbm.py dumbdbm.pyc dumbdbm.pyo dummy_thread.py dummy_thread.pyc dummy_thread.pyo dummy_threading.py dummy_threading.pyc dummy_threading.pyo email encodings FCNTL.py FCNTL.pyc FCNTL.pyo filecmp.py filecmp.pyc filecmp.pyo fileinput.py fileinput.pyc fileinput.pyo fnmatch.py fnmatch.pyc fnmatch.pyo formatter.py formatter.pyc formatter.pyo fpformat.py fpformat.pyc fpformat.pyo ftplib.py ftplib.pyc ftplib.pyo getopt.py getopt.pyc getopt.pyo getpass.py getpass.pyc getpass.pyo gettext.py gettext.pyc gettext.pyo glob.py glob.pyc glob.pyo gopherlib.py gopherlib.pyc gopherlib.pyo gzip.py gzip.pyc gzip.pyo heapq.py heapq.pyc heapq.pyo hmac.py hmac.pyc hmac.pyo hotshot htmlentitydefs.py htmlentitydefs.pyc htmlentitydefs.pyo htmllib.py htmllib.pyc htmllib.pyo HTMLParser.py HTMLParser.pyc HTMLParser.pyo httplib.py httplib.pyc httplib.pyo idlelib ihooks.py ihooks.pyc ihooks.pyo imaplib.py imaplib.pyc imaplib.pyo imghdr.py imghdr.pyc imghdr.pyo imputil.py imputil.pyc imputil.pyo inspect.py inspect.pyc inspect.pyo keyword.py keyword.pyc keyword.pyo lib-dynload lib-old lib-tk LICENSE.txt linecache.py linecache.pyc linecache.pyo locale.py locale.pyc locale.pyo logging macpath.py macpath.pyc macpath.pyo macurl2path.py macurl2path.pyc macurl2path.pyo mailbox.py mailbox.pyc mailbox.pyo mailcap.py mailcap.pyc mailcap.pyo markupbase.py markupbase.pyc markupbase.pyo mhlib.py mhlib.pyc mhlib.pyo mimetools.py mimetools.pyc mimetools.pyo mimetypes.py mimetypes.pyc mimetypes.pyo MimeWriter.py MimeWriter.pyc MimeWriter.pyo mimify.py mimify.pyc mimify.pyo modulefinder.py modulefinder.pyc modulefinder.pyo multifile.py multifile.pyc multifile.pyo mutex.py mutex.pyc mutex.pyo netrc.py netrc.pyc netrc.pyo new.py new.pyc new.pyo nntplib.py nntplib.pyc nntplib.pyo ntpath.py ntpath.pyc ntpath.pyo nturl2path.py nturl2path.pyc nturl2path.pyo opcode.py opcode.pyc opcode.pyo optparse.py optparse.pyc optparse.pyo os.py os.pyc os.pyo os2emxpath.py os2emxpath.pyc os2emxpath.pyo pdb.doc pdb.py pdb.pyc pdb.pyo pickle.py pickle.pyc pickle.pyo pickletools.py pickletools.pyc pickletools.pyo pipes.py pipes.pyc pipes.pyo pkgutil.py pkgutil.pyc pkgutil.pyo Nothing beyond this. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From bob at redivi.com Wed Jul 20 01:48:21 2005 From: bob at redivi.com (Bob Ippolito) Date: Tue, 19 Jul 2005 13:48:21 -1000 Subject: [Pythonmac-SIG] 'import site' failed. Trouble starting python. What does this mean? In-Reply-To: <42DD8DC0.3030806@anvil.nrl.navy.mil> References: <42DD01EA.202@anvil.nrl.navy.mil> <14CF438D-76F7-4198-BD43-417DADB89693@redivi.com> <42DD8DC0.3030806@anvil.nrl.navy.mil> Message-ID: <2B56B677-AD0B-4687-B80B-92412E4C41A6@redivi.com> On Jul 19, 2005, at 1:33 PM, Louis Pecora wrote: > Bob Ippolito wrote: > > >> On Jul 19, 2005, at 3:36 AM, Louis Pecora wrote: >> >> >> >> >>> I've been having trouble running Python from BBEdit and the >>> MacPython >>> IDE (neither works) so I tried to start from the terminal. I get >>> this >>> message: >>> >>> louispec% python -v >>> # installing zipimport hook >>> import zipimport # builtin >>> # installed zipimport hook >>> 'import site' failed; traceback: >>> >>> >>> >> >> That's no good. Have you been screwing with environment variables? >> PYTHONPATH, etc.? >> >> >> > Yeah, I know I have trouble. I haven't messed with any variables. > The > whole thing worked fine, then after a trip to a conference where I > barely used the computer, Python was dead. > > Disk First Aid repaired some of the directory (I think that's what it > does) involving some Python Frameworks, but then ground to a halt > with a > cryptic message that it couldn't fix whatever it is that broken. > > I have ordered DiskWarrior and will try that. I suspect something is > broken in the directory. But then I'm not an expert, maybe it's > something in Python. > > >> Did the files get deleted from /System/Library/Frameworks/ >> Python.framework/Versions/2.3/lib/python2.3 ? Or were the >> permissions mangled? >> >> > Not that I know of, but down in the directory you mention just > above I have the following files shown below (sorry for the long > list). I notice that no files with names beginning with a letter > past 'p' are there. I'm not sure what's supposed to be there, but > this looks suspicious. > > Opinions? > > Files in /System/Library ... lib/python2.3: That list is incomplete, files are missing. Reinstall Mac OS X or upgrade to 10.4. -bob From woklist at charter.net Wed Jul 20 05:38:41 2005 From: woklist at charter.net (William K) Date: Tue, 19 Jul 2005 22:38:41 -0500 Subject: [Pythonmac-SIG] not "MacPython" - right place? Message-ID: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> I'm not sure if this is the place - browsing the list shows everyone talking about MacPython or building their own. I'm just interested in figuring out something on Apple's included Python. Major Python newbie here (a couple Python books in the mail). When I do an install with no options, it installs in /System/ Library/... That doesn't sound like a good idea - /System should be for Apple stuff and the occassional kext. Is there a standard user- plugin folder for Python on Mac OS X (like /Library/Python)? And how would I specify that in a python setup.py install command? The distutils documentation didn't help - developer-oriented. for Mac OS 10.4. I remember trying something back in Panther, but I didn't have the time or need to pursue it very far. I installed a module somehow in / Library/Python and it's still there. ----- William Kyngesburye http://www.kyngchaos.com/ "I ache, therefore I am. Or in my case - I am, therefore I ache." - Marvin From bob at redivi.com Wed Jul 20 06:47:13 2005 From: bob at redivi.com (Bob Ippolito) Date: Tue, 19 Jul 2005 18:47:13 -1000 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> Message-ID: <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> On Jul 19, 2005, at 5:38 PM, William K wrote: > I'm not sure if this is the place - browsing the list shows everyone > talking about MacPython or building their own. I'm just interested > in figuring out something on Apple's included Python. Major Python > newbie here (a couple Python books in the mail). Apple's included Python is also considered MacPython. > When I do an install with no options, it installs in /System/ > Library/... That doesn't sound like a good idea - /System should be > for Apple stuff and the occassional kext. Is there a standard user- > plugin folder for Python on Mac OS X (like /Library/Python)? And how > would I specify that in a python setup.py install command? The > distutils documentation didn't help - developer-oriented. > > for Mac OS 10.4. > > I remember trying something back in Panther, but I didn't have the > time or need to pursue it very far. I installed a module somehow in / > Library/Python and it's still there. The path it's using is just a symlink to /Library/Python/2.3/site- packages/, so while it displays /System/... it's really not putting it there. Python code anyway, scripts it will put in that tree unless you pass options during the install. See python setup.py -- help install. -bob From steve at spvi.com Wed Jul 20 08:39:08 2005 From: steve at spvi.com (Steve Spicklemire) Date: Wed, 20 Jul 2005 01:39:08 -0500 Subject: [Pythonmac-SIG] Posting KeyDown events to NSResponder instances? In-Reply-To: <5A72D2F6-7498-4D92-B1E8-33C0F48FD7F3@spvi.com> References: <76564DFF-AF73-4C33-A944-E91D62191486@wilcoxd.com> <296F9697-D63B-437B-80B3-671E10E34B2C@livingcode.org> <71E3D47F-6305-4C16-9A38-B6B4A87D82ED@redivi.com> <3D4C8465-9613-4E93-B7B4-F12CB01C83A9@wilcoxd.com> <291A6FD9-C7C2-40A0-869C-75B1439701F9@redivi.com> <5A72D2F6-7498-4D92-B1E8-33C0F48FD7F3@spvi.com> Message-ID: Hi Folks, I'm guessing this is supposed to be easy.. but I've spend a good chunk of time searching for an approach, but none of the suggestions I've found is working for me. ;-( I need to 'manually' send a keyDown event (left arrow actually) to a QTMovieView instance. The movie view is in a window that's an objective-c subclass of NSWindow. The window controller is a pyObjC instance. Is there an easy way to do this? The NSEvent constructor for 'keyEvents' is a bit overwhelming, nonetheless.. I managed to get it working from my objective-c NSWindow subclass instance.. but no matter how I try to post the keyDown it never behaves the same as actually hitting the keyboard when the QTMovieView has focus. In fact.. it seems that when I call qtView.keyDown_(event) from the window controller the event is ignored by the qtView and passed on tp the window's keyDown:, but when I hit a real key... the even is 'swallowed' by the view and the window never sees it. There something about the responder chain I'm not getting here! Any thoughts are welcome. thanks, -steve From dangoor at gmail.com Wed Jul 20 14:36:08 2005 From: dangoor at gmail.com (Kevin Dangoor) Date: Wed, 20 Jul 2005 08:36:08 -0400 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility In-Reply-To: <55201167-4CE6-4EAC-BF87-2CDE65AAC95C@redivi.com> References: <3f085ecd050719075639cc4dd9@mail.gmail.com> <55201167-4CE6-4EAC-BF87-2CDE65AAC95C@redivi.com> Message-ID: <3f085ecd05072005367e4788b8@mail.gmail.com> On 7/19/05, Bob Ippolito wrote: > Pick out the sw_vers function from here: > http://svn.red-bean.com/bob/py2app/trunk/src/bdist_mpkg/tools.py That is more comforting than going with the Darwin version. I'll wrap that up for Phillip and send him a patch. Kevin From mike at maibaum.org Wed Jul 20 15:54:10 2005 From: mike at maibaum.org (Michael Maibaum) Date: Wed, 20 Jul 2005 14:54:10 +0100 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility In-Reply-To: <3f085ecd05072005367e4788b8@mail.gmail.com> References: <3f085ecd050719075639cc4dd9@mail.gmail.com> <55201167-4CE6-4EAC-BF87-2CDE65AAC95C@redivi.com> <3f085ecd05072005367e4788b8@mail.gmail.com> Message-ID: <37D6E73B-E510-4826-823A-8DBDA0F62679@maibaum.org> On 20 Jul 2005, at 13:36, Kevin Dangoor wrote: > On 7/19/05, Bob Ippolito wrote: > >> Pick out the sw_vers function from here: >> http://svn.red-bean.com/bob/py2app/trunk/src/bdist_mpkg/tools.py >> > > That is more comforting than going with the Darwin version. I'll wrap > that up for Phillip and send him a patch. Note that the 3 or 4 people in the world running (pure) Darwin systems will not have sw_vers as it is not part of Darwin. Michael From dangoor at gmail.com Wed Jul 20 16:33:29 2005 From: dangoor at gmail.com (Kevin Dangoor) Date: Wed, 20 Jul 2005 10:33:29 -0400 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility In-Reply-To: <37D6E73B-E510-4826-823A-8DBDA0F62679@maibaum.org> References: <3f085ecd050719075639cc4dd9@mail.gmail.com> <55201167-4CE6-4EAC-BF87-2CDE65AAC95C@redivi.com> <3f085ecd05072005367e4788b8@mail.gmail.com> <37D6E73B-E510-4826-823A-8DBDA0F62679@maibaum.org> Message-ID: <3f085ecd0507200733112c59b0@mail.gmail.com> On 7/20/05, Michael Maibaum wrote: > On 20 Jul 2005, at 13:36, Kevin Dangoor wrote: > > That is more comforting than going with the Darwin version. I'll wrap > > that up for Phillip and send him a patch. > > > Note that the 3 or 4 people in the world running (pure) Darwin > systems will not have sw_vers as it is not part of Darwin. Believe it or not, I actually thought of that as well. Don't worry, I have those handful of people covered as well... if sys.platform == "darwin": try: version = macosx_vers() machine = os.uname()[4].replace(" ", "_") return "macosx-%d.%d.%d-%s" % (int(version[0]), int(version[1]), int(version[2]), machine) except ValueError: # if someone is running a non-Mac darwin system, this will fall # through to the default implementation pass from distutils.util import get_platform return get_platform() On my machine, this returns: macosx-10.4.2-Power_Macintosh I thought it made sense to leave the Power_Macintosh in there because of the upcoming Intel switch. I don't want to think about "Universal Binary" eggs right now :) Kevin From ronaldoussoren at mac.com Wed Jul 20 19:10:28 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 20 Jul 2005 19:10:28 +0200 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility In-Reply-To: <3f085ecd0507200733112c59b0@mail.gmail.com> References: <3f085ecd050719075639cc4dd9@mail.gmail.com> <55201167-4CE6-4EAC-BF87-2CDE65AAC95C@redivi.com> <3f085ecd05072005367e4788b8@mail.gmail.com> <37D6E73B-E510-4826-823A-8DBDA0F62679@maibaum.org> <3f085ecd0507200733112c59b0@mail.gmail.com> Message-ID: <5FB31DCE-9E30-4473-A2CB-29F67EFF465C@mac.com> On 20-jul-2005, at 16:33, Kevin Dangoor wrote: > On 7/20/05, Michael Maibaum wrote: > >> On 20 Jul 2005, at 13:36, Kevin Dangoor wrote: >> >>> That is more comforting than going with the Darwin version. I'll >>> wrap >>> that up for Phillip and send him a patch. >>> >> >> >> Note that the 3 or 4 people in the world running (pure) Darwin >> systems will not have sw_vers as it is not part of Darwin. >> > > Believe it or not, I actually thought of that as well. Don't worry, I > have those handful of people covered as well... > > if sys.platform == "darwin": > try: > version = macosx_vers() > machine = os.uname()[4].replace(" ", "_") > return "macosx-%d.%d.%d-%s" % (int(version[0]), int > (version[1]), > int(version[2]), machine) > except ValueError: > # if someone is running a non-Mac darwin system, this > will fall > # through to the default implementation > pass > > from distutils.util import get_platform > return get_platform() > > On my machine, this returns: > macosx-10.4.2-Power_Macintosh You don't mention the implementation of macosx_vers, but instead of calling /usr/bin/sw_vers you could also use platform.mac_ver, something like: if sys.platform == "darwin": import platform ver = platform.mac_ver()[0] if ver != '': return "macosx-%s.%s-%s"%tuple(ver.split('.')[:2] + [ platform.machine().replace(' ', '_') ]) # fall through to the generic version This would return 'macosx-10.4-Power_Macintosh' on my system. Note that I explicitly drop the micro release number because OSX is binary compatible across all micro-releases in a release. > > I thought it made sense to leave the Power_Macintosh in there because > of the upcoming Intel switch. I don't want to think about "Universal > Binary" eggs right now :) "Universal Binary" eggs should be automatic once someone teaches distutils to build "Univeral Binary" extensions. Building such extensions is easy enough (there's a hack in PyObjC's setup.py to do so), nicely integrating that in distutils is harder. Ronald From dangoor at gmail.com Wed Jul 20 19:45:58 2005 From: dangoor at gmail.com (Kevin Dangoor) Date: Wed, 20 Jul 2005 13:45:58 -0400 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility In-Reply-To: <5FB31DCE-9E30-4473-A2CB-29F67EFF465C@mac.com> References: <3f085ecd050719075639cc4dd9@mail.gmail.com> <55201167-4CE6-4EAC-BF87-2CDE65AAC95C@redivi.com> <3f085ecd05072005367e4788b8@mail.gmail.com> <37D6E73B-E510-4826-823A-8DBDA0F62679@maibaum.org> <3f085ecd0507200733112c59b0@mail.gmail.com> <5FB31DCE-9E30-4473-A2CB-29F67EFF465C@mac.com> Message-ID: <3f085ecd050720104526b3cec9@mail.gmail.com> On 7/20/05, Ronald Oussoren wrote: > You don't mention the implementation of macosx_vers, but instead of > calling /usr/bin/sw_vers you could also use platform.mac_ver, > something like: Ahh, I didn't know about that. macosx_vers is basically the sw_vers function that Bob pointed to. > > if sys.platform == "darwin": > import platform > ver = platform.mac_ver()[0] > if ver != '': > return "macosx-%s.%s-%s"%tuple(ver.split('.')[:2] + > [ platform.machine().replace(' ', '_') ]) > # fall through to the generic version > > This would return 'macosx-10.4-Power_Macintosh' on my system. Note > that I explicitly drop the micro release number because OSX is binary > compatible across all micro-releases in a release. Yeah, maybe I should have dropped that as well. I included the micro release number in the egg name, but excluded it from compatibility computations. Now that I think about it, though, it would be better to just drop the micro release altogether. I noticed that mac_ver also returns "PowerPC" for the machine. Would it be better to use that than "Power_Macintosh"? > > I thought it made sense to leave the Power_Macintosh in there because > > of the upcoming Intel switch. I don't want to think about "Universal > > Binary" eggs right now :) > > "Universal Binary" eggs should be automatic once someone teaches > distutils to build "Univeral Binary" extensions. Building such > extensions is easy enough (there's a hack in PyObjC's setup.py to do > so), nicely integrating that in distutils is harder. Automatic universal eggs will be cool. Kevin From bob at redivi.com Wed Jul 20 20:00:28 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 20 Jul 2005 08:00:28 -1000 Subject: [Pythonmac-SIG] Python Eggs and Mac OS version compatibility In-Reply-To: <5FB31DCE-9E30-4473-A2CB-29F67EFF465C@mac.com> References: <3f085ecd050719075639cc4dd9@mail.gmail.com> <55201167-4CE6-4EAC-BF87-2CDE65AAC95C@redivi.com> <3f085ecd05072005367e4788b8@mail.gmail.com> <37D6E73B-E510-4826-823A-8DBDA0F62679@maibaum.org> <3f085ecd0507200733112c59b0@mail.gmail.com> <5FB31DCE-9E30-4473-A2CB-29F67EFF465C@mac.com> Message-ID: <44280BF4-6673-41EF-9F85-E16E43739E21@redivi.com> On Jul 20, 2005, at 7:10 AM, Ronald Oussoren wrote: > > On 20-jul-2005, at 16:33, Kevin Dangoor wrote: > > >> On 7/20/05, Michael Maibaum wrote: >> >> >>> On 20 Jul 2005, at 13:36, Kevin Dangoor wrote: >>> >>> >>>> That is more comforting than going with the Darwin version. I'll >>>> wrap >>>> that up for Phillip and send him a patch. >>>> >>>> >>> >>> >>> Note that the 3 or 4 people in the world running (pure) Darwin >>> systems will not have sw_vers as it is not part of Darwin. >>> >>> >> >> Believe it or not, I actually thought of that as well. Don't worry, I >> have those handful of people covered as well... >> >> if sys.platform == "darwin": >> try: >> version = macosx_vers() >> machine = os.uname()[4].replace(" ", "_") >> return "macosx-%d.%d.%d-%s" % (int(version[0]), int >> (version[1]), >> int(version[2]), machine) >> except ValueError: >> # if someone is running a non-Mac darwin system, this >> will fall >> # through to the default implementation >> pass >> >> from distutils.util import get_platform >> return get_platform() >> >> On my machine, this returns: >> macosx-10.4.2-Power_Macintosh >> > > You don't mention the implementation of macosx_vers, but instead of > calling /usr/bin/sw_vers you could also use platform.mac_ver, > something like: > > if sys.platform == "darwin": > import platform > ver = platform.mac_ver()[0] > if ver != '': > return "macosx-%s.%s-%s"%tuple(ver.split('.')[:2] + > [ platform.machine().replace(' ', '_') ]) > # fall through to the generic version > > This would return 'macosx-10.4-Power_Macintosh' on my system. Note > that I explicitly drop the micro release number because OSX is binary > compatible across all micro-releases in a release. IIRC platform.mac_ver() was broken for some versions of Python (2.3.0 maybe?), and doesn't work on Intel machines because it uses gestalt and there's that pesky four character code endian issue. Calling sw_vers works everywhere, and you only do it once (the function is "memoized") >> >> I thought it made sense to leave the Power_Macintosh in there because >> of the upcoming Intel switch. I don't want to think about "Universal >> Binary" eggs right now :) >> > > "Universal Binary" eggs should be automatic once someone teaches > distutils to build "Univeral Binary" extensions. Building such > extensions is easy enough (there's a hack in PyObjC's setup.py to do > so), nicely integrating that in distutils is harder. Yes and no. Depends on what you're compiling. It's probably better to use ppc and i386 as the mnemonics because "Power Macintosh" isn't what the toolchain understands (e.g. gcc, lipo, etc.), and you're not going to be able to ask uname "what's the arch name for the other architecture(s) that my computer isn't". -bob From woklist at charter.net Wed Jul 20 20:04:23 2005 From: woklist at charter.net (William K) Date: Wed, 20 Jul 2005 13:04:23 -0500 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> Message-ID: <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> I figured it out, partly. While the site-packages is linked to / Library/Python, headers are still put into the /System/Library Python framework. So I used --install-headers=/Library/Python/2.3/site- include. Is there a standard name for a site headers folder in / Library/Python? The problem is, there is no option in bdist to specify an install- headers location, at least not in the package I'm looking at (Numeric). On Jul 19, 2005, at 11:47 PM, Bob Ippolito wrote: > The path it's using is just a symlink to /Library/Python/2.3/site- > packages/, so while it displays /System/... it's really not putting > it there. Python code anyway, scripts it will put in that tree > unless you pass options during the install. See python setup.py -- > help install. > > -bob > ----- William Kyngesburye http://www.kyngchaos.com/ "History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history." - Hitchhiker's Guide to the Galaxy From rkern at ucsd.edu Wed Jul 20 20:16:58 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 20 Jul 2005 11:16:58 -0700 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> Message-ID: <42DE951A.9040108@ucsd.edu> William K wrote: > I figured it out, partly. While the site-packages is linked to / > Library/Python, headers are still put into the /System/Library Python > framework. So I used --install-headers=/Library/Python/2.3/site- > include. Is there a standard name for a site headers folder in / > Library/Python? > > The problem is, there is no option in bdist to specify an install- > headers location, at least not in the package I'm looking at (Numeric). Don't worry overmuch about it. If you installed the headers elsewhere, it would be difficult to tell packages which need those headers where to find them. If it does worry you so much, then install Python 2.4.1, which places its files in /Library/Frameworks/Python.framework and be done with it. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From Chris.Barker at noaa.gov Wed Jul 20 20:17:58 2005 From: Chris.Barker at noaa.gov (Chris Barker) Date: Wed, 20 Jul 2005 11:17:58 -0700 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> Message-ID: <42DE9556.9000907@noaa.gov> William K wrote: > The problem is, there is no option in bdist to specify an install- > headers location, at least not in the package I'm looking at (Numeric). unless you really want to do things yourself, the best bet is to first look and see if the package you need is at: www.pythonmac.org/packages There are Numeric packages there for a number of pythons. They are built to link against the LAPACK in vectlib, which may not happen correctly if you build it yourself. If you need a newer Numeric, then I guess you're back to building it yourself. Perhaps you could contribute a package to pythonmac.org is you do. -Chris From bob at redivi.com Wed Jul 20 20:24:07 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 20 Jul 2005 08:24:07 -1000 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> Message-ID: <3272A6CE-DDE0-4BEB-B9F0-757CD0BC9F5F@redivi.com> On Jul 20, 2005, at 8:04 AM, William K wrote: > I figured it out, partly. While the site-packages is linked to / > Library/Python, headers are still put into the /System/Library > Python framework. So I used --install-headers=/Library/Python/2.3/ > site-include. Is there a standard name for a site headers folder > in /Library/Python? > > The problem is, there is no option in bdist to specify an install- > headers location, at least not in the package I'm looking at > (Numeric). If you put the headers anywhere else, they're useless because nothing will find them. Take the purist hat off, or install a non-System distro of Python (e.g. Python 2.4.1). -bob From woklist at charter.net Wed Jul 20 21:35:58 2005 From: woklist at charter.net (William K) Date: Wed, 20 Jul 2005 14:35:58 -0500 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <3272A6CE-DDE0-4BEB-B9F0-757CD0BC9F5F@redivi.com> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> <3272A6CE-DDE0-4BEB-B9F0-757CD0BC9F5F@redivi.com> Message-ID: <45539151-925E-4BC4-BAF4-22FCDD1866ED@charter.net> >> I figured it out, partly. While the site-packages is linked to / >> Library/Python, headers are still put into the /System/Library >> Python framework. So I used --install-headers=/Library/Python/2.3/ >> site-include. Is there a standard name for a site headers folder >> in /Library/Python? >> >> The problem is, there is no option in bdist to specify an install- >> headers location, at least not in the package I'm looking at >> (Numeric). >> > > If you put the headers anywhere else, they're useless because > nothing will find them. Take the purist hat off, or install a non- > System distro of Python (e.g. Python 2.4.1). > Is that a Python thing, or a slipup by Apple in their distro of Python? That seems a bit limiting if you can put libraries/modules where you want, but force headers to be in one location to be usable (while still letting you install them anywhere). > > unless you really want to do things yourself, the best bet is to first > look and see if the package you need is at: > > www.pythonmac.org/packages No Numeric for Tiger. > If it does worry you so much, then install Python 2.4.1, which places > its files in /Library/Frameworks/Python.framework and be done with it. You mean MacPython, right? Is there a separate MacPython installer for Tiger? The one I found (from March) says it's for Panther, and I'm a bit cautious of installing something meant for Panther on Tiger. Are there any problems running that one on Tiger? ----- William Kyngesburye http://www.kyngchaos.com/ Earth: "Mostly harmless" - revised entry in the HitchHiker's Guide to the Galaxy From ronaldoussoren at mac.com Wed Jul 20 22:02:38 2005 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 20 Jul 2005 22:02:38 +0200 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <45539151-925E-4BC4-BAF4-22FCDD1866ED@charter.net> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> <3272A6CE-DDE0-4BEB-B9F0-757CD0BC9F5F@redivi.com> <45539151-925E-4BC4-BAF4-22FCDD1866ED@charter.net> Message-ID: <41CCA3B6-1019-4AE7-A57F-4527FB24054D@mac.com> On 20-jul-2005, at 21:35, William K wrote: > > >>> I figured it out, partly. While the site-packages is linked to / >>> Library/Python, headers are still put into the /System/Library >>> Python framework. So I used --install-headers=/Library/Python/2.3/ >>> site-include. Is there a standard name for a site headers folder >>> in /Library/Python? >>> >>> The problem is, there is no option in bdist to specify an install- >>> headers location, at least not in the package I'm looking at >>> (Numeric). >>> >>> >> >> If you put the headers anywhere else, they're useless because >> nothing will find them. Take the purist hat off, or install a non- >> System distro of Python (e.g. Python 2.4.1). >> >> > Is that a Python thing, or a slipup by Apple in their distro of > Python? That seems a bit limiting if you can put libraries/modules > where you want, but force headers to be in one location to be usable > (while still letting you install them anywhere). It's a python thing. Distutils (which is used to build extentions) knows only of 1 location for header files, which is basically is ``os.path.join(sys.prefix, 'include')``. Teaching distutils to do The Right Thing(TM) wouldn't be too hard, but does need someone who is willing to do the work, and is able to sell the solution to the python developers. > > >> >> unless you really want to do things yourself, the best bet is to >> first >> look and see if the package you need is at: >> >> www.pythonmac.org/packages >> > > No Numeric for Tiger. See below. > > >> If it does worry you so much, then install Python 2.4.1, which places >> its files in /Library/Frameworks/Python.framework and be done with >> it. >> > > You mean MacPython, right? Is there a separate MacPython installer > for Tiger? The one I found (from March) says it's for Panther, and > I'm a bit cautious of installing something meant for Panther on > Tiger. Are there any problems running that one on Tiger? You can use the same installer on Tiger. OS X is backward compatible, programs build on 10.3 will continue to run on 10.4. Furthermore python 2.4.1 doesn't contain code that could take advantage of the new APIs in Tiger, therefore rebuilding MacPython 2.4 for Tiger doesn't buy you a lot. Summary: go ahead an install MacPython 2.4 on Tiger :-) Ronald From bob at redivi.com Wed Jul 20 22:17:59 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 20 Jul 2005 10:17:59 -1000 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <45539151-925E-4BC4-BAF4-22FCDD1866ED@charter.net> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> <3272A6CE-DDE0-4BEB-B9F0-757CD0BC9F5F@redivi.com> <45539151-925E-4BC4-BAF4-22FCDD1866ED@charter.net> Message-ID: On Jul 20, 2005, at 9:35 AM, William K wrote: > > >>> I figured it out, partly. While the site-packages is linked to / >>> Library/Python, headers are still put into the /System/Library >>> Python framework. So I used --install-headers=/Library/Python/ >>> 2.3/site-include. Is there a standard name for a site headers >>> folder in /Library/Python? >>> >>> The problem is, there is no option in bdist to specify an install- >>> headers location, at least not in the package I'm looking at >>> (Numeric). >>> >>> >> >> If you put the headers anywhere else, they're useless because >> nothing will find them. Take the purist hat off, or install a non- >> System distro of Python (e.g. Python 2.4.1). >> >> > Is that a Python thing, or a slipup by Apple in their distro of > Python? That seems a bit limiting if you can put libraries/modules > where you want, but force headers to be in one location to be > usable (while still letting you install them anywhere). Both. You *could* put them somewhere else, I guess, but then you'd need to set up a distutils config file in your home dir and probably deal with some packages that still expect it to be in Python's include dir. It's just not worth the trouble. You should really be using Python 2.4.1 anyway. More features, less bugs, faster. >> unless you really want to do things yourself, the best bet is to >> first >> look and see if the package you need is at: >> >> www.pythonmac.org/packages >> > > No Numeric for Tiger. All the 10.3 packages work on 10.4, just not vice versa. >> If it does worry you so much, then install Python 2.4.1, which places >> its files in /Library/Frameworks/Python.framework and be done with >> it. >> > > You mean MacPython, right? Is there a separate MacPython installer > for Tiger? The one I found (from March) says it's for Panther, and > I'm a bit cautious of installing something meant for Panther on > Tiger. Are there any problems running that one on Tiger? You only have to worry about the other way around. Tiger things do not work on Panther. Forwards compatibility is no problem. -bob From rkern at ucsd.edu Wed Jul 20 22:42:49 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 20 Jul 2005 13:42:49 -0700 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <45539151-925E-4BC4-BAF4-22FCDD1866ED@charter.net> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> <3272A6CE-DDE0-4BEB-B9F0-757CD0BC9F5F@redivi.com> <45539151-925E-4BC4-BAF4-22FCDD1866ED@charter.net> Message-ID: <42DEB749.3010509@ucsd.edu> William K wrote: [Bob:] >>If you put the headers anywhere else, they're useless because >>nothing will find them. Take the purist hat off, or install a non- >>System distro of Python (e.g. Python 2.4.1). > > Is that a Python thing, or a slipup by Apple in their distro of > Python? That seems a bit limiting if you can put libraries/modules > where you want, but force headers to be in one location to be usable > (while still letting you install them anywhere). It's a Python thing mostly. [Chris:] >>unless you really want to do things yourself, the best bet is to first >>look and see if the package you need is at: >> >>www.pythonmac.org/packages > > No Numeric for Tiger. Use the Panther one. See below. [Me:] >>If it does worry you so much, then install Python 2.4.1, which places >>its files in /Library/Frameworks/Python.framework and be done with it. > > You mean MacPython, right? Is there a separate MacPython installer > for Tiger? The one I found (from March) says it's for Panther, and > I'm a bit cautious of installing something meant for Panther on > Tiger. Are there any problems running that one on Tiger? The Panther build works just fine on Tiger. Usually, Python packages built on Panther will also work on Tiger. I am currently using the semi-official Python 2.4.1 build from www.python.org on Tiger. The packages at pythonmac.org for 2.4.1 work just fine on Tiger. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From bob at redivi.com Wed Jul 20 23:06:05 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 20 Jul 2005 11:06:05 -1000 Subject: [Pythonmac-SIG] not "MacPython" - right place? In-Reply-To: <42DEB749.3010509@ucsd.edu> References: <33E6A941-E0A7-4AC1-A218-C9508FE97E82@charter.net> <408BA276-4613-4528-B8D4-2C9A2F190437@redivi.com> <314449CA-417C-4DBF-BE24-88CB3B400224@charter.net> <3272A6CE-DDE0-4BEB-B9F0-757CD0BC9F5F@redivi.com> <45539151-925E-4BC4-BAF4-22FCDD1866ED@charter.net> <42DEB749.3010509@ucsd.edu> Message-ID: On Jul 20, 2005, at 10:42 AM, Robert Kern wrote: > William K wrote: > > [Me:] > >>> If it does worry you so much, then install Python 2.4.1, which >>> places >>> its files in /Library/Frameworks/Python.framework and be done >>> with it. >>> >> >> You mean MacPython, right? Is there a separate MacPython installer >> for Tiger? The one I found (from March) says it's for Panther, and >> I'm a bit cautious of installing something meant for Panther on >> Tiger. Are there any problems running that one on Tiger? >> > > The Panther build works just fine on Tiger. Usually, Python packages > built on Panther will also work on Tiger. I am currently using the > semi-official Python 2.4.1 build from www.python.org on Tiger. The > packages at pythonmac.org for 2.4.1 work just fine on Tiger. Well, I called it the "official unofficial" distribution when only I was distributing it. Since it is also the distribution on python.org, it's probably safe to say it's the official distribution. Maybe I should change the text :) -bob From pecora at anvil.nrl.navy.mil Wed Jul 20 23:37:13 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Wed, 20 Jul 2005 17:37:13 -0400 Subject: [Pythonmac-SIG] 2.4.1 Installed and roughly working, but modules missing. Message-ID: <42DEC409.9030201@anvil.nrl.navy.mil> I installed Bob I.'s 2.4.1 version and I can get it up and running in Terminal using /usr/local/bin/python. But in running it from Terminal or BBEdit Python cannot find the module 'kinds'. At first it couldn't find the Numeric module, but I installed that and then the 'kinds' problem came up. Any ideas? I should mention that my Apple-supplied python appears hosed with several files missing deep down in the /system/library/framework/ .... blah, blah /versions/2.3/... etc. My hope is to get 2.4.1 up and running so I can continue working while I wrestle with finding and fixing hard drive problems. But I seem to need to replace modules like 'kinds' that got 'lost'. thanks for any info. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From rkern at ucsd.edu Wed Jul 20 23:45:18 2005 From: rkern at ucsd.edu (Robert Kern) Date: Wed, 20 Jul 2005 14:45:18 -0700 Subject: [Pythonmac-SIG] 2.4.1 Installed and roughly working, but modules missing. In-Reply-To: <42DEC409.9030201@anvil.nrl.navy.mil> References: <42DEC409.9030201@anvil.nrl.navy.mil> Message-ID: <42DEC5EE.4070903@ucsd.edu> Louis Pecora wrote: > I installed Bob I.'s 2.4.1 version and I can get it up and running in > Terminal using /usr/local/bin/python. But in running it from Terminal > or BBEdit Python cannot find the module 'kinds'. > > At first it couldn't find the Numeric module, but I installed that and > then the 'kinds' problem came up. Any ideas? It's not in the main Numeric package any more. Get it from CVS. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From brownr at ucalgary.ca Thu Jul 21 00:46:08 2005 From: brownr at ucalgary.ca (Robert Brown) Date: Wed, 20 Jul 2005 16:46:08 -0600 Subject: [Pythonmac-SIG] PyObjC and ObjC threads Message-ID: <1CB7E77C-E31D-4F29-841D-F96E0F43DB45@ucalgary.ca> I would like to write a multithreaded application, mostly to take advantage of dual processors... first, does Python's thread API do this? Last time I checked it would only run on one processor. I've written a thread class in ObjectiveC that works nicely. It uses Apple's distributed objects for communication. It can be called without problems from Python until one of the methods returns (oneway void) instead of just (void), which is sort of critical for useful threading. When one of the methods is (oneway void) Python crashes with a bus error. If the ObjC thread class is used by another ObjectiveC class (which itself has no oneway void functions) there's no problem, everything works great. This problem occurs even if the object is not running on a different thread, ie it's just a simple method call to a regular object except that the method returns oneway void. Any ideas why PyObjC hates (oneway void) functions so much? --------------------------------------------------- Robb Brown Seaman Family MR Research Centre Calgary, Alberta, Canada -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20050720/9a7892ad/attachment.htm From bob at redivi.com Thu Jul 21 01:06:59 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 20 Jul 2005 13:06:59 -1000 Subject: [Pythonmac-SIG] PyObjC and ObjC threads In-Reply-To: <1CB7E77C-E31D-4F29-841D-F96E0F43DB45@ucalgary.ca> References: <1CB7E77C-E31D-4F29-841D-F96E0F43DB45@ucalgary.ca> Message-ID: On Jul 20, 2005, at 12:46 PM, Robert Brown wrote: > I would like to write a multithreaded application, mostly to take > advantage of dual processors... first, does Python's thread API do > this? Last time I checked it would only run on one processor. Python's thread API ensures that Python bytecode is only executing in one thread at a time. However, much of Python is implemented in C and some of that code releases the Global Interpreter Lock. So, it is possible to achieve some gains with threads if heavy lifting is done in C with the GIL released, but for pure Python code you'll probably end up slowing things down due to the synchronization overhead. > I've written a thread class in ObjectiveC that works nicely. It > uses Apple's distributed objects for communication. It can be > called without problems from Python until one of the methods > returns (oneway void) instead of just (void), which is sort of > critical for useful threading. When one of the methods is (oneway > void) Python crashes with a bus error. If the ObjC thread class is > used by another ObjectiveC class (which itself has no oneway void > functions) there's no problem, everything works great. This > problem occurs even if the object is not running on a different > thread, ie it's just a simple method call to a regular object > except that the method returns oneway void. > > Any ideas why PyObjC hates (oneway void) functions so much? This is a bug but it has been fixed: use PyObjC from svn. -bob From pecora at anvil.nrl.navy.mil Fri Jul 22 02:38:29 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Thu, 21 Jul 2005 20:38:29 -0400 Subject: [Pythonmac-SIG] Trouble installing CVS module kinds Message-ID: <42E04005.8010406@anvil.nrl.navy.mil> I installed 2.4.1 from Bob (easy), but it was missing Numeric. I installed that, but that was missing the "kinds" module which my code imports. Robert Kern kindly informed me that kinds is no longer a part of Numeric, but I could get it from CVS and he showed me how (which is good since I haven't a clue when things get this deep in the modules distribution and installation). However, after getting kinds and running setup.py I get the following message: /tmp/501/Cleanup\ At\ Startup/57993.command; exit Traceback (most recent call last): File "/Users/louispecora/Code/python/AddedPackagesfiles/kinds/Test/test.py", line 3, in ? import unittest, kinds, sys File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/kinds/__init__.py", line 2, in ? from kinds import * File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/kinds/kinds.py", line 2, in ? import _kinds ImportError: Failure linking new module: : dyld: /usr/local/bin/python Undefined symbols: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/kinds/_kinds.so undefined reference to ___gxx_personality_v0 expected to be defined in a dynamic image Exit 1 logout [Process completed] It appears that Python is finding kinds, but something else (involving gxx whatever?) is missing. Anyone know what's happening and, better, how to get it working? Thanks for any help. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From bob at redivi.com Fri Jul 22 03:47:04 2005 From: bob at redivi.com (Bob Ippolito) Date: Thu, 21 Jul 2005 15:47:04 -1000 Subject: [Pythonmac-SIG] Trouble installing CVS module kinds In-Reply-To: <42E04005.8010406@anvil.nrl.navy.mil> References: <42E04005.8010406@anvil.nrl.navy.mil> Message-ID: <054C0613-7533-4FA6-9CE5-9B04196613A6@redivi.com> On Jul 21, 2005, at 2:38 PM, Louis Pecora wrote: > I installed 2.4.1 from Bob (easy), but it was missing Numeric. I > installed that, but that was missing the "kinds" module which my code > imports. Robert Kern kindly informed me that kinds is no longer a > part > of Numeric, but I could get it from CVS and he showed me how (which is > good since I haven't a clue when things get this deep in the modules > distribution and installation). > > However, after getting kinds and running setup.py I get the following > message: > > /tmp/501/Cleanup\ At\ Startup/57993.command; exit > Traceback (most recent call last): > File > "/Users/louispecora/Code/python/AddedPackagesfiles/kinds/Test/ > test.py", > line 3, in ? > import unittest, kinds, sys > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ > site-packages/kinds/__init__.py", > line 2, in ? > from kinds import * > File > "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ > site-packages/kinds/kinds.py", > line 2, in ? > import _kinds > ImportError: Failure linking new module: : dyld: /usr/local/bin/python > Undefined symbols: > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/ > site-packages/kinds/_kinds.so > undefined reference to ___gxx_personality_v0 expected to be defined > in a > dynamic image > > Exit 1 > logout > [Process completed] > > It appears that Python is finding kinds, but something else (involving > gxx whatever?) is missing. Anyone know what's happening and, better, > how to get it working? It looks like you compiled _kinds.so with one version of gcc, but the Numeric you installed is using another. The Numeric from pythonmac.org was compiled with the latest Xcode toolchain for Mac OS X 10.3. Perhaps you need to either compile your own Numeric, and/or update your toolchain? -bob From pecora at anvil.nrl.navy.mil Fri Jul 22 19:53:02 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Fri, 22 Jul 2005 13:53:02 -0400 Subject: [Pythonmac-SIG] Can't get re-installed python to recognize old paths. Message-ID: <42E1327E.1010405@anvil.nrl.navy.mil> After a lot of hair pulling (long story) I re-installed OS X 10.3 (archive and install) and then upgraded to 10.3.9. Python seems to work and other problems seem to be gone, but when I try to import my original modules it can't find them. I looked in the folder .MacOSX and see that Enviroment.plist is still there and it has the original paths that once worked (two weeks ago). Here it is: * PYTHONPATH /users/louispecora/Code/python/general:/users/louispecora/Code/python/stats:/users/louispecora/Code/python/stats/BayesProb:/users/louispecora/Code/python/time_series:/users/louispecora/Code/python/plotwindow:/Library/Python/2.3/:/users/louispecora/Code/AddedPackagesfiles/: *So I'm stumped as to why Python can't find modules in the folders listed in Enviroment.plist. I haven't changed any folder names. I seem to remember only needing to mess with Enviroment.plist to establish paths. Am I forgetting something? Thanks for any ideas. Thanks also to Bob I. and Robert Kern for their patience as I try to bring my system back to health and get python up and running. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From rkern at ucsd.edu Fri Jul 22 20:03:06 2005 From: rkern at ucsd.edu (Robert Kern) Date: Fri, 22 Jul 2005 11:03:06 -0700 Subject: [Pythonmac-SIG] Can't get re-installed python to recognize old paths. In-Reply-To: <42E1327E.1010405@anvil.nrl.navy.mil> References: <42E1327E.1010405@anvil.nrl.navy.mil> Message-ID: <42E134DA.2050602@ucsd.edu> Louis Pecora wrote: > After a lot of hair pulling (long story) I re-installed OS X 10.3 > (archive and install) and then upgraded to 10.3.9. Python seems to work > and other problems seem to be gone, but when I try to import my original > modules it can't find them. I looked in the folder .MacOSX and see that > Enviroment.plist is still there and it has the original paths that once > worked (two weeks ago). Here it is: Can't say much about setting PYTHONPATH, but an option you should consider is to make a .pth file in your site-packages directory that lists all of these directories, one per line. For example: # mystuff.pth /users/louispecora/Code/python/general /users/louispecora/Code/python/stats /users/louispecora/Code/python/stats/BayesProb /users/louispecora/Code/python/time_series /users/louispecora/Code/python/plotwindow /users/louispecora/Code/AddedPackagesfiles -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From bob at redivi.com Fri Jul 22 21:21:44 2005 From: bob at redivi.com (Bob Ippolito) Date: Fri, 22 Jul 2005 09:21:44 -1000 Subject: [Pythonmac-SIG] Can't get re-installed python to recognize old paths. In-Reply-To: <42E1327E.1010405@anvil.nrl.navy.mil> References: <42E1327E.1010405@anvil.nrl.navy.mil> Message-ID: <3E3E8D7A-6486-4994-973C-7225BD27CFA5@redivi.com> On Jul 22, 2005, at 7:53 AM, Louis Pecora wrote: > After a lot of hair pulling (long story) I re-installed OS X 10.3 > (archive and install) and then upgraded to 10.3.9. Python seems to > work > and other problems seem to be gone, but when I try to import my > original > modules it can't find them. I looked in the folder .MacOSX and see > that > Enviroment.plist is still there and it has the original paths that > once > worked (two weeks ago). Here it is: The first rule of PYTHONPATH is that you shouldn't use PYTHONPATH. Use pth files instead. Anyway, did you forget to logout after changing Environment.plist? -bob From w.northcott at unsw.edu.au Sun Jul 24 07:35:59 2005 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Sun, 24 Jul 2005 15:35:59 +1000 Subject: [Pythonmac-SIG] Problems building 2.3.5 source on MacOS X Tiger Message-ID: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> I am trying to build Python 2.3.5 sources on MacOS X 10.4.2 using gcc-4. My reason for doing this is to get a Tkinter linked against Tk X11 including BLT. I ran into considerable problems with the main link which is Makefile.pre.in:370-371 which reads libtool -o $(LDLIBRARY) -dynamic $(OTHER_LIBTOOL_OPT) $(LIBRARY) \ -framework System @LIBTOOL_CRUFT@ I have checked that this seems to be the same in the current cvs. I had edited Modules/Setup after running configure to reflect the locations of my Tcl, Tk X11 and BLT libraries and headers. The compilation ran without problem although there are a very large number of warnings. My first attempt at the link failed because none of the Tcl/Tk/BLT symbols were being found. Adding $(LOCALMODLIBS) to the link line above solved this. I was then left with a number of missing symbols relating to printf functions such as _fprintf$LDBLStub. This seems to happen because these functions in Tiger with gcc-4.0 are actually macros which translate into symbols in the System stub library which is not included on the link line. A little Googling revealed the underlying cause as trying to use libtool to link the libraries. The right way being to use the gcc compiler driver, which automatically includes all the necessary system libraries. I eventually succeeded with a command that looks like this: $(CC) -o $(LDLIBRARY) -dynamiclib $(OTHER_LIBTOOL_OPT) -all_load $(LIBRARY) $(LOCALMODLIBS) \ @LIBTOOL_CRUFT@ Apart from using the compiler driver the other changes are: -dynamiclib the appropriate option for the driver -all_load without this, ld just searches the libPythonXX.a for unresolved symbols from previous objects of which their are none. - all_load includes all objects in the static library into the link, which is what is needed. The reference to the System framework is no longer required because the compiler driver looks after that. This change enabled the make stage to complete. I am currently stuck with one of the apps not building properly with 'make frameworkinstall'. The framework appears to have built correctly. Bill Northcott From bob at redivi.com Sun Jul 24 08:01:02 2005 From: bob at redivi.com (Bob Ippolito) Date: Sat, 23 Jul 2005 20:01:02 -1000 Subject: [Pythonmac-SIG] Problems building 2.3.5 source on MacOS X Tiger In-Reply-To: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> References: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> Message-ID: On Jul 23, 2005, at 7:35 PM, Bill Northcott wrote: > I am trying to build Python 2.3.5 sources on MacOS X 10.4.2 using > gcc-4. I think you should try it with gcc 3.3 instead. -bob From w.northcott at unsw.edu.au Sun Jul 24 08:11:08 2005 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Sun, 24 Jul 2005 16:11:08 +1000 Subject: [Pythonmac-SIG] Problems building 2.3.5 source on MacOS X Tiger In-Reply-To: References: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> Message-ID: <4A16A2C8-740D-4016-B3FF-B40998319516@unsw.edu.au> On 24/07/2005, at 4:01 PM, Bob Ippolito wrote: >> I am trying to build Python 2.3.5 sources on MacOS X 10.4.2 using >> gcc-4. >> > > I think you should try it with gcc 3.3 instead. I am well aware that it work better with gcc-3.3. However, gcc-4 is the default compiler for Tiger and the Makefile is just incorrect. Libtool should not be invoked to build a shared library because it is very dependent on operating system and compiler in ways which are not documented. Bill From bob at redivi.com Sun Jul 24 08:20:49 2005 From: bob at redivi.com (Bob Ippolito) Date: Sat, 23 Jul 2005 20:20:49 -1000 Subject: [Pythonmac-SIG] Problems building 2.3.5 source on MacOS X Tiger In-Reply-To: <4A16A2C8-740D-4016-B3FF-B40998319516@unsw.edu.au> References: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> <4A16A2C8-740D-4016-B3FF-B40998319516@unsw.edu.au> Message-ID: <641E699F-06DC-4F8F-B721-0F280E33D4CB@redivi.com> On Jul 23, 2005, at 8:11 PM, Bill Northcott wrote: > On 24/07/2005, at 4:01 PM, Bob Ippolito wrote: > >>> I am trying to build Python 2.3.5 sources on MacOS X 10.4.2 using >>> gcc-4. >>> >>> >> >> I think you should try it with gcc 3.3 instead. >> > > I am well aware that it work better with gcc-3.3. However, gcc-4 is > the default compiler for Tiger and the Makefile is just incorrect. > Libtool should not be invoked to build a shared library because it is > very dependent on operating system and compiler in ways which are not > documented. I fixed this problem for 2.4.1 (CVS HEAD should be fine too). I don't really consider 2.3 important enough to spend my time backporting. If you notice, Apple didn't compile Python 2.3 under gcc 4 either. -bob From w.northcott at unsw.edu.au Sun Jul 24 10:53:59 2005 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Sun, 24 Jul 2005 18:53:59 +1000 Subject: [Pythonmac-SIG] Problems building 2.3.5 source on MacOS X Tiger In-Reply-To: <641E699F-06DC-4F8F-B721-0F280E33D4CB@redivi.com> References: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> <4A16A2C8-740D-4016-B3FF-B40998319516@unsw.edu.au> <641E699F-06DC-4F8F-B721-0F280E33D4CB@redivi.com> Message-ID: On 24/07/2005, at 4:20 PM, Bob Ippolito wrote: > I fixed this problem for 2.4.1 (CVS HEAD should be fine too). I > don't really consider 2.3 important enough to spend my time > backporting. If you notice, Apple didn't compile Python 2.3 under > gcc 4 either. Great. As long as its fixed that is what matters. I notice that quite a bit of the released Tiger is built with gcc-3.3, but gcc-4 is still the recommended compiler for developers and the only one that supports 64bit x86 etc.. Bill From woklist at charter.net Sun Jul 24 19:28:17 2005 From: woklist at charter.net (William K) Date: Sun, 24 Jul 2005 12:28:17 -0500 Subject: [Pythonmac-SIG] Dev Tools needed? Message-ID: <969C8086-C281-47E7-965C-D47744BB231F@charter.net> I was looking at the MacPython installer (2.4.1) and it's not clear if Xcode is needed. Other than not being able to build modules from C source, I noticed one bit that is installed in the System python framework, PantherPythonFix, that has some reference to GCC. There's nothing in the installer to keep it from installing on a system without Xcode, but will it run without it, as long as one doesn't need to compile C modules? I ask because I want to package some programs that include built C modules, and some Mac users might not want to install Xcode, just use prebuilt modules in their Python scripts. ----- William Kyngesburye http://www.kyngchaos.com/ All generalizations are dangerous, even this one. From bob at redivi.com Sun Jul 24 23:04:51 2005 From: bob at redivi.com (Bob Ippolito) Date: Sun, 24 Jul 2005 11:04:51 -1000 Subject: [Pythonmac-SIG] Dev Tools needed? In-Reply-To: <969C8086-C281-47E7-965C-D47744BB231F@charter.net> References: <969C8086-C281-47E7-965C-D47744BB231F@charter.net> Message-ID: On Jul 24, 2005, at 7:28 AM, William K wrote: > I was looking at the MacPython installer (2.4.1) and it's not clear > if Xcode is needed. Other than not being able to build modules from > C source, I noticed one bit that is installed in the System python > framework, PantherPythonFix, that has some reference to GCC. There's > nothing in the installer to keep it from installing on a system > without Xcode, but will it run without it, as long as one doesn't > need to compile C modules? Xcode is only required for developing extensions. > I ask because I want to package some programs that include built C > modules, and some Mac users might not want to install Xcode, just use > prebuilt modules in their Python scripts. With py2app, they don't even need Python. -bob From w.northcott at unsw.edu.au Mon Jul 25 02:43:36 2005 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Mon, 25 Jul 2005 10:43:36 +1000 Subject: [Pythonmac-SIG] Problems building 2.3.5 source on MacOS X Tiger In-Reply-To: <641E699F-06DC-4F8F-B721-0F280E33D4CB@redivi.com> References: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> <4A16A2C8-740D-4016-B3FF-B40998319516@unsw.edu.au> <641E699F-06DC-4F8F-B721-0F280E33D4CB@redivi.com> Message-ID: <5B9926FF-5464-4720-848A-C13980D6D6FB@unsw.edu.au> On 24/07/2005, at 4:20 PM, Bob Ippolito wrote: > > I fixed this problem for 2.4.1 (CVS HEAD should be fine too). I > don't really consider 2.3 important enough to spend my time > backporting. If you notice, Apple didn't compile Python 2.3 under > gcc 4 either. I got a chance to look at the 'fix' and it is still does not seem right to me. I can't see $(LOCALMODLIBS) in the link or am I missing something on this? The main problem, as I see it, is using libtool to build the libraries, which is inherently fragile and is going to keep breaking particularly as Apple introduce more changes for the x86 transition. The documented way is to use the compiler driver gcc. This will automatically call ld, libtool and even lipo repeatedly if necessary to construct fat libraries. It will also automatically include the necessary system libraries, which it seems to me are very likely to change again. Finally the command will work with any compiler/MacOS combination without modification. A few small points. If you are determined to use libtool, it would be good to use the full path. libtool on my machine means /usr/local/ bin/libtool which is gnu libtool. The same would probably happen with Fink. /usr/bin/libtool is guaranteed to be Apple's libtool. Also I notice that -lcc_dynamic is now removed for gcc-4.0, but I don't see why it is there at all. Its purpose is to get rid of unresolved symbols restFP and saveFP. This problem only happens when trying to link objects compiled with an Apple gcc with some compiled with the FSF gcc. Since Apple provide C, C++, Objective-C and Objective-C++, this only arises when linking Fortran code which has been built with the FSF g77. Since there is no Fortran in Python, it can be removed altogether. The fix I suggested is much simpler, more robust and removes the need to test in configure for different OS/compiler versions. Finally, I don't see the point of '-arch_only ppc' as far as I know, the default is to use the host architecture. It seems to me that the option, which is not configured, just guarantees that things will break on x86. Cheers Bill From bob at redivi.com Mon Jul 25 02:46:51 2005 From: bob at redivi.com (Bob Ippolito) Date: Sun, 24 Jul 2005 14:46:51 -1000 Subject: [Pythonmac-SIG] Problems building 2.3.5 source on MacOS X Tiger In-Reply-To: <5B9926FF-5464-4720-848A-C13980D6D6FB@unsw.edu.au> References: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> <4A16A2C8-740D-4016-B3FF-B40998319516@unsw.edu.au> <641E699F-06DC-4F8F-B721-0F280E33D4CB@redivi.com> <5B9926FF-5464-4720-848A-C13980D6D6FB@unsw.edu.au> Message-ID: <08305342-68ED-4AA4-A5FD-397A08144DD4@redivi.com> On Jul 24, 2005, at 2:43 PM, Bill Northcott wrote: > On 24/07/2005, at 4:20 PM, Bob Ippolito wrote: > >> >> I fixed this problem for 2.4.1 (CVS HEAD should be fine too). I >> don't really consider 2.3 important enough to spend my time >> backporting. If you notice, Apple didn't compile Python 2.3 under >> gcc 4 either. >> > > I got a chance to look at the 'fix' and it is still does not seem > right to me. The fix was simply to get it to compile, and was done way before the x86 transition. Changing the build process is a PITA and you have to be careful not to cause issues with other platforms and previous versions of OS X. Patches accepted! -bob From w.northcott at unsw.edu.au Mon Jul 25 03:17:37 2005 From: w.northcott at unsw.edu.au (Bill Northcott) Date: Mon, 25 Jul 2005 11:17:37 +1000 Subject: [Pythonmac-SIG] Problems building 2.3.5 source on MacOS X Tiger In-Reply-To: <08305342-68ED-4AA4-A5FD-397A08144DD4@redivi.com> References: <2C5400B1-AB1D-4E06-A9BE-9BB4AFA30DBB@unsw.edu.au> <4A16A2C8-740D-4016-B3FF-B40998319516@unsw.edu.au> <641E699F-06DC-4F8F-B721-0F280E33D4CB@redivi.com> <5B9926FF-5464-4720-848A-C13980D6D6FB@unsw.edu.au> <08305342-68ED-4AA4-A5FD-397A08144DD4@redivi.com> Message-ID: <8AE799FE-4A7F-431E-92F2-30F62D5DD9A6@unsw.edu.au> On 25/07/2005, at 10:46 AM, Bob Ippolito wrote: > The fix was simply to get it to compile, and was done way before > the x86 transition. Changing the build process is a PITA and you > have to be careful not to cause issues with other platforms and > previous versions of OS X. > > Patches accepted! Appreciated. I spent a lot of time on build systems porting Swarm, which I think must have the most complex build system ever devised. I learned a lot in the process and I am happy to help. Bill From joanca at casasin.com Mon Jul 25 15:28:28 2005 From: joanca at casasin.com (Joancarles Casasin) Date: Mon, 25 Jul 2005 15:28:28 +0200 Subject: [Pythonmac-SIG] installing py2app Message-ID: Hi, I'm trying to install py2app 0.2 and I get this error: """ (...) writing byte-compilation script '/tmp/tmpiw8kyG.py' /usr/bin/python -OO /tmp/tmpiw8kyG.py removing /tmp/tmpiw8kyG.py copying files for scheme doc error: cannot copy tree 'doc': not a directory """ And after that, nothing happened. I'm running the setup.py script from a Terminal window as specified in the readme file ("python setup.py bdist_mpkg --open "). Any clue? Excuse me if really basic question, newbie with this stuff. Many thanks, Joancarles From joaoleao at gmx.net Mon Jul 25 16:37:49 2005 From: joaoleao at gmx.net (=?ISO-8859-1?Q?Jo=E3o_Le=E3o?=) Date: Mon, 25 Jul 2005 15:37:49 +0100 Subject: [Pythonmac-SIG] Detecting keystrokes during launch of application Message-ID: <66D94E87-716A-412C-A2CF-2F95680A1D03@gmx.net> Hi, I'd like to know what's the best method to detect a keystroke during the launch of an application. I have a py2app application with argv emulation enabled and I need (if it's possible) to know if a certain keyboard key was pressed or not during initialization. Thanks for any help. Jo?o From skip at pobox.com Tue Jul 26 04:32:56 2005 From: skip at pobox.com (skip@pobox.com) Date: Mon, 25 Jul 2005 21:32:56 -0500 Subject: [Pythonmac-SIG] How to get traceback from PySol? Message-ID: <17125.41176.556904.583793@montanaro.dyndns.org> I have Brian Lenihan's bundled PySol installed on my laptop. A couple days ago it quit working. After getting most of the way through startup it quits with a dialog that reads: Internal errror. Please report this bug: exceptions.AssertionError (Quit) While the pull-down menus appear to work after that, nothing actually works. Running with the console open shows this error: PySol: pysolsoundserver module not found, sound disabled. but no traceback related to the assertion error. Is there some way to get a full traceback so I can debug this problem, or do I have to just reinstall PySol and hope it goes away? Thx, -- Skip Montanaro skip at pobox.com From brian_l at mac.com Tue Jul 26 05:21:25 2005 From: brian_l at mac.com (Brian Lenihan) Date: Mon, 25 Jul 2005 20:21:25 -0700 Subject: [Pythonmac-SIG] How to get traceback from PySol? In-Reply-To: <17125.41176.556904.583793@montanaro.dyndns.org> References: <17125.41176.556904.583793@montanaro.dyndns.org> Message-ID: <89959A90-7689-4182-966B-93D31CE9D464@mac.com> On Jul 25, 2005, at 7:32 PM, skip at pobox.com wrote: > I have Brian Lenihan's bundled PySol installed on my laptop. A > couple days > ago it quit working. After getting most of the way through startup > it quits > with a dialog that reads: > > Internal errror. Please report this bug: > > exceptions.AssertionError > > (Quit) > > While the pull-down menus appear to work after that, nothing > actually works. > Running with the console open shows this error: > > PySol: pysolsoundserver module not found, sound disabled. > > but no traceback related to the assertion error. Is there some way > to get a > full traceback so I can debug this problem, or do I have to just > reinstall > PySol and hope it goes away? I don't think reinstalling will help, but it can't hurt. I think I tracked that bug down a few months ago when I was building for Tiger. I'll take a look after dinner. In the meantime, grep for StandardError in main.py and you can at add some code to print the tb. I'll have a look after dinner. > > Thx, > > -- > Skip Montanaro > skip at pobox.com > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From phil at bubblehouse.org Tue Jul 26 05:38:30 2005 From: phil at bubblehouse.org (Phil Christensen) Date: Mon, 25 Jul 2005 23:38:30 -0400 Subject: [Pythonmac-SIG] AppleEvents and AEPutParamDesc Message-ID: <0A0A7B25-D9E5-432D-9FE4-E36B43EABBE6@bubblehouse.org> So I'm in the process of trying to implement the BBEdit ODB suite functionality in a PyObjC app, and I've run into some weirdness, and I hope someone here might be able to help me. I've been hacking on the MiniAEFrame.py module that is distributed with python, and I've had success receiving the BBEdit's response (when a file is saved) through this script. All I did was add a call to the following function, just before the call to the _Test() constructor def openInExternalEditor(_filePath, _lnnum=0, _editor = '/ Applications/BBEdit.app'): from aem.send import Application import struct from Carbon.File import FSSpec SelectionRange = struct.pack('hhllll', 0, int(_lnnum)-1, 1,1,0,0) Application(_editor).event('aevtodoc',{'----':FSSpec (_filePath),'kpos':SelectionRange}).send() BBEdit opens the requested document, and when I save the file, this event prints to the console: AppleEvent ('R*ch', 'FMod') for Other args: {... which is definitely what I want. However, when I bring all this into my PyObjC app, I no longer seem to receive events properly. Obviously, I had to make some changes, since the MiniApplication class in the MiniAEFrame module also implements event handling for menus, about boxes, etc, and this is already taken care of by the PyObjC app. This is what my event loop looks like now: def eventLoop(): # we poll for apple events here got, event = Evt.WaitNextEvent(Events.highLevelEventMask, 1) if got: print 'got: ' + str(got) + ' event: ' + str(event) what, message, when, where, modifiers = event if what == MiniAEFrame.kHighLevelEvent: AE.AEProcessAppleEvent(event) elif hasattr(MacOS, 'HandleEvent'): MacOS.HandleEvent(event) else: print "Unhandled event:", event # an instance of the twisted python threadedselectreactor reactor.callLater(1, eventLoop) The event registration is taken care of by a trial subclass of MiniAEFrame.AEServer: class EventServer(MiniAEFrame.AEServer): def __init__(self): MiniAEFrame.AEServer.__init__(self) # these are more than necessary, but in an attempt to # mimic MiniAEFrame as much as possible self.installaehandler('aevt', 'oapp', self.other) self.installaehandler('aevt', 'quit', self.other) self.installaehandler('****', '****', self.other) def other(self, _object=None, _class=None, _type=None, **args): print 'AppleEvent', (_class, _type), 'for', _object, 'Other args:', args However, now this gets various events (usually things like the 'rapp' event when the app goes into the background, etc), but definitely nothing from BBEdit. I thought perhaps it was because the ODB specification says you should pass along a 'keyServerID' parameter to the 'odoc' event that signifies a 4-byte char OSType. I wasn't sure about how this works under OS X, but I set the 'CFBundleSignature' property to 'Phil' in the .app bundle's Info.plist, and tried the following when I sent the event: def openInExternalEditor(_filePath, _lnnum=0, _editor = '/ Applications/BBEdit.app'): from aem.send import Application import struct from Carbon.File import FSSpec SelectionRange = struct.pack('hhllll', 0, int(_lnnum)-1, 1,1,0,0) Application(_editor).event('aevtodoc',{'----':FSSpec (_filePath), 'kpos':SelectionRange, 'keyServerID':'Phil'}).send() but this constantly generates the following error: Traceback (most recent call last): [snipped cocoa-related garbage] File "/Users/phil/Workspace/InnerSpace/cocoa/client/dist/ controller.app/Contents/Resources/__boot__.py", line 47, in _run execfile(path, globals(), globals()) File "/Users/phil/Workspace/InnerSpace/cocoa/client/ controller.py", line 167, in ? openInExternalEditor('/tmp/test-12345') File "/Users/phil/Workspace/InnerSpace/cocoa/client/ controller.py", line 162, in openInExternalEditor Application(_editor).event('aevtodoc',{'----':FSSpec (_filePath),'kpos':SelectionRange, 'keyServerID':'Phil'}).send() File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/aem/send/__init__.py", line 83, in event return self._Event(self._address, event, params, atts, resulttype, self._transaction, returnid, self._codecs) File "/Library/Frameworks/Python.framework/Versions/2.4/lib/ python2.4/site-packages/aem/send/send.py", line 87, in __init__ self._event.AEPutParamDesc(key, codecs.pack(value)) TypeError: OSType arg must be string of 4 chars I've tried everything at this point to get it to accept 'Phil', such as converting it to an int, or packing it into a 4-byte struct, but to no avail. In reality, that shouldn't even be necessary, as I grepped the Python source tree, and found that the only function that generates a TypeError with that string is in mactoolboxglue.c, and it should accept the string 'Phil': /* Convert a 4-char string object argument to an OSType value */ int PyMac_GetOSType(PyObject *v, OSType *pr) { if (!PyString_Check(v) || PyString_Size(v) != 4) { PyErr_SetString(PyExc_TypeError, "OSType arg must be string of 4 chars"); return 0; } memcpy((char *)pr, PyString_AsString(v), 4); return 1; } At any rate, sorry this email is so long, but any help would be appreciated. It'd be really great to get this external editor feature working... Incidentally, here are some relevant links: ODB Suite: http://www.barebones.com/support/develop/odbsuite.shtml MiniAEFrame.py: http://cvs.sourceforge.net/viewcvs.py/python/python/dist/src/Lib/ plat-mac/MiniAEFrame.py?rev=1.5&view=log Thanks in advance, -phil christensen From pecora at anvil.nrl.navy.mil Tue Jul 26 21:34:29 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Tue, 26 Jul 2005 15:34:29 -0400 Subject: [Pythonmac-SIG] Errors with simple_plot in matplotlib: type is wrong for / operator? Message-ID: <42E69045.6030308@anvil.nrl.navy.mil> I got my Python back up and running thanks to help from Bob Impolito and Robert Kern (site packages and .pth files and new system install). * I have installed wxPython and matplotlib. But when I run the simple_plot.py program: #!/usr/bin/pythonw from pylab import * figure(1) t = arange(0.0, 1.0+0.01, 0.01) s = cos(2*2*pi*t) plot(t, s) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) #axis([0,1,-1,1]) savefig('simple_plot') show() * I get this traceback: louispec% /tmp/501/Cleanup\ At\ Startup/1735220.command; exit Traceback (most recent call last): File "/Users/louispecora/Documents/Computer Info ?/Python ?/Matplotlib ?/Examples.Matplotlib/simple_plot.py", line 17, in ? savefig('simple_plot') File "/Library/Python/2.3/pylab.py", line 751, in savefig File "/platlib/matplotlib/figure.py", line 618, in savefig File "/platlib/matplotlib/backends/backend_wxagg.py", line 83, in print_figure File "/platlib/matplotlib/backends/backend_agg.py", line 432, in print_figure File "/platlib/matplotlib/backends/backend_agg.py", line 369, in draw File "/platlib/matplotlib/figure.py", line 498, in draw File "/platlib/matplotlib/axes.py", line 1361, in draw File "/platlib/matplotlib/axis.py", line 530, in draw File "/platlib/matplotlib/ticker.py", line 297, in set_locs File "/platlib/matplotlib/ticker.py", line 335, in _set_format TypeError: unsupported operand type(s) for /: 'array' and 'int' Exit 1 logout [Process completed] *This is deep in matplotlib. Anyone know what's happening? Here's what line 335 in ticker.py looks like (not sure if this helps since you'd probably have to know the code of matplotlib): # set the format string to format all the ticklabels locs = (array(self.locs)-self.offset) / 10**self.orderOfMagnitude+1e-15 But there's that / operator. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From rkern at ucsd.edu Tue Jul 26 21:40:52 2005 From: rkern at ucsd.edu (Robert Kern) Date: Tue, 26 Jul 2005 12:40:52 -0700 Subject: [Pythonmac-SIG] Errors with simple_plot in matplotlib: type is wrong for / operator? In-Reply-To: <42E69045.6030308@anvil.nrl.navy.mil> References: <42E69045.6030308@anvil.nrl.navy.mil> Message-ID: <42E691C4.8030204@ucsd.edu> Louis Pecora wrote: > I got my Python back up and running thanks to help from Bob Impolito > and Robert Kern (site packages and .pth files and new system install). > > * I have installed wxPython and matplotlib. But when I run the > simple_plot.py program: > > #!/usr/bin/pythonw I'm not sure about the rest (ask on the matplotlib list), but this #! line won't work. Instead, use #!/usr/bin/env pythonw -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From jdhunter at ace.bsd.uchicago.edu Tue Jul 26 21:41:16 2005 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue, 26 Jul 2005 14:41:16 -0500 Subject: [Pythonmac-SIG] Errors with simple_plot in matplotlib: type is wrong for / operator? In-Reply-To: <42E69045.6030308@anvil.nrl.navy.mil> (Louis Pecora's message of "Tue, 26 Jul 2005 15:34:29 -0400") References: <42E69045.6030308@anvil.nrl.navy.mil> Message-ID: <874qahmk2r.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Louis" == Louis Pecora writes: Louis> *This is deep in matplotlib. Anyone know what's happening? Louis> Here's what line 335 in ticker.py looks like (not sure if Louis> this helps since you'd probably have to know the code of Louis> matplotlib): Louis> # set the format string to format all the ticklabels locs = Louis> (array(self.locs)-self.offset) / Louis> 10**self.orderOfMagnitude+1e-15 Louis> But there's that / operator. What version of Numeric/numarray are you running? Try running your example script with > pythonw myscript.py --verbose-helpful and report the output. Also, does it help to replace the 10**self.orderOfMagnitude with 10.0**self.orderOfMagnitude? I didn't write that section of the code, but I think this is what the author (Darren, CCd) intends. JDH Darren: FYI, the original post in full is below From: Louis Pecora Subject: [Pythonmac-SIG] Errors with simple_plot in matplotlib: type is wrong for / operator? To: pythonmac-sig at python.org Date: Tue, 26 Jul 2005 15:34:29 -0400 X-Spambayes-Classification: ham; 0.00 I got my Python back up and running thanks to help from Bob Impolito and Robert Kern (site packages and .pth files and new system install). * I have installed wxPython and matplotlib. But when I run the simple_plot.py program: #!/usr/bin/pythonw from pylab import * figure(1) t = arange(0.0, 1.0+0.01, 0.01) s = cos(2*2*pi*t) plot(t, s) xlabel('time (s)') ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) #axis([0,1,-1,1]) savefig('simple_plot') show() * I get this traceback: louispec% /tmp/501/Cleanup\ At\ Startup/1735220.command; exit Traceback (most recent call last): File "/Users/louispecora/Documents/Computer Info ƒ/Python ƒ/Matplotlib ƒ/Examples.Matplotlib/simple_plot.py", line 17, in ? savefig('simple_plot') File "/Library/Python/2.3/pylab.py", line 751, in savefig File "/platlib/matplotlib/figure.py", line 618, in savefig File "/platlib/matplotlib/backends/backend_wxagg.py", line 83, in print_figure File "/platlib/matplotlib/backends/backend_agg.py", line 432, in print_figure File "/platlib/matplotlib/backends/backend_agg.py", line 369, in draw File "/platlib/matplotlib/figure.py", line 498, in draw File "/platlib/matplotlib/axes.py", line 1361, in draw File "/platlib/matplotlib/axis.py", line 530, in draw File "/platlib/matplotlib/ticker.py", line 297, in set_locs File "/platlib/matplotlib/ticker.py", line 335, in _set_format TypeError: unsupported operand type(s) for /: 'array' and 'int' Exit 1 logout [Process completed] *This is deep in matplotlib. Anyone know what's happening? Here's what line 335 in ticker.py looks like (not sure if this helps since you'd probably have to know the code of matplotlib): # set the format string to format all the ticklabels locs = (array(self.locs)-self.offset) / 10**self.orderOfMagnitude+1e-15 But there's that / operator. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG at python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From pecora at anvil.nrl.navy.mil Tue Jul 26 22:15:51 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Tue, 26 Jul 2005 16:15:51 -0400 Subject: [Pythonmac-SIG] Errors with simple_plot in matplotlib: type is wrong for / operator? In-Reply-To: <874qahmk2r.fsf@peds-pc311.bsd.uchicago.edu> References: <42E69045.6030308@anvil.nrl.navy.mil> <874qahmk2r.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <42E699F7.3080802@anvil.nrl.navy.mil> John Hunter wrote: >>>>>>"Louis" == Louis Pecora writes: >>>>>> >>>>>> > Louis> *This is deep in matplotlib. Anyone know what's happening? > > Louis> Here's what line 335 in ticker.py looks like (not sure if > Louis> this helps since you'd probably have to know the code of > Louis> matplotlib): > > Louis> # set the format string to format all the ticklabels locs = > Louis> (array(self.locs)-self.offset) / > Louis> 10**self.orderOfMagnitude+1e-15 > > Louis> But there's that / operator. > >What version of Numeric/numarray are you running? > Not sure. It was installed last year IIRC. How do I find the version #? >Try running your >example script with > > > pythonw myscript.py --verbose-helpful > >and report the output. > > Here ya go: (it also gives the Numeric version and so maybe answers the above question): louispec% pythonw simple_plot.py --verbose-helpful matplotlib data path /System/Library/Frameworks/Python.framework/Versions/2.3/share/matplotlib loaded rc file /Users/louispecora/.matplotlibrc matplotlib version 0.82 verbose.level helpful interactive is False platform is darwin numerix Numeric 22.0 font search path ['/System/Library/Frameworks/Python.framework/Versions/2.3/share/matplotlib'] loaded ttfcache file /Users/louispecora/.ttffont.cache backend WXAgg version 2.6.1.0 Traceback (most recent call last): File "simple_plot.py", line 16, in ? savefig('simple_plot') File "/Library/Python/2.3/pylab.py", line 751, in savefig File "/platlib/matplotlib/figure.py", line 618, in savefig File "/platlib/matplotlib/backends/backend_wxagg.py", line 83, in print_figure File "/platlib/matplotlib/backends/backend_agg.py", line 432, in print_figure File "/platlib/matplotlib/backends/backend_agg.py", line 369, in draw File "/platlib/matplotlib/figure.py", line 498, in draw File "/platlib/matplotlib/axes.py", line 1361, in draw File "/platlib/matplotlib/axis.py", line 530, in draw File "/platlib/matplotlib/ticker.py", line 297, in set_locs File "/platlib/matplotlib/ticker.py", line 335, in _set_format TypeError: unsupported operand type(s) for /: 'array' and 'int' Exit 1 >Also, does it help to replace the 10**self.orderOfMagnitude with >10.0**self.orderOfMagnitude? I didn't write that section of the code, >but I think this is what the author (Darren, CCd) intends. > > Haven't tried it, yet. Next step. Thanks. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From jdhunter at ace.bsd.uchicago.edu Tue Jul 26 22:19:04 2005 From: jdhunter at ace.bsd.uchicago.edu (John Hunter) Date: Tue, 26 Jul 2005 15:19:04 -0500 Subject: [Pythonmac-SIG] Errors with simple_plot in matplotlib: type is wrong for / operator? In-Reply-To: <42E699F7.3080802@anvil.nrl.navy.mil> (Louis Pecora's message of "Tue, 26 Jul 2005 16:15:51 -0400") References: <42E69045.6030308@anvil.nrl.navy.mil> <874qahmk2r.fsf@peds-pc311.bsd.uchicago.edu> <42E699F7.3080802@anvil.nrl.navy.mil> Message-ID: <87u0ihcocn.fsf@peds-pc311.bsd.uchicago.edu> >>>>> "Louis" == Louis Pecora writes: Louis> numerix Numeric 22.0 My guess is that upgrading Numeric will fix this problem. JDH From pecora at anvil.nrl.navy.mil Tue Jul 26 22:29:39 2005 From: pecora at anvil.nrl.navy.mil (Louis Pecora) Date: Tue, 26 Jul 2005 16:29:39 -0400 Subject: [Pythonmac-SIG] Errors with simple_plot in matplotlib: type is wrong for / operator? In-Reply-To: <87u0ihcocn.fsf@peds-pc311.bsd.uchicago.edu> References: <42E69045.6030308@anvil.nrl.navy.mil> <874qahmk2r.fsf@peds-pc311.bsd.uchicago.edu> <42E699F7.3080802@anvil.nrl.navy.mil> <87u0ihcocn.fsf@peds-pc311.bsd.uchicago.edu> Message-ID: <42E69D33.8040301@anvil.nrl.navy.mil> John Hunter wrote: >>>>>>"Louis" == Louis Pecora writes: >>>>>> >>>>>> > > Louis> numerix Numeric 22.0 > >My guess is that upgrading Numeric will fix this problem. > >JDH > > Bingo!! Upgrading to 23.7 did it. Works fine. Thank you very much. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: pecora at anvil.nrl.navy.mil From chairos at gmail.com Wed Jul 27 08:12:42 2005 From: chairos at gmail.com (Jon Rosebaugh) Date: Wed, 27 Jul 2005 01:12:42 -0500 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? Message-ID: I'm wondering how many of the many GUI toolkits for python play really well with Mac OS X, including actual native look, instead of just an Aqua "theme" that doesn't look quite right? I know of PyObjC (which scares me, because Interface Builder and Cocoa scare me; come on, a four-page tutorial with dozens of methods to write just to add a freaking toolbar? This is 2005, not 1995, Apple), PyFltk (which works, but the guy giving the compilation instructions admits he doesn't know much about python or compiling, which makes me a little hesitant to spend effort learning it), PySWT (which looks like it would do the job, but doesn't actually have any explicit Mac support yet, and also appears to not be very mature yet), and, um, that's what I've got. So. What are people using? (And if I've got the wrong impression of PyObjC, I'm happy to be enlightened.) -- Bloggity: http://blog.inklesspen.com/ From bob at redivi.com Wed Jul 27 08:24:40 2005 From: bob at redivi.com (Bob Ippolito) Date: Tue, 26 Jul 2005 20:24:40 -1000 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: References: Message-ID: On Jul 26, 2005, at 8:12 PM, Jon Rosebaugh wrote: > I'm wondering how many of the many GUI toolkits for python play really > well with Mac OS X, including actual native look, instead of just an > Aqua "theme" that doesn't look quite right? > > I know of PyObjC (which scares me, because Interface Builder and Cocoa > scare me; come on, a four-page tutorial with dozens of methods to > write just to add a freaking toolbar? This is 2005, not 1995, Apple), > PyFltk (which works, but the guy giving the compilation instructions > admits he doesn't know much about python or compiling, which makes me > a little hesitant to spend effort learning it), PySWT (which looks > like it would do the job, but doesn't actually have any explicit Mac > support yet, and also appears to not be very mature yet), and, um, > that's what I've got. So. What are people using? (And if I've got the > wrong impression of PyObjC, I'm happy to be enlightened.) You've got the wrong impression of PyObjC. Download it, play with the examples, look at how little code is necessary. Pay particular attention to CoreData and CocoaBindings. -bob From rkern at ucsd.edu Wed Jul 27 08:55:10 2005 From: rkern at ucsd.edu (Robert Kern) Date: Tue, 26 Jul 2005 23:55:10 -0700 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: References: Message-ID: <42E72FCE.30007@ucsd.edu> Jon Rosebaugh wrote: > I'm wondering how many of the many GUI toolkits for python play really > well with Mac OS X, including actual native look, instead of just an > Aqua "theme" that doesn't look quite right? wxPython and Tk are so-so in this regard. They use the real thing underneath for most of their widgets. Layout isn't always the best, though. Qt, AFAICT, just uses an Aqua-like theme as you suggest. > I know of PyObjC (which scares me, because Interface Builder and Cocoa > scare me; come on, a four-page tutorial with dozens of methods to > write just to add a freaking toolbar? This is 2005, not 1995, Apple), > PyFltk (which works, but the guy giving the compilation instructions > admits he doesn't know much about python or compiling, which makes me > a little hesitant to spend effort learning it), PySWT (which looks > like it would do the job, but doesn't actually have any explicit Mac > support yet, and also appears to not be very mature yet), and, um, > that's what I've got. So. What are people using? (And if I've got the > wrong impression of PyObjC, I'm happy to be enlightened.) PyObjC is *the* way to do GUIs for Mac-only programs. Drink the Kool-Aid. Cocoa is probably the best-designed GUI framework I've yet seen. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From mwh at python.net Wed Jul 27 13:05:08 2005 From: mwh at python.net (Michael Hudson) Date: Wed, 27 Jul 2005 12:05:08 +0100 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: (Jon Rosebaugh's message of "Wed, 27 Jul 2005 01:12:42 -0500") References: Message-ID: <2msly01pcr.fsf@starship.python.net> Jon Rosebaugh writes: > (And if I've got the wrong impression of PyObjC, I'm happy to be > enlightened.) You have the wrong impression of PyObjC. Nearly everything is much less of a pain than toolbars :) (AIUI, I haven't actually implemented a toolbar yet...) Cheers, mwh -- I also fondly recall Paris because that's where I learned to debug Zetalisp while drunk. -- Olin Shivers From joaoleao at gmx.net Wed Jul 27 14:15:18 2005 From: joaoleao at gmx.net (=?ISO-8859-1?Q?Jo=E3o_Le=E3o?=) Date: Wed, 27 Jul 2005 13:15:18 +0100 Subject: [Pythonmac-SIG] Fwd: Detecting keystrokes during launch of application References: <66D94E87-716A-412C-A2CF-2F95680A1D03@gmx.net> Message-ID: Not that simple? > Hi, > > I'd like to know what's the best method to detect a keystroke during > the launch of an application. > I have a py2app application with argv emulation enabled and I need > (if it's possible) to know if a certain keyboard key was pressed or > not during initialization. > > Thanks for any help. > Jo?o > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > From delza at livingcode.org Wed Jul 27 18:11:02 2005 From: delza at livingcode.org (Dethe Elza) Date: Wed, 27 Jul 2005 09:11:02 -0700 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: References: Message-ID: <2AABE14A-C41A-4557-9598-62174833CD59@livingcode.org> On 26-Jul-05, at 11:12 PM, Jon Rosebaugh wrote: > I know of PyObjC (which scares me, because Interface Builder and Cocoa > scare me; I also had an initial fear (or perhaps dislike) of Interface Builder to begin with. Once you learn to use it, and PyObjC, you can be incredibly productive. Cocoa is a *big* framework, and has a pretty high learning curve, so one thing I've often found when things weren't working the way I expected is that I was trying too hard, doing too much coding, and needed to just *do it the Cocoa way* and things worked smoothly. This list is quite helpful when you're trying to figure out the Cocoa way, as are some of the (Objective-C) Cocoa-specific mailing lists. --Dethe From Chris.Barker at noaa.gov Wed Jul 27 18:15:45 2005 From: Chris.Barker at noaa.gov (Chris Barker) Date: Wed, 27 Jul 2005 09:15:45 -0700 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: <42E72FCE.30007@ucsd.edu> References: <42E72FCE.30007@ucsd.edu> Message-ID: <42E7B331.5040003@noaa.gov> Robert Kern wrote: > wxPython and Tk are so-so in this regard. They use the real thing > underneath for most of their widgets. Really? TK sure didn't used to do this.And does it use an native higher level widgets? In any case, I haven't used TK in a long time, but everything I've seen indicates that wxPython is far more native. It's a better toolkit anyway, unless you need TK's canvas or Text Widget. (even then, between OGL, FloatCanvas and STC, you may be better off with wx) > Layout isn't always the best, > though. But it's pretty darn good. I love wx.Sizers. Most wxPython apps are originally written on other platforms, designed by people that have more experience on other platforms. As a result you get apps that don't look very Mac-like. The toolkit itself has its limitations, but with careful design, you can get a very Mac-like app with wxPython. That being said, PyObjC is probably a better choice for Mac-only apps, but I am not in a position to write Mac-only apps. Do you really want to be platform dependent? -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 at noaa.gov From chairos at gmail.com Wed Jul 27 18:53:22 2005 From: chairos at gmail.com (Jon Rosebaugh) Date: Wed, 27 Jul 2005 11:53:22 -0500 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: References: Message-ID: Where's the documentation? The webpage has a PyObjC version of Apple's CurrencyConverter tutorial, which really doesn't teach you much except how to align and connect things in IB and run py2app. The examples (well, at least the iClass example, which appears to be the most relevant one to my current needs) have no comments, so the only way to know for sure if a particular line of code is required for the class to work, or if it's just there to make life easier for the programmer is trial and error. I'm trying to figure out how TableViews work right now, and neither the apple documentation nor the iClass example is being very helpful. This reminds me of trying to learn Twisted. On 7/27/05, Bob Ippolito wrote: > You've got the wrong impression of PyObjC. Download it, play with > the examples, look at how little code is necessary. Pay particular > attention to CoreData and CocoaBindings. > > -bob > > -- Bloggity: http://blog.inklesspen.com/ From phil at bubblehouse.org Wed Jul 27 19:48:39 2005 From: phil at bubblehouse.org (Phil Christensen) Date: Wed, 27 Jul 2005 13:48:39 -0400 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: References: Message-ID: <0A0626F8-BDCB-4116-A371-A427D07F7CEF@bubblehouse.org> you must be new here. ;-) On Jul 27, 2005, at 12:53 PM, Jon Rosebaugh wrote: > Where's the documentation? [snip snip snip] > This reminds me of trying to learn Twisted. > > On 7/27/05, Bob Ippolito wrote: > >> You've got the wrong impression of PyObjC. Download it, play with >> the examples, look at how little code is necessary. Pay particular >> attention to CoreData and CocoaBindings. >> >> -bob >> >> >> > > > -- > Bloggity: http://blog.inklesspen.com/ > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From dangoor at gmail.com Wed Jul 27 19:49:23 2005 From: dangoor at gmail.com (Kevin Dangoor) Date: Wed, 27 Jul 2005 13:49:23 -0400 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: References: Message-ID: <3f085ecd050727104920853c0a@mail.gmail.com> Actually, PyObjC is about as documented as it needs to be, particularly if you start with Bob's more recent intro doc: http://bob.pythonmac.org/archives/2005/07/05/pyobjc-first-steps/ Once you learn the PyObjC conventions, the only trickery at that point is being able to read a bit of Objective-C and the API docs that are out there. PyObjC is a bridge, so the idea is that whatever you do in ObjC, you can now do in Python. Kevin On 7/27/05, Jon Rosebaugh wrote: > Where's the documentation? The webpage has a PyObjC version of Apple's > CurrencyConverter tutorial, which really doesn't teach you much except > how to align and connect things in IB and run py2app. The examples > (well, at least the iClass example, which appears to be the most > relevant one to my current needs) have no comments, so the only way to > know for sure if a particular line of code is required for the class > to work, or if it's just there to make life easier for the programmer > is trial and error. I'm trying to figure out how TableViews work right > now, and neither the apple documentation nor the iClass example is > being very helpful. > > This reminds me of trying to learn Twisted. From bob at redivi.com Thu Jul 28 00:38:22 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 27 Jul 2005 12:38:22 -1000 Subject: [Pythonmac-SIG] Solid GUI toolkits for Mac? In-Reply-To: <3f085ecd050727104920853c0a@mail.gmail.com> References: <3f085ecd050727104920853c0a@mail.gmail.com> Message-ID: That's actually part of the intro documentation, it's just not on the site since it was written after the last version was released: http://svn.red-bean.com/pyobjc/trunk/pyobjc/Doc/intro.html The intro documentation should be all you need to be able to understand PyObjC and get started reading Apple's Cocoa documentation. -bob On Jul 27, 2005, at 7:49 AM, Kevin Dangoor wrote: > Actually, PyObjC is about as documented as it needs to be, > particularly if you start with Bob's more recent intro doc: > > http://bob.pythonmac.org/archives/2005/07/05/pyobjc-first-steps/ > > Once you learn the PyObjC conventions, the only trickery at that point > is being able to read a bit of Objective-C and the API docs that are > out there. PyObjC is a bridge, so the idea is that whatever you do in > ObjC, you can now do in Python. > > Kevin > > On 7/27/05, Jon Rosebaugh wrote: > >> Where's the documentation? The webpage has a PyObjC version of >> Apple's >> CurrencyConverter tutorial, which really doesn't teach you much >> except >> how to align and connect things in IB and run py2app. The examples >> (well, at least the iClass example, which appears to be the most >> relevant one to my current needs) have no comments, so the only >> way to >> know for sure if a particular line of code is required for the class >> to work, or if it's just there to make life easier for the programmer >> is trial and error. I'm trying to figure out how TableViews work >> right >> now, and neither the apple documentation nor the iClass example is >> being very helpful. >> >> This reminds me of trying to learn Twisted. >> > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From n8gray at gmail.com Thu Jul 28 03:48:56 2005 From: n8gray at gmail.com (Nathaniel Gray) Date: Wed, 27 Jul 2005 18:48:56 -0700 Subject: [Pythonmac-SIG] Appscript and keystrokes Message-ID: I'm trying to use Appscript to send keystrokes to iPhoto (sadly, there's no other way to get the job done), but I can't figure out how to make it work. I thought it should work like this: ipe = app("System Events").processes['iPhoto'] ipe.keystroke(u"foo") But this yields the error: >>> ipe.keystroke(u"foo") ------------------------------------------------------------ Traceback (most recent call last): File "", line 1, in ? File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site-packages/appscript/specifier.py", line 203, in __call__ raise CommandError(self, (args, kargs), e) CommandError: Too many direct parameters: command was called on a reference but already has a direct parameter. Failed command: app(u'/System/Library/CoreServices/System Events.app').processes['iPhoto'].keystroke(u'foo') Does anybody know the magic words? I'm using Tiger, Python 2.3 (stock), appscript 0.13.0. Cheers, -n8 -- >>>-- Nathaniel Gray -- Caltech Computer Science ------> >>>-- Mojave Project -- http://mojave.cs.caltech.edu --> From bob at redivi.com Thu Jul 28 04:43:21 2005 From: bob at redivi.com (Bob Ippolito) Date: Wed, 27 Jul 2005 16:43:21 -1000 Subject: [Pythonmac-SIG] Appscript and keystrokes In-Reply-To: References: Message-ID: <8384E9C8-931F-4E18-9C16-1A1944E71F19@redivi.com> On Jul 27, 2005, at 3:48 PM, Nathaniel Gray wrote: > I'm trying to use Appscript to send keystrokes to iPhoto (sadly, > there's no other way to get the job done), but I can't figure out how > to make it work. I thought it should work like this: > > ipe = app("System Events").processes['iPhoto'] > ipe.keystroke(u"foo") > > But this yields the error: > >>>> ipe.keystroke(u"foo") >>>> > ------------------------------------------------------------ > Traceback (most recent call last): > File "", line 1, in ? > File "/System/Library/Frameworks/Python.framework/Versions/2.3/ > lib/python2.3/site-packages/appscript/specifier.py", > line 203, in __call__ > raise CommandError(self, (args, kargs), e) > CommandError: Too many direct parameters: command was called on a > reference but already has a direct parameter. > Failed command: app(u'/System/Library/CoreServices/System > Events.app').processes['iPhoto'].keystroke(u'foo') This error sounds like it wants you to pass a keyword argument instead of a positional argument ("direct parameter" in Apple Event speak). I don't know much about appscript and I don't have iPhoto installed so I can't provide any specific advice. -bob From hengist.podd at virgin.net Thu Jul 28 05:20:12 2005 From: hengist.podd at virgin.net (has) Date: Thu, 28 Jul 2005 04:20:12 +0100 Subject: [Pythonmac-SIG] Appscript and keystrokes Message-ID: Nathaniel Gray wrote: >I'm trying to use Appscript to send keystrokes to iPhoto (sadly, >there's no other way to get the job done), but I can't figure out how >to make it work. I thought it should work like this: > >ipe = app("System Events").processes['iPhoto'] >ipe.keystroke(u"foo") As Bob says, application commands can take a maximum of one direct parameter, and invoking a command on any reference other than app('...') tells appscript to use that reference as the direct parameter, hence the 'too many direct parameters' error in the above. (Suggestions for making error messages easier to understand arealways welcome , of course.) Anyway, appscript's help() system is your friend, although System Events' dictionary is a bit vague in this instance: Command: keystroke(...) -- cause the target process to behave as if keystrokes were entered Unicode -- The keystrokes to be sent. [using=k.command_down | k.control_down | k.option_down | k.shift_down] -- modifiers with which the keystrokes are to be entered The key phrase is 'target process'; which in GUI Scripting terms is the front process. And since the command doesn't take a reference to the target application's GUI objects, one can deduce that 'keystroke' should be called on System Events' app object, which will automatically pass those keystrokes to whatever application is frontmost at the time: app('iPhoto').activate() app('System Events').keystroke('foo') Sorted. Sherlock Holmes would've loved this stuff. :p has -- http://freespace.virgin.net/hamish.sanderson/ From andreas.voellmy at gmail.com Thu Jul 28 16:50:04 2005 From: andreas.voellmy at gmail.com (Andreas Voellmy) Date: Thu, 28 Jul 2005 08:50:04 -0600 Subject: [Pythonmac-SIG] Hello; F2PY Message-ID: Hello, I'm new to the list. I'm wondering if anyone on the list has any experience using f2py (http://cens.ioc.ee/projects/f2py2e/) on the mac os x? I would like to use it so that I can access functions written in fortran in python. I'm having trouble getting it working on tiger. I'm just working on the hello world example and haven't gotten it to compile correctly yet. gcc in mac os x apparently has the fortran compiler removed or turned off. So I am using a port of gfortran to compile my fortran. i've gotten f2py to compile a shared library using gfortran, but when I load it into python it has a fatal error and suggests that i may not have compiled the library under the right version. This makes sense. I compiled with gfortran, part of gcc 4.0, while python on my mac is compiled under gcc 3.4. I haven't yet been able to get around this issue. I'd love to hear from anyone who has experience with this topic. I can send more detailed info if anyone is interested. Thanks, Andreas From rkern at ucsd.edu Thu Jul 28 21:15:02 2005 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 28 Jul 2005 12:15:02 -0700 Subject: [Pythonmac-SIG] Hello; F2PY In-Reply-To: References: Message-ID: <42E92EB6.2020201@ucsd.edu> Andreas Voellmy wrote: > Hello, I'm new to the list. > > I'm wondering if anyone on the list has any experience using f2py > (http://cens.ioc.ee/projects/f2py2e/) on the mac os x? I would like > to use it so that I can access functions written in fortran in > python. I'm having trouble getting it working on tiger. I'm just > working on the hello world example and haven't gotten it to compile > correctly yet. > > gcc in mac os x apparently has the fortran compiler removed or turned > off. So I am using a port of gfortran to compile my fortran. i've > gotten f2py to compile a shared library using gfortran, but when I > load it into python it has a fatal error and suggests that i may not > have compiled the library under the right version. This makes sense. > I compiled with gfortran, part of gcc 4.0, while python on my mac is > compiled under gcc 3.4. I haven't yet been able to get around this > issue. It works very well using g77-3.4 from http://hpc.sf.net with gcc-3.3 on Tiger. The gfortran support is a little flaky, I believe. Hell, gfortran is a little flaky. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From leknarf at pacbell.net Fri Jul 29 05:50:58 2005 From: leknarf at pacbell.net (Scott Frankel) Date: Thu, 28 Jul 2005 20:50:58 -0700 Subject: [Pythonmac-SIG] late start with tiger Message-ID: <04fdf34e09adb2046617427c6eba462c@pacbell.net> I've just migrated a machine to Tiger and have a question about the "official unofficial" mac version of python.2.4.1. Why would /usr/bin/python still be linked to python2.3 after the install? I downloaded and installed MacPython 2.4.1 from undefined.org. I also downloaded and installed both TigerPython24Fix and TigerPython23Compat. If I execute python 2.4 using an explicit path to /Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4, then python2.4 launches happily (with readlines!). But if I execute the python specified in my env (i.e.: /usr/bin/python), python2.3 launches due to the link. Thanks in advance! Scott From rkern at ucsd.edu Fri Jul 29 05:55:22 2005 From: rkern at ucsd.edu (Robert Kern) Date: Thu, 28 Jul 2005 20:55:22 -0700 Subject: [Pythonmac-SIG] late start with tiger In-Reply-To: <04fdf34e09adb2046617427c6eba462c@pacbell.net> References: <04fdf34e09adb2046617427c6eba462c@pacbell.net> Message-ID: <42E9A8AA.6020305@ucsd.edu> Scott Frankel wrote: > I've just migrated a machine to Tiger and have a question about the > "official unofficial" mac version of python.2.4.1. > > Why would /usr/bin/python still be linked to python2.3 after the > install? Because we shouldn't mess with Apple's stuff. /usr/bin is off-limits. The Python 2.4.1 installer installs /usr/local/bin/python /usr/local/bin/python2.4 /usr/local/bin/pythonw /usr/local/bin/pythonw2.4 > I downloaded and installed MacPython 2.4.1 from undefined.org. I also > downloaded and installed both TigerPython24Fix and TigerPython23Compat. > If I execute python 2.4 using an explicit path to > /Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4, then > python2.4 launches happily (with readlines!). But if I execute the > python specified in my env (i.e.: /usr/bin/python), python2.3 launches > due to the link. Put /usr/local/bin early in your PATH environment variable. -- Robert Kern rkern at ucsd.edu "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter From chairos at gmail.com Fri Jul 29 21:12:06 2005 From: chairos at gmail.com (Jon Rosebaugh) Date: Fri, 29 Jul 2005 14:12:06 -0500 Subject: [Pythonmac-SIG] Problems with Notifications in PyObjC Message-ID: I hope this is an acceptable place for PyObjC problems... Anyhow, I have a small project I'm working on (zip available at http://li5-50.members.linode.com/~jon/NoteDB/NoteDB.zip), and notifications aren't working out for me. I think. I have a delegate for a NSTableView, and my tableViewSelectionDidChange_ method isn't being called, while other delegate methods are. I also have tried to subclass NSTableView, in accordance with the directions here (http://borkware.com/quickies/one?topic=NSTableView), but that subclass isn't receiving the textDidEndEditing_ notification either. Since the only things these have in common is that they are notifications, the only idea I have is that I'm neglecting something crucial for notifications, but the PyObjC docs don't indicate that I need to do anything special. Thanks in advance for any help. -- Bloggity: http://blog.inklesspen.com/ From chairos at gmail.com Fri Jul 29 23:07:38 2005 From: chairos at gmail.com (Jon Rosebaugh) Date: Fri, 29 Jul 2005 16:07:38 -0500 Subject: [Pythonmac-SIG] Problems with Notifications in PyObjC In-Reply-To: References: Message-ID: Um, ignore this. Boy, do I feel stupid now. On 7/29/05, Jon Rosebaugh wrote: > I hope this is an acceptable place for PyObjC problems... > Anyhow, I have a small project I'm working on (zip available at > http://li5-50.members.linode.com/~jon/NoteDB/NoteDB.zip), and > notifications aren't working out for me. I think. I have a delegate > for a NSTableView, and my tableViewSelectionDidChange_ method isn't > being called, while other delegate methods are. > I also have tried to subclass NSTableView, in accordance with the > directions here (http://borkware.com/quickies/one?topic=NSTableView), > but that subclass isn't receiving the textDidEndEditing_ notification > either. Since the only things these have in common is that they are > notifications, the only idea I have is that I'm neglecting something > crucial for notifications, but the PyObjC docs don't indicate that I > need to do anything special. > > Thanks in advance for any help. > -- > Bloggity: http://blog.inklesspen.com/ > -- Bloggity: http://blog.inklesspen.com/ From delza at livingcode.org Fri Jul 29 23:22:33 2005 From: delza at livingcode.org (Dethe Elza) Date: Fri, 29 Jul 2005 14:22:33 -0700 Subject: [Pythonmac-SIG] Problems with Notifications in PyObjC In-Reply-To: References: Message-ID: <3DCF1443-96CA-4515-A8BE-22CCED23089B@livingcode.org> What was the real problem? --Dethe On 29-Jul-05, at 2:07 PM, Jon Rosebaugh wrote: > Um, ignore this. Boy, do I feel stupid now. > > On 7/29/05, Jon Rosebaugh wrote: > >> I hope this is an acceptable place for PyObjC problems... >> Anyhow, I have a small project I'm working on (zip available at >> http://li5-50.members.linode.com/~jon/NoteDB/NoteDB.zip), and >> notifications aren't working out for me. I think. I have a delegate >> for a NSTableView, and my tableViewSelectionDidChange_ method isn't >> being called, while other delegate methods are. >> I also have tried to subclass NSTableView, in accordance with the >> directions here (http://borkware.com/quickies/one?topic=NSTableView), >> but that subclass isn't receiving the textDidEndEditing_ notification >> either. Since the only things these have in common is that they are >> notifications, the only idea I have is that I'm neglecting something >> crucial for notifications, but the PyObjC docs don't indicate that I >> need to do anything special. >> >> Thanks in advance for any help. >> -- >> Bloggity: http://blog.inklesspen.com/ >> >> > > > -- > Bloggity: http://blog.inklesspen.com/ > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > We are, after all, the junk tribe and we like to make junk. If we don't make more junk each year we call it a recession. --Rich Gold -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2488 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20050729/d40146d1/smime.bin From jerlefebvre at videotron.ca Fri Jul 29 06:22:40 2005 From: jerlefebvre at videotron.ca (Jerome Lefebvre) Date: Fri, 29 Jul 2005 00:22:40 -0400 Subject: [Pythonmac-SIG] pyObjC examples pkg Message-ID: <344C9547-88CD-4BE1-8FD3-620118A87B9F@videotron.ca> I just downloaded pyObjC 1.3.7 on a fresh installation of Tiger. I ran the mkpg, everything seemed fine but the examples didn't show up in a /Developer/Python/ as the docs said and spotlight couldn't find anything. So I ran the example pkg on it's own, but still nothing appeared. I poked in the info.plist of the example pkg and changed IFPkgFlagDefaultLocation from /Volumes/Data/Developer/Python/PyObjC/ Examples to /Developer/Python/PyObjC/Examples . Ran the example pkg and it now the examples were there and they builded/ran fine. Anybody have an idea of what could have happened here? Jerome From bob at redivi.com Sat Jul 30 00:17:35 2005 From: bob at redivi.com (Bob Ippolito) Date: Fri, 29 Jul 2005 12:17:35 -1000 Subject: [Pythonmac-SIG] pyObjC examples pkg In-Reply-To: <344C9547-88CD-4BE1-8FD3-620118A87B9F@videotron.ca> References: <344C9547-88CD-4BE1-8FD3-620118A87B9F@videotron.ca> Message-ID: <6A69A15C-9D77-4AE5-B4D8-3906E4634329@redivi.com> On Jul 28, 2005, at 6:22 PM, Jerome Lefebvre wrote: > I just downloaded pyObjC 1.3.7 on a fresh installation of Tiger. I > ran the mkpg, everything seemed fine but the examples didn't show up > in a /Developer/Python/ as the docs said and spotlight couldn't find > anything. So I ran the example pkg on it's own, but still nothing > appeared. I poked in the info.plist of the example pkg and changed > IFPkgFlagDefaultLocation from /Volumes/Data/Developer/Python/PyObjC/ > Examples to /Developer/Python/PyObjC/Examples . Ran the example pkg > and it now the examples were there and they builded/ran fine. > > Anybody have an idea of what could have happened here? bdist_mpkg uses os.path.realpath() to work around some weirdness with the way that Apple has organized Python and to detect the permissions it should be using. Unfortunately, Ronald has /Developer as a symlink to that path instead, so when he built the package bdist_mpkg decided to put it there. -bob From chairos at gmail.com Sat Jul 30 05:47:53 2005 From: chairos at gmail.com (Jon Rosebaugh) Date: Fri, 29 Jul 2005 22:47:53 -0500 Subject: [Pythonmac-SIG] Problems with Notifications in PyObjC In-Reply-To: <3DCF1443-96CA-4515-A8BE-22CCED23089B@livingcode.org> References: <3DCF1443-96CA-4515-A8BE-22CCED23089B@livingcode.org> Message-ID: Most of it involved me forgetting to watch Console.app for errors in my code. One of my more common problems is forgetting to add self to the argument list for class methods, and that's one of the problems that happened. I didn't know, though, that exceptions often get dropped in notification calls... Maybe that should be in PyObjC docs? I had to get told by someone on #macpython. On 7/29/05, Dethe Elza wrote: > What was the real problem? > > --Dethe > > On 29-Jul-05, at 2:07 PM, Jon Rosebaugh wrote: > > > Um, ignore this. Boy, do I feel stupid now. > > > > On 7/29/05, Jon Rosebaugh wrote: > > > >> I hope this is an acceptable place for PyObjC problems... > >> Anyhow, I have a small project I'm working on (zip available at > >> http://li5-50.members.linode.com/~jon/NoteDB/NoteDB.zip), and > >> notifications aren't working out for me. I think. I have a delegate > >> for a NSTableView, and my tableViewSelectionDidChange_ method isn't > >> being called, while other delegate methods are. > >> I also have tried to subclass NSTableView, in accordance with the > >> directions here (http://borkware.com/quickies/one?topic=NSTableView), > >> but that subclass isn't receiving the textDidEndEditing_ notification > >> either. Since the only things these have in common is that they are > >> notifications, the only idea I have is that I'm neglecting something > >> crucial for notifications, but the PyObjC docs don't indicate that I > >> need to do anything special. > >> > >> Thanks in advance for any help. > >> -- > >> Bloggity: http://blog.inklesspen.com/ > >> > >> > > > > > > -- > > Bloggity: http://blog.inklesspen.com/ > > _______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > > > We are, after all, the junk tribe and we like to make junk. If we > don't make more junk each year we call it a recession. --Rich Gold > > > > -- Bloggity: http://blog.inklesspen.com/ From bob at redivi.com Sat Jul 30 06:15:35 2005 From: bob at redivi.com (Bob Ippolito) Date: Fri, 29 Jul 2005 18:15:35 -1000 Subject: [Pythonmac-SIG] Problems with Notifications in PyObjC In-Reply-To: References: <3DCF1443-96CA-4515-A8BE-22CCED23089B@livingcode.org> Message-ID: <9A5DA0F5-A2E8-41DC-AAF8-52C8FF179D76@redivi.com> If you're running with the USE_PDB environment variable set and are using AppHelper.runEventLoop then it will enable exception spewing. It's in the tutorial, I don't know where else it's mentioned (if anywhere). -bob On Jul 29, 2005, at 5:47 PM, Jon Rosebaugh wrote: > Most of it involved me forgetting to watch Console.app for errors in > my code. One of my more common problems is forgetting to add self to > the argument list for class methods, and that's one of the problems > that happened. I didn't know, though, that exceptions often get > dropped in notification calls... Maybe that should be in PyObjC docs? > I had to get told by someone on #macpython. > > On 7/29/05, Dethe Elza wrote: > >> What was the real problem? >> >> --Dethe >> >> On 29-Jul-05, at 2:07 PM, Jon Rosebaugh wrote: >> >> >>> Um, ignore this. Boy, do I feel stupid now. >>> >>> On 7/29/05, Jon Rosebaugh wrote: >>> >>> >>>> I hope this is an acceptable place for PyObjC problems... >>>> Anyhow, I have a small project I'm working on (zip available at >>>> http://li5-50.members.linode.com/~jon/NoteDB/NoteDB.zip), and >>>> notifications aren't working out for me. I think. I have a delegate >>>> for a NSTableView, and my tableViewSelectionDidChange_ method isn't >>>> being called, while other delegate methods are. >>>> I also have tried to subclass NSTableView, in accordance with the >>>> directions here (http://borkware.com/quickies/one? >>>> topic=NSTableView), >>>> but that subclass isn't receiving the textDidEndEditing_ >>>> notification >>>> either. Since the only things these have in common is that they are >>>> notifications, the only idea I have is that I'm neglecting >>>> something >>>> crucial for notifications, but the PyObjC docs don't indicate >>>> that I >>>> need to do anything special. >>>> >>>> Thanks in advance for any help. >>>> -- >>>> Bloggity: http://blog.inklesspen.com/ >>>> >>>> >>>> >>> >>> >>> -- >>> Bloggity: http://blog.inklesspen.com/ >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >>> >>> >> >> >> We are, after all, the junk tribe and we like to make junk. If we >> don't make more junk each year we call it a recession. --Rich Gold >> >> >> >> >> > > > -- > Bloggity: http://blog.inklesspen.com/ > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From fonnesbeck at gmail.com Sat Jul 30 16:27:56 2005 From: fonnesbeck at gmail.com (Chris Fonnesbeck) Date: Sat, 30 Jul 2005 10:27:56 -0400 Subject: [Pythonmac-SIG] memory allocation issue Message-ID: <723eb69305073007274b6a4cdc@mail.gmail.com> I have a Bayesian simulation package, PyMC, that I run on OSX 10.4 using either Python 2.3.5 or the ActiveState 2.4. It essentially generates long sample arrays of parameter values, which it then summarizes at the end (I am using Numeric arrays). However, after a simulation of only 80K iterations (for about 7 parameters), I start running into memory allocation problems: python(22156,0xa000ef98) malloc: *** vm_allocate(size=1400324096) failed (error code=3) python(22156,0xa000ef98) malloc: *** error: can't allocate region python(22156,0xa000ef98) malloc: *** set a breakpoint in szone_error to debug Traceback (most recent call last): File "", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PyMC/MCMC.py", line 1768, in sample except KeyboardInterrupt: File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PyMC/MCMC.py", line 1286, in summary } File "/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PyMC/MCMC.py", line 260, in get_trace return array([x for i, x in enumerate(self._trace[start:end])]) MemoryError: can't allocate memory for array This doesnt seem like a lot of data, so I am wondering what the problem might be. Should I be using numarray instead -- it sounds like I would take a performance hit if I did. Any guidance here would be most helpful. Thanks, Chris From bob at redivi.com Sun Jul 31 04:30:12 2005 From: bob at redivi.com (Bob Ippolito) Date: Sat, 30 Jul 2005 16:30:12 -1000 Subject: [Pythonmac-SIG] memory allocation issue In-Reply-To: <723eb69305073007274b6a4cdc@mail.gmail.com> References: <723eb69305073007274b6a4cdc@mail.gmail.com> Message-ID: <71D9441A-F9F5-4734-872D-B8ABC64B0EDA@redivi.com> On Jul 30, 2005, at 4:27 AM, Chris Fonnesbeck wrote: > I have a Bayesian simulation package, PyMC, that I run on OSX 10.4 > using either Python 2.3.5 or the ActiveState 2.4. It essentially > generates long sample arrays of parameter values, which it then > summarizes at the end (I am using Numeric arrays). However, after a > simulation of only 80K iterations (for about 7 parameters), I start > running into memory allocation problems: > > python(22156,0xa000ef98) malloc: *** vm_allocate(size=1400324096) > failed (error code=3) > python(22156,0xa000ef98) malloc: *** error: can't allocate region > python(22156,0xa000ef98) malloc: *** set a breakpoint in > szone_error to debug I imagine that the issue here is related to the following: http://bob.pythonmac.org/archives/2005/01/01/realloc-doesnt/ I suggest taking a look for code that creates big objects, resizes them to be smaller, and keeps them around for a bit. The networking code in Python did this for strings in the networking code for a while (you could probably find it by searching for vm_allocate on python-dev archives). -bob