From smartmike1 at gmail.com Mon Aug 1 23:23:43 2011 From: smartmike1 at gmail.com (Mike) Date: Mon, 1 Aug 2011 17:23:43 -0400 Subject: [Pythonmac-SIG] Still Unable to Install PyObjC Message-ID: <5AAB7A5DD34D446C9E05EE86C1795F87@FTXH9K1> Hi, I posted about a month ago and am giving this another shot. Trying to ultimately get my app built with Py2app on my Mac (built this on a different Mac running Leopard in the past). Due to problems I had with Python 2.6, I installed Python 2.7 from python.org. I am now trying to install PyObjC which is needed for my application. I have tried using both easy_install and checking out the source and running setup.py. Either way, I get the following error: running install running bdist_egg running egg_info writing requirements to pyobjc.egg-info/requires.txt writing pyobjc.egg-info/PKG-INFO writing top-level names to pyobjc.egg-info/top_level.txt writing dependency_links to pyobjc.egg-info/dependency_links.txt writing manifest file 'pyobjc.egg-info/SOURCES.txt' installing library code to build/bdist.macosx-10.3-fat/egg running install_lib warning: install_lib: 'build/lib' does not exist -- no Python modules to install creating build/bdist.macosx-10.3-fat/egg creating build/bdist.macosx-10.3-fat/egg/EGG-INFO copying pyobjc.egg-info/PKG-INFO -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying pyobjc.egg-info/SOURCES.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying pyobjc.egg-info/dependency_links.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying pyobjc.egg-info/requires.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying pyobjc.egg-info/top_level.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO copying pyobjc.egg-info/zip-safe -> build/bdist.macosx-10.3-fat/egg/EGG-INFO creating 'dist/pyobjc-2.4a0-py2.7.egg' and adding 'build/bdist.macosx-10.3-fat/egg' to it removing 'build/bdist.macosx-10.3-fat/egg' (and everything under it) Processing pyobjc-2.4a0-py2.7.egg removing '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyobjc-2.4a0-py2.7.egg' (and everything under it) creating /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyobjc-2.4a0-py2.7.egg Extracting pyobjc-2.4a0-py2.7.egg to /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages pyobjc 2.4a0 is already the active version in easy-install.pth Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyobjc-2.4a0-py2.7.egg Processing dependencies for pyobjc==2.4a0 Searching for pyobjc-framework-ServiceManagement==2.4a0 Reading http://pypi.python.org/simple/pyobjc-framework-ServiceManagement/ Reading http://pyobjc.sourceforge.net No local packages or download links found for pyobjc-framework-ServiceManagement==2.4a0 error: Could not find suitable distribution for Requirement.parse('pyobjc-framework-ServiceManagement==2.4a0') I'm running Lion, upgraded from Snow Leopard, but I had this same problem on SL as well. Can anyone help with this? Thanks, Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From ronaldoussoren at mac.com Tue Aug 2 11:25:16 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Tue, 02 Aug 2011 11:25:16 +0200 Subject: [Pythonmac-SIG] OS X 10.7 Lion, py2app 0.6.3, argv-emulation, wxPython In-Reply-To: <4E348894.2050603@hoech.org> References: <4E348894.2050603@hoech.org> Message-ID: On 31 Jul, 2011, at 0:41, Florian H?ch wrote: > In 10.7, some functionality of the Carbon libraries is only available in 32-bit mode, but py2app created binaries run in 64-bit mode on Lion. In my case wx and py2app's argv-emulation feature needed Carbon functionality that isn't available in 64-bit mode, so I did work around this by replacing the binaries with 32-bit ones after the app was created. > > First, I used the official python.org Python 2.7 x86-64/i386 installer. > Then I built my app with the 32-bit python: > > python2.7-32 setup.py p2app > > Then I replaced the binaries in the app: > > cp /Library/Python/2.7/site-packages/py2app-0.6.3-py2.7.egg/py2app/apptemplate/prebuilt/main-i386 /PATH/TO/APP/APPNAME.app/Contents/MacOS/APPNAME > > cp /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-32 /PATH/TO/APP/APPNAME.app/Contents/MacOS/python > > Just thought I'd share my findings. The py2app repository contains a version of the argv emulator that works in 64-bit mode. I have to rebuild the executable stubs on a 10.6 system with Xcode 3 before I can release that version, that should hopefully happen later this week. Ronald > > Regards > -- > Florian H?ch > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From glchriste at gmail.com Tue Aug 2 13:27:57 2011 From: glchriste at gmail.com (Grace) Date: Tue, 2 Aug 2011 11:27:57 +0000 (UTC) Subject: [Pythonmac-SIG] py2app issue with wx References: <9D1116A5-8194-479B-946F-43BFC8EFEC8E@gmail.com> Message-ID: I had the same problem. Go to that lib folder and see if you can find a folder that says "python7.0." It probably doesn't exist, but you should have a folder named pythonx.x. Duplicate pythonx.x and rename it to python7.0. Run py2app again. Problem solved. From lists+Pythonmac-SIG at hoech.org Tue Aug 2 15:46:34 2011 From: lists+Pythonmac-SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Tue, 02 Aug 2011 15:46:34 +0200 Subject: [Pythonmac-SIG] OS X 10.7 Lion, py2app 0.6.3, argv-emulation, wxPython In-Reply-To: References: <4E348894.2050603@hoech.org> Message-ID: <4E37FFBA.3050907@hoech.org> Am 02.08.2011 11:25, schrieb Ronald Oussoren: > > On 31 Jul, 2011, at 0:41, Florian H?ch wrote: > >> In 10.7, some functionality of the Carbon libraries is only >> available in 32-bit mode, but py2app created binaries run in 64-bit >> mode on Lion. In my case wx and py2app's argv-emulation feature >> needed Carbon functionality that isn't available in 64-bit mode, so >> I did work around this by replacing the binaries with 32-bit ones >> after the app was created. >> >> First, I used the official python.org Python 2.7 x86-64/i386 >> installer. Then I built my app with the 32-bit python: >> >> python2.7-32 setup.py p2app >> >> Then I replaced the binaries in the app: >> >> cp >> /Library/Python/2.7/site-packages/py2app-0.6.3-py2.7.egg/py2app/apptemplate/prebuilt/main-i386 >> /PATH/TO/APP/APPNAME.app/Contents/MacOS/APPNAME >> >> cp >> /Library/Frameworks/Python.framework/Versions/2.7/bin/python2.7-32 >> /PATH/TO/APP/APPNAME.app/Contents/MacOS/python >> >> Just thought I'd share my findings. > > The py2app repository contains a version of the argv emulator that > works in 64-bit mode. I have to rebuild the executable stubs on a > 10.6 system with Xcode 3 before I can release that version, that > should hopefully happen later this week. Thanks, good to know. Even though personally I don't need 64-bit support yet, as wxPython currently only works in 32-bit mode on the Mac, so atm I'm limited by that. In my case it's not an issue, thankfully. > Ronald >> >> Regards -- Florian H?ch >> >> _______________________________________________ Pythonmac-SIG >> maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig unsubscribe: >> http://mail.python.org/mailman/options/Pythonmac-SIG > -- Florian H?ch From Chris.Barker at noaa.gov Tue Aug 2 18:43:05 2011 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 02 Aug 2011 09:43:05 -0700 Subject: [Pythonmac-SIG] OS X 10.7 Lion, py2app 0.6.3, argv-emulation, wxPython In-Reply-To: <4E37FFBA.3050907@hoech.org> References: <4E348894.2050603@hoech.org> <4E37FFBA.3050907@hoech.org> Message-ID: <4E382919.9070909@noaa.gov> On 8/2/11 6:46 AM, Florian H?ch wrote: > Thanks, good to know. Even though personally I don't need 64-bit support > yet, as wxPython currently only works in 32-bit mode on the Mac, wxPython2.9 (still "unstable") is built on Cocoa, and support 64 bit. http://www.wxpython.org/download.php#unstable So it's coming soon, and the more people that test it now, the better. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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 aragost at gmail.com Thu Aug 4 01:14:43 2011 From: aragost at gmail.com (Agos) Date: Thu, 4 Aug 2011 01:14:43 +0200 Subject: [Pythonmac-SIG] py2app issue with wx In-Reply-To: References: <9D1116A5-8194-479B-946F-43BFC8EFEC8E@gmail.com> Message-ID: <7EEFCEFD-C582-4BDC-A41C-BE30205A9414@gmail.com> Il giorno 02/ago/2011, alle ore 13:27, Grace ha scritto: > I had the same problem. > Go to that lib folder and see if you can find > a folder that says "python7.0." It > probably doesn't exist, but you should have > a folder named pythonx.x. > Duplicate pythonx.x and rename > it to python7.0. Run py2app again. > Problem solved. Grace, thanks for the reply. Unfortunately, on my Mac I do have the python7.0 folder - that's where the library reference comes from -, since it's the path where the Python distribution was installed. The libs inside that directory DO get copied inside the bundle, but at load time the program looks for them at the ?original? path, which isn't available on a normal mac. From alexj at businessabstraction.com Mon Aug 1 02:55:38 2011 From: alexj at businessabstraction.com (Alex Jouravlev) Date: Mon, 01 Aug 2011 10:55:38 +1000 (EST) Subject: [Pythonmac-SIG] Python on iphone for developers Message-ID: <010c01cc4fe5$bb132180$31396480$@com> Hi, Sorry if misplaced. I am trying to find some information Is there a port of Python to iPhone? I want to be able to check-out from SVN, edit and run some Python server code now and then. I know iOS is a closed ecosystem, however as Developer one can build and install virtually anything on their iPhone. All you need is source code compatible with iOS (preferably 2.7) Thank you, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrewwu at gmail.com Tue Aug 2 18:25:28 2011 From: andrewwu at gmail.com (Andrew Wu) Date: Tue, 2 Aug 2011 09:25:28 -0700 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 100, Issue 1 In-Reply-To: References: Message-ID: Hi Mike, See if this will help: 1. Grab the latest stable release from the repository via svn: % svn checkout http://svn.red-bean.com/pyobjc/trunk This will locate the source tree in the current directory under a new subdirectory 'trunk' 2. cd?into trunk/pyobjc 3. Make a backup copy of?02-develop-all.sh 4. Edit?02-develop-all.sh?and substitute 'python' for 'python2.5'?(or the absolute path to your custom install of python) 5. Run the shell script?02-develop-all.sh?(I believe that by default pyobjc is compiled with debugging symbols enabled) 6. When the script has completed, add the path to the pyobjc trunk's subdirectory?pyobjc?to PYTHONPATH: export PYTHONPATH=$PYTHONPATH:/path/to/pyobjc/trunk/pyobjc (At least this is how I got a downloaded copy of pyobjc to work for me with a custom build of python ...) Andrew On Tue, Aug 2, 2011 at 3:00 AM, wrote: > > Send Pythonmac-SIG mailing list submissions to > ? ? ? ?pythonmac-sig at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > ? ? ? ?http://mail.python.org/mailman/listinfo/pythonmac-sig > or, via email, send a message with subject or body 'help' to > ? ? ? ?pythonmac-sig-request at python.org > > You can reach the person managing the list at > ? ? ? ?pythonmac-sig-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Pythonmac-SIG digest..." > > Today's Topics: > > ? 1. Still Unable to Install PyObjC (Mike) > > > ---------- Forwarded message ---------- > From:?"Mike" > To:? > Date:?Mon, 1 Aug 2011 17:23:43 -0400 > Subject:?[Pythonmac-SIG] Still Unable to Install PyObjC > Hi, > > I posted about a month ago and am giving this another shot. Trying to ultimately get my app built with Py2app on my Mac (built this on a different Mac running Leopard in the past). Due to problems I had with Python 2.6, I installed Python 2.7 from python.org. I am now trying to install PyObjC which is needed for my application. I have tried using both easy_install and checking out the source and running setup.py. Either way, I get the following error: > > > running install > > running bdist_egg > > running egg_info > > writing requirements to pyobjc.egg-info/requires.txt > > writing pyobjc.egg-info/PKG-INFO > > writing top-level names to pyobjc.egg-info/top_level.txt > > writing dependency_links to pyobjc.egg-info/dependency_links.txt > > writing manifest file 'pyobjc.egg-info/SOURCES.txt' > > installing library code to build/bdist.macosx-10.3-fat/egg > > running install_lib > > warning: install_lib: 'build/lib' does not exist -- no Python modules to install > > creating build/bdist.macosx-10.3-fat/egg > > creating build/bdist.macosx-10.3-fat/egg/EGG-INFO > > copying pyobjc.egg-info/PKG-INFO -> build/bdist.macosx-10.3-fat/egg/EGG-INFO > > copying pyobjc.egg-info/SOURCES.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO > > copying pyobjc.egg-info/dependency_links.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO > > copying pyobjc.egg-info/requires.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO > > copying pyobjc.egg-info/top_level.txt -> build/bdist.macosx-10.3-fat/egg/EGG-INFO > > copying pyobjc.egg-info/zip-safe -> build/bdist.macosx-10.3-fat/egg/EGG-INFO > > creating 'dist/pyobjc-2.4a0-py2.7.egg' and adding 'build/bdist.macosx-10.3-fat/egg' to it > > removing 'build/bdist.macosx-10.3-fat/egg' (and everything under it) > > Processing pyobjc-2.4a0-py2.7.egg > > removing '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyobjc-2.4a0-py2.7.egg' (and everything under it) > > creating /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyobjc-2.4a0-py2.7.egg > > Extracting pyobjc-2.4a0-py2.7.egg to /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages > > pyobjc 2.4a0 is already the active version in easy-install.pth > > Installed /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyobjc-2.4a0-py2.7.egg > > Processing dependencies for pyobjc==2.4a0 > > Searching for pyobjc-framework-ServiceManagement==2.4a0 > > Reading http://pypi.python.org/simple/pyobjc-framework-ServiceManagement/ > > Reading http://pyobjc.sourceforge.net > > No local packages or download links found for pyobjc-framework-ServiceManagement==2.4a0 > > error: Could not find suitable distribution for Requirement.parse('pyobjc-framework-ServiceManagement==2.4a0') > > > > I'm running Lion, upgraded from Snow Leopard, but I had this same problem on SL as well. > > > > Can anyone help with this? > > > > Thanks, > > Mike > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > From skywal_l at hotmail.com Thu Aug 4 18:43:43 2011 From: skywal_l at hotmail.com (luke skywalker) Date: Thu, 4 Aug 2011 16:43:43 +0000 Subject: [Pythonmac-SIG] Python bridgesupport issue on Lion Message-ID: Hi, I have Mac OS X Lion 10.7 running. I'm trying to use bluetooth with python. I've installed the lightblue library as it seems to be the only way to have easy access to bluetooth through python. However, when I do: import lighblueI get this:Traceback (most recent call last): File "", line 1, in File "/Library/Python/2.7/site-packages/lightblue/__init__.py", line 160, in from _lightblue import * File "/Library/Python/2.7/site-packages/lightblue/_lightblue.py", line 27, in import _IOBluetooth File "/Library/Python/2.7/site-packages/lightblue/_IOBluetooth.py", line 47, in globals=globals()) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 142, in initFrameworkWrapper _parseBridgeSupport(data, globals, frameworkName) File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 42, in _parseBridgeSupport objc.parseBridgeSupport(data, globals, frameworkName, *args, **kwds)ValueError: cftype for 'IOBluetoothDeviceInquiryRef' must include gettypeid_func, tollfree or bothLooking at: /System/Library/Frameworks/IOBluetooth.framework/Versions/A/Resources/BridgeSupport/IOBluetooth.bridgesupportNo cftypes declared in it have a gettypeid function or a tollfree. Anybody knows what's wrong? I've checked other bridgesupport files and they also have the same pattern (cftypes without gettypeid or tollfree).Thx. -------------- next part -------------- An HTML attachment was scrubbed... URL: From janssen at parc.com Thu Aug 4 20:58:58 2011 From: janssen at parc.com (Bill Janssen) Date: Thu, 4 Aug 2011 11:58:58 PDT Subject: [Pythonmac-SIG] Python on iphone for developers In-Reply-To: <010c01cc4fe5$bb132180$31396480$@com> References: <010c01cc4fe5$bb132180$31396480$@com> Message-ID: <82313.1312484338@parc.com> Alex Jouravlev wrote: > Is there a port of Python to iPhone? I want to be able to check-out from > SVN, edit and run some Python server code now and then. See . Bill From dan at rosspixelworks.com Thu Aug 4 21:37:03 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Thu, 04 Aug 2011 14:37:03 -0500 Subject: [Pythonmac-SIG] Python on iphone for developers In-Reply-To: <82313.1312484338@parc.com> References: <010c01cc4fe5$bb132180$31396480$@com> <82313.1312484338@parc.com> Message-ID: <1045b3e3974137f8c65564302a520a92@rosspixelworks.com> So how does one use this to make an iOS app then? On Thu, 4 Aug 2011 11:58:58 PDT, Bill Janssen wrote: > Alex Jouravlev wrote: > >> Is there a port of Python to iPhone? I want to be able to check-out >> from >> SVN, edit and run some Python server code now and then. > > See > . > > Bill > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From janssen at parc.com Thu Aug 4 22:21:00 2011 From: janssen at parc.com (Bill Janssen) Date: Thu, 4 Aug 2011 13:21:00 PDT Subject: [Pythonmac-SIG] Python on iphone for developers In-Reply-To: <1045b3e3974137f8c65564302a520a92@rosspixelworks.com> References: <010c01cc4fe5$bb132180$31396480$@com> <82313.1312484338@parc.com> <1045b3e3974137f8c65564302a520a92@rosspixelworks.com> Message-ID: <83804.1312489260@parc.com> Dan Ross wrote: > So how does one use this to make an iOS app then? That's an exercise for the reader. Basically, you build an Objective-C iOS app, but implement the callbacks and program logic as thin C wrappers that call into Python to get things done. This is simpler with a working PyObjC for iOS, of course, but I don't know what the status of that is. Bill > > On Thu, 4 Aug 2011 11:58:58 PDT, Bill Janssen wrote: > > Alex Jouravlev wrote: > > > >> Is there a port of Python to iPhone? I want to be able to check-out > >> from > >> SVN, edit and run some Python server code now and then. > > > > See > > . > > > > Bill > > _______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG From lists+Pythonmac-SIG at hoech.org Fri Aug 5 08:38:45 2011 From: lists+Pythonmac-SIG at hoech.org (=?ISO-8859-1?Q?Florian_H=F6ch?=) Date: Fri, 05 Aug 2011 08:38:45 +0200 Subject: [Pythonmac-SIG] OS X 10.7 Lion, py2app 0.6.3, argv-emulation, wxPython In-Reply-To: <4E382919.9070909@noaa.gov> References: <4E348894.2050603@hoech.org> <4E37FFBA.3050907@hoech.org> <4E382919.9070909@noaa.gov> Message-ID: <4E3B8FF5.9030404@hoech.org> I played around with it, and must say it works really well in my case. I installed the Cocoa wxPython 2.9.2, and after making a few changes to my code, namely not using Close() on dialogs but rather EndModal() and not using icon sizes above 128 (seemingly a wx Cocoa 64-bit bug, the 32-bit and Carbon build of wx 2.9.2 that I also tried didn't complain), my application ran just fine. I was also instantly able to build an app bundle with py2app from the repository. All in all a quite pleasant experience. Thanks for the info! Am 02.08.2011 18:43, schrieb Christopher Barker: > On 8/2/11 6:46 AM, Florian H?ch wrote: >> Thanks, good to know. Even though personally I don't need 64-bit support >> yet, as wxPython currently only works in 32-bit mode on the Mac, > > wxPython2.9 (still "unstable") is built on Cocoa, and support 64 bit. > > http://www.wxpython.org/download.php#unstable > > So it's coming soon, and the more people that test it now, the better. > > -Chris -- Florian H?ch From fuzzyman at gmail.com Tue Aug 9 19:21:17 2011 From: fuzzyman at gmail.com (Michael Foord) Date: Tue, 9 Aug 2011 18:21:17 +0100 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac Message-ID: Hey folks, I've installed Python on OS X Lion on two computers - one with Lion preinstalled and one upgraded from Snow Leopard. I used both Python.org and Activestate installers. In all cases (I'm pretty sure) the installation required elevation and the installed Python was 'owned' by root - meaning any changes (e.g. installation into site-packages) must be sudo'd. This is a change from previous versions of OS X. Is this known, and is it an issue? (I chown'd everything back to me to get round it.) All the best, Michael -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From kw at codebykevin.com Tue Aug 9 21:15:11 2011 From: kw at codebykevin.com (Kevin Walzer) Date: Tue, 09 Aug 2011 15:15:11 -0400 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac In-Reply-To: References: Message-ID: <4E41873F.9090902@codebykevin.com> On 8/9/11 1:21 PM, Michael Foord wrote: > This is a change from previous versions of OS X. Is this known, and is > it an issue? (I chown'd everything back to me to get round it.) I don't believe it is a change. /Library and /System/Library are owned by the system, not you. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From njriley at illinois.edu Tue Aug 9 21:00:20 2011 From: njriley at illinois.edu (Nicholas Riley) Date: Tue, 9 Aug 2011 15:00:20 -0400 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac In-Reply-To: References: Message-ID: <20110809190020.GA9981@illinois.edu> On Tue, Aug 09, 2011 at 06:21:17PM +0100, Michael Foord wrote: > In all cases (I'm pretty sure) the installation required elevation and the > installed Python was 'owned' by root - meaning any changes (e.g. > installation into site-packages) must be sudo'd. > > This is a change from previous versions of OS X. Is this known, and is it an > issue? (I chown'd everything back to me to get round it.) Yes, it's an intentional decision, made for security reasons: http://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_7.html#//apple_ref/doc/uid/TP40010355-SW16 The only inconsistent part is that /Library/Java is still admin-writable; /Library/Java/Extensions contains jars which end up on the classpath of all Java applications, so not allowing the equivalent thing for Python seems a bit strange. This might just be linked to the removal of Java as part of the base system, though. You could only install Python packages as an admin user (without sudo) if they didn't try to create any scripts, which ended up in /usr/local/bin which isn't admin-writable even on Snow Leopard. Now I just install everything in a virtualenv and am generally happier. -- Nicholas Riley From nad at acm.org Tue Aug 9 21:42:17 2011 From: nad at acm.org (Ned Deily) Date: Tue, 09 Aug 2011 12:42:17 -0700 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac References: Message-ID: In article , Michael Foord wrote: > I've installed Python on OS X Lion on two computers - one with Lion > preinstalled and one upgraded from Snow Leopard. I used both Python.org and > Activestate installers. > > In all cases (I'm pretty sure) the installation required elevation and the > installed Python was 'owned' by root - meaning any changes (e.g. > installation into site-packages) must be sudo'd. > > This is a change from previous versions of OS X. Is this known, and is it an > issue? (I chown'd everything back to me to get round it.) I can't speak to the ActiveState installer but for the python.org installers installation has always required a username with administrator privilege. That hasn't changed in Lion. And, even though owned by root, when logged in via an admin username, you should be able to install packages to its default location (using python setup.py or easy_install or pip) without sudo. The default site-packages directory for python.org installations is: cd /Library/Frameworks/Python.framework/Versions/x.y/ ls ./lib/pythonx.y/site-packages ls ./bin # for scripts If you are using easy_install, make sure you aren't using the Apple-supplied easy_installs in /usr/bin which are for the system Pythons (2.7, 2.6, and 2.5 in OS X 10.7). They will, by default, attempt to install into /Library/Python/2.y and /usr/local/bin for scripts and that *does* need sudo. -- Ned Deily, nad at acm.org From nad at acm.org Tue Aug 9 22:15:32 2011 From: nad at acm.org (Ned Deily) Date: Tue, 09 Aug 2011 13:15:32 -0700 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac References: Message-ID: In article , Ned Deily wrote: > In article > , > Michael Foord wrote: > > I've installed Python on OS X Lion on two computers - one with Lion > > preinstalled and one upgraded from Snow Leopard. I used both Python.org and > > Activestate installers. > > > > In all cases (I'm pretty sure) the installation required elevation and the > > installed Python was 'owned' by root - meaning any changes (e.g. > > installation into site-packages) must be sudo'd. > > > > This is a change from previous versions of OS X. Is this known, and is it an > > issue? (I chown'd everything back to me to get round it.) > > I can't speak to the ActiveState installer but for the python.org > installers installation has always required a username with > administrator privilege. That hasn't changed in Lion. And, even though > owned by root, when logged in via an admin username, you should be able > to install packages to its default location (using python setup.py or > easy_install or pip) without sudo. The default site-packages directory > for python.org installations is: > > cd /Library/Frameworks/Python.framework/Versions/x.y/ > ls ./lib/pythonx.y/site-packages > ls ./bin # for scripts > > If you are using easy_install, make sure you aren't using the > Apple-supplied easy_installs in /usr/bin which are for the system > Pythons (2.7, 2.6, and 2.5 in OS X 10.7). They will, by default, > attempt to install into /Library/Python/2.y and /usr/local/bin for > scripts and that *does* need sudo. Just to clarify: to install Python itself using a python.org installer requires entering an admin user name and password using the standard OS X GUI installer or "sudo installer" if using the command line OS X installer. But if you are running under a user with admin priv you shouldn't need to use sudo to install Distutils-based packages (via setup.py, easy_install, etc) with the python.org installed Pythons. As far as I know, there is no difference in this behavior between Lion, Snow Leopard, or Leopard. -- Ned Deily, nad at acm.org From fuzzyman at gmail.com Tue Aug 9 23:14:02 2011 From: fuzzyman at gmail.com (Michael Foord) Date: Tue, 9 Aug 2011 22:14:02 +0100 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac In-Reply-To: <20110809190020.GA9981@illinois.edu> References: <20110809190020.GA9981@illinois.edu> Message-ID: On 9 August 2011 20:00, Nicholas Riley wrote: > On Tue, Aug 09, 2011 at 06:21:17PM +0100, Michael Foord wrote: > > In all cases (I'm pretty sure) the installation required elevation and > the > > installed Python was 'owned' by root - meaning any changes (e.g. > > installation into site-packages) must be sudo'd. > > > > This is a change from previous versions of OS X. Is this known, and is it > an > > issue? (I chown'd everything back to me to get round it.) > > Yes, it's an intentional decision, made for security reasons: > > > http://developer.apple.com/library/mac/releasenotes/MacOSX/WhatsNewInOSX/Articles/MacOSX10_7.html#//apple_ref/doc/uid/TP40010355-SW16 > > Right, I believe this is the specific change: - Many folders in the System domain that were previously owned by the admingroup are now owned by the wheel group. Nothing we can do about it then I guess. Thanks. > The only inconsistent part is that /Library/Java is still > admin-writable; /Library/Java/Extensions contains jars which end up on > the classpath of all Java applications, so not allowing the equivalent > thing for Python seems a bit strange. This might just be linked to > the removal of Java as part of the base system, though. > > You could only install Python packages as an admin user (without sudo) > if they didn't try to create any scripts, which ended up in > /usr/local/bin which isn't admin-writable even on Snow Leopard. > > Now I just install everything in a virtualenv and am generally > happier. > Well yes, but that means you probably need pip and virtualenv as a minimum. It was installing these that I noticed the difference. Michael > > -- > Nicholas Riley > -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuzzyman at gmail.com Tue Aug 9 23:15:17 2011 From: fuzzyman at gmail.com (Michael Foord) Date: Tue, 9 Aug 2011 22:15:17 +0100 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac In-Reply-To: References: Message-ID: On 9 August 2011 20:42, Ned Deily wrote: > In article > , > Michael Foord wrote: > > I've installed Python on OS X Lion on two computers - one with Lion > > preinstalled and one upgraded from Snow Leopard. I used both Python.org > and > > Activestate installers. > > > > In all cases (I'm pretty sure) the installation required elevation and > the > > installed Python was 'owned' by root - meaning any changes (e.g. > > installation into site-packages) must be sudo'd. > > > > This is a change from previous versions of OS X. Is this known, and is it > an > > issue? (I chown'd everything back to me to get round it.) > > I can't speak to the ActiveState installer but for the python.org > installers installation has always required a username with > administrator privilege. That hasn't changed in Lion. And, even though > owned by root, when logged in via an admin username, you should be able > to install packages to its default location (using python setup.py or > easy_install or pip) without sudo. I don't believe that is actually the case in Lion due to the changes pointed out by Nicholas. All the best, Michael > The default site-packages directory > for python.org installations is: > > cd /Library/Frameworks/Python.framework/Versions/x.y/ > ls ./lib/pythonx.y/site-packages > ls ./bin # for scripts > > If you are using easy_install, make sure you aren't using the > Apple-supplied easy_installs in /usr/bin which are for the system > Pythons (2.7, 2.6, and 2.5 in OS X 10.7). They will, by default, > attempt to install into /Library/Python/2.y and /usr/local/bin for > scripts and that *does* need sudo. > > -- > Ned Deily, > nad at acm.org > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Tue Aug 9 23:31:11 2011 From: nad at acm.org (Ned Deily) Date: Tue, 09 Aug 2011 14:31:11 -0700 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac References: Message-ID: In article , Michael Foord wrote: > On 9 August 2011 20:42, Ned Deily wrote: > > > In article > > , > > Michael Foord wrote: > > > I've installed Python on OS X Lion on two computers - one with Lion > > > preinstalled and one upgraded from Snow Leopard. I used both Python.org > > and > > > Activestate installers. > > > > > > In all cases (I'm pretty sure) the installation required elevation and > > the > > > installed Python was 'owned' by root - meaning any changes (e.g. > > > installation into site-packages) must be sudo'd. > > > > > > This is a change from previous versions of OS X. Is this known, and is it > > an > > > issue? (I chown'd everything back to me to get round it.) > > > > I can't speak to the ActiveState installer but for the python.org > > installers installation has always required a username with > > administrator privilege. That hasn't changed in Lion. And, even though > > owned by root, when logged in via an admin username, you should be able > > to install packages to its default location (using python setup.py or > > easy_install or pip) without sudo. > > > I don't believe that is actually the case in Lion due to the changes pointed > out by Nicholas. Odd! So far, this works for me on Lion with the current python.org installer (3.2.1 at least). Perhaps you can be more specific about exactly how to reproduce what has changed for you. -- Ned Deily, nad at acm.org From nad at acm.org Tue Aug 9 23:42:30 2011 From: nad at acm.org (Ned Deily) Date: Tue, 09 Aug 2011 14:42:30 -0700 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac References: Message-ID: In article , Ned Deily wrote: > In article > , > Michael Foord wrote: > > I don't believe that is actually the case in Lion due to the changes > > pointed > > out by Nicholas. > Odd! So far, this works for me on Lion with the current python.org > installer (3.2.1 at least). Perhaps you can be more specific about > exactly how to reproduce what has changed for you. Ah, a thought! I have been testing with a vanilla Lion system with a freshly-installed python.org Pythons. In that case, the permissions of the files in /Library/Frameworks/Python.framework are being set as specified by the python.org installer. Perhaps you are using a python.org Python that was on a system upgraded from Snow Leopard? In that case, the Apple upgrade process may have mucked with the permissions of the existing files. Reinstalling using the python.org installers would likely take care of that. But it is something we should document and or consider changing. -- Ned Deily, nad at acm.org From fuzzyman at gmail.com Wed Aug 10 00:35:11 2011 From: fuzzyman at gmail.com (Michael Foord) Date: Tue, 9 Aug 2011 23:35:11 +0100 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac In-Reply-To: References: Message-ID: On 9 August 2011 22:42, Ned Deily wrote: > In article , > Ned Deily wrote: > > > In article > > , > > Michael Foord wrote: > > > I don't believe that is actually the case in Lion due to the changes > > > pointed > > > out by Nicholas. > > Odd! So far, this works for me on Lion with the current python.org > > installer (3.2.1 at least). Perhaps you can be more specific about > > exactly how to reproduce what has changed for you. > > Ah, a thought! I have been testing with a vanilla Lion system with a > freshly-installed python.org Pythons. In that case, the permissions of > the files in /Library/Frameworks/Python.framework are being set as > specified by the python.org installer. Perhaps you are using a > python.org Python that was on a system upgraded from Snow Leopard? In > that case, the Apple upgrade process may have mucked with the > permissions of the existing files. Reinstalling using the python.org > installers would likely take care of that. But it is something we > should document and or consider changing. > Hmm... for 3.2 and 2.7 I was using Activestate installers not Python.org ones - so perhaps it's their bug (in which case sorry for the noise). Michael > > -- > Ned Deily, > nad at acm.org > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > -- http://www.voidspace.org.uk/ May you do good and not evil May you find forgiveness for yourself and forgive others May you share freely, never taking more than you give. -- the sqlite blessing http://www.sqlite.org/different.html -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Wed Aug 10 00:38:28 2011 From: nad at acm.org (Ned Deily) Date: Tue, 09 Aug 2011 15:38:28 -0700 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac References: Message-ID: In article , Ned Deily wrote: > In article , > Ned Deily wrote: > > > In article > > , > > Michael Foord wrote: > > > I don't believe that is actually the case in Lion due to the changes > > > pointed > > > out by Nicholas. > > Odd! So far, this works for me on Lion with the current python.org > > installer (3.2.1 at least). Perhaps you can be more specific about > > exactly how to reproduce what has changed for you. > > Ah, a thought! I have been testing with a vanilla Lion system with a > freshly-installed python.org Pythons. In that case, the permissions of > the files in /Library/Frameworks/Python.framework are being set as > specified by the python.org installer. Perhaps you are using a > python.org Python that was on a system upgraded from Snow Leopard? In > that case, the Apple upgrade process may have mucked with the > permissions of the existing files. Reinstalling using the python.org > installers would likely take care of that. But it is something we > should document and or consider changing. Yes, reinstalling Python using the python.org installer fixes it because the installer's post-install script simply does a chgrp -R admin and chgrp -R g+w to the version it installed. That should be non-destructive, i.e. existing packages installed in site-packages should not disturbed so, if a user is not comfortable with the command line, reinstalling with a python.org installer after an upgrade to Lion is viable. Also, because the permissions are set this way rather than explicitly in an installer bom, the Disk Utility.app (or diskutil) Repair Permissions function doesn't help for this. On my high-priority list of things to do is to update the "Using Python on a Macintosh" section of the "Python Setup and Usage" standard doc as well as http://www.python.org/download/mac/ both of which are very out-of-date. There is the new http://www.python.org/download/mac/tcltk/ which I have been keeping up-to-date. Somewhere in there or in the wiki should be a section on upgrading which could include things like this. -- Ned Deily, nad at acm.org From njriley at illinois.edu Wed Aug 10 02:24:37 2011 From: njriley at illinois.edu (Nicholas Riley) Date: Tue, 9 Aug 2011 20:24:37 -0400 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac In-Reply-To: References: Message-ID: <20110810002437.GA13370@illinois.edu> On Tue, Aug 09, 2011 at 11:35:11PM +0100, Michael Foord wrote: > On 9 August 2011 22:42, Ned Deily wrote: > Hmm... for 3.2 and 2.7 I was using Activestate installers not Python.org > ones - so perhaps it's their bug (in which case sorry for the noise). Nope - this is from a new Mac mini that shipped with Lion and has not had any non-system Pythons installed: bookworm% ls -ld /Library/Python/*/site-packages drwxr-xr-x 4 root wheel 136 Jun 25 08:05 /Library/Python/2.3/site-packages drwxr-xr-x 3 root wheel 102 Jul 2 17:08 /Library/Python/2.5/site-packages drwxr-xr-x 3 root wheel 102 Jul 2 17:08 /Library/Python/2.6/site-packages drwxr-xr-x 3 root wheel 102 Jul 2 17:08 /Library/Python/2.7/site-packages I'd say if any of the python.org or ActiveState Python installers mess with these directories' ownership or permissions, they're doing something wrong. While the contents of these directories is up to the user, their permissions are part of the OS install. > Many folders in the System domain that were previously owned by > the admingroup are now owned by the wheel group. This isn't quite right (the "System domain" means /System); it's the part a bit later that says "All subdirectories within /Library now have mode 755 (writable only by root) permissions instead of mode 775 (writable by the admin group) except... [a bunch of directories that do not include Python]". Anyway, the workaround is simple enough - and yeah, still pretty necessary to install pip/virtualenv themselves. -- Nicholas Riley From doichin_s at gmx.de Wed Aug 10 16:43:16 2011 From: doichin_s at gmx.de (Doychin Stanchev) Date: Wed, 10 Aug 2011 16:43:16 +0200 Subject: [Pythonmac-SIG] "elif" problem Message-ID: <0E012ED1-85AD-478F-9EA9-D3308EA3EA2D@gmx.de> Hi guys, I am really new to the programming and I decided to start with python. I found a book called "beginning python" and started to learn, but I had a problem with the command "elif". I am running 10.7 and python 2.72. Here is my problem: >>> milk_price = 1.50 >>> if milk_price < 1.25: print "Buy two cartons of milk, they're on sale" elif milk_price < 2.00: SyntaxError: invalid syntax I'll appreciate very much your help, Thank you, Doychin -------------- next part -------------- An HTML attachment was scrubbed... URL: From cweisiger at msg.ucsf.edu Wed Aug 10 17:16:12 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Wed, 10 Aug 2011 08:16:12 -0700 Subject: [Pythonmac-SIG] "elif" problem In-Reply-To: <0E012ED1-85AD-478F-9EA9-D3308EA3EA2D@gmx.de> References: <0E012ED1-85AD-478F-9EA9-D3308EA3EA2D@gmx.de> Message-ID: It's not clear if you're using proper indentation here. I recommend putting your code on a paste site (e.g. http://pastebin.com/ ) so we can see the whitespace properly. Here's a more complete version of your example, which does work once a line after the elif is added: http://pastebin.com/4L2wfKdr It's not clear to me here; were you just typing this code directly into the Python interpreter (e.g. by running "python" on the command line)? If so, I think I know what happened: your elif statement had the same level of indentation as the "print" statement. That means that you had an elif statement without a preceding if statement, which is indeed a syntax error. You need to back the elif statement out to the same level of indentation as the if statement. Hope this helps. -Chris On Wed, Aug 10, 2011 at 7:43 AM, Doychin Stanchev wrote: > Hi guys, > I am really new to the programming and I decided to start with python. I > found a book called "beginning python" and started to learn, but I had a > problem with the command "elif". I am running 10.7 and python 2.72. Here is > my problem: >>>> milk_price = 1.50 >>>> if milk_price < 1.25: > print "Buy two cartons of milk, they're on sale" > elif milk_price < 2.00: > > SyntaxError: invalid syntax > I'll appreciate very much your help, > Thank you, > Doychin > _______________________________________________ > Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > From hraban at fiee.net Wed Aug 10 17:15:03 2011 From: hraban at fiee.net (Henning Hraban Ramm) Date: Wed, 10 Aug 2011 17:15:03 +0200 Subject: [Pythonmac-SIG] "elif" problem In-Reply-To: <0E012ED1-85AD-478F-9EA9-D3308EA3EA2D@gmx.de> References: <0E012ED1-85AD-478F-9EA9-D3308EA3EA2D@gmx.de> Message-ID: Am 2011-08-10 um 16:43 schrieb Doychin Stanchev: > I am really new to the programming and I decided to start with > python. I found a book called "beginning python" and started to > learn, but I had a problem with the command "elif". I am running > 10.7 and python 2.72. Here is my problem: > > >>> milk_price = 1.50 > >>> if milk_price < 1.25: > print "Buy two cartons of milk, they're on sale" > elif milk_price < 2.00: > > SyntaxError: invalid syntax I can?t tell if you used the right spacing, and there must come at least one command in your elif branch. E.g.: if price < 1.25: print "on sale" elif price < 2.00: pass Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From cweisiger at msg.ucsf.edu Wed Aug 10 17:31:19 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Wed, 10 Aug 2011 08:31:19 -0700 Subject: [Pythonmac-SIG] Lambdas and closures Message-ID: There's probably a more generic mailing list I could send this to, but I'm on too many lists as it is...hope y'all don't mind. Anyway, I often find myself in the situation of "I have a list of objects. I want to make a corresponding list of functions that operate on those objects". So I write up something like this: funcList = [] for item in objectList: funcList.append(lambda input: item.actOn(input)) But this doesn't work, because Python lazily binds the "item" variable here. As a simple example: >>> foo = [lambda: x + 2 for x in range(4)] >>> [f() for f in foo] [5, 5, 5, 5] There's a workaround to force Python to make a copy of the variable with its current value: use it as an optional argument to the lambda: >>> foo = [lambda x = x: x + 2 for x in range(4)] >>> [f() for f in foo] [2, 3, 4, 5] But that gets ugly fast if I have any level of nested loops involved in my lambda creation. I had a situation yesterday in which I would have had to have three variables bound using that method to keep Python using the correct value of the variable: lambda a = a, b = b, c = c: a.b(c). That sent me to the other workaround I know of, which is to just define a new function that accepts the (three) inputs and returns a lambda: def makeFunc(a, b, c): return lambda: a.b(c) This is still pretty painful though. Is there some way to get my original example to work as it intuitively should? Or some equivalent elegant alternative? That is, when a lambda is created, it should include a closure of all scoped variables with their values as they were at the time of creation of the lambda. Whereas right now as far as I can tell it just includes references to those variables, and if you should happen to change them between creating and calling the lambda, then you're out of luck. The actual use case I'm dealing with here is exposing various code objects in a GUI; I need to create a button (or text field, or menu) and then react to the user interacting with that object by calling a function. -Chris From aahz at pythoncraft.com Wed Aug 10 18:38:07 2011 From: aahz at pythoncraft.com (Aahz) Date: Wed, 10 Aug 2011 09:38:07 -0700 Subject: [Pythonmac-SIG] Lambdas and closures In-Reply-To: References: Message-ID: <20110810163807.GA9406@panix.com> On Wed, Aug 10, 2011, Chris Weisiger wrote: > > There's probably a more generic mailing list I could send this to, but > I'm on too many lists as it is...hope y'all don't mind. > > Anyway, I often find myself in the situation of "I have a list of > objects. I want to make a corresponding list of functions that operate > on those objects". So I write up something like this: > > funcList = [] > for item in objectList: > funcList.append(lambda input: item.actOn(input)) Why can't you do: for item in object_list: func_list.append(item.act_on) (Notice who I change the names to match PEP8.) -- Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/ "If you don't know what your program is supposed to do, you'd better not start writing it." --Dijkstra From cweisiger at msg.ucsf.edu Wed Aug 10 18:46:59 2011 From: cweisiger at msg.ucsf.edu (Chris Weisiger) Date: Wed, 10 Aug 2011 09:46:59 -0700 Subject: [Pythonmac-SIG] Lambdas and closures In-Reply-To: <20110810163807.GA9406@panix.com> References: <20110810163807.GA9406@panix.com> Message-ID: On Wed, Aug 10, 2011 at 9:38 AM, Aahz wrote: > On Wed, Aug 10, 2011, Chris Weisiger wrote: >> >> There's probably a more generic mailing list I could send this to, but >> I'm on too many lists as it is...hope y'all don't mind. >> >> Anyway, I often find myself in the situation of "I have a list of >> objects. I want to make a corresponding list of functions that operate >> on those objects". So I write up something like this: >> >> funcList = [] >> for item in objectList: >> ? ? funcList.append(lambda input: item.actOn(input)) > > Why can't you do: > > for item in object_list: > ? ?func_list.append(item.act_on) > Sorry, my example was poor. A more realistic example: for item in objectList: funcList.append(lambda event: item.actOn(event.GetInt())) Otherwise, you're right, the lambda isn't actually doing anything there. Whoops. > (Notice who I change the names to match PEP8.) Fair for one-off examples like on these mailing lists; I'm not that familiar with PEP at the moment because I'm far more worried about enforcing consistency of any kind on the code I maintain, and that happened to mean going with camelCase. The rules of coding style, in order of importance, are 1) suit the need; 2) match the rest of the code; 3) match internal style guides; 4) match external style guides. PEP is mostly for when you're starting a new project and need to decide on a style (or in that rare case when you get to overhaul an existing project's style). Of course things are made worse in my case by the extensive use of libraries that use CamelCase (wx) and whatever you call the foo_bar style (numpy), so I'm screwed no matter what. :) -Chris From amorris at mistermorris.com Thu Aug 11 18:03:07 2011 From: amorris at mistermorris.com (Adam Morris) Date: Fri, 12 Aug 2011 00:03:07 +0800 Subject: [Pythonmac-SIG] translate applescript to appscript In-Reply-To: References: Message-ID: Hello again, all: I posted a question a few months ago and didn't quite get the answer I was looking for, so this is my second attempt. I need the following applescript translated into python appscript: tell application "Finder" to "/path/to/file" as POSIX file as alias The earlier answer given was: mactypes.Alias("/path/to/file") But this is not sufficient, because I'm looking for the "Finder reference form", and it seems that mactypes.Alias returns an "alias reference form" (See here for context on those terms: http://macscripter.net/viewtopic.php?id=24575) The ugly solution I'm using now is to manually build the Finder reference form by parsing the string (folder('path').folder('to')), and this is not sufficient either, because there are folders (such as the /tmp folder) that are not "visible" to the Finder and so fail. I don't know enough about the low-level stuff and I don't have time to learn it, and neither does ASTranslate provide anything useful, so if anyone could help or at least point me towards something that might let me quickly figure out on my own (codes for POSIX file and alias?) I would be very grateful. Regards, -Adam On Thu, Jun 30, 2011 at 7:52 PM, Adam Morris wrote: > I have an AppleScript snippet that I need translating to python > appscript; too low-level for ASTranslate to handle: > > tell application "Finder" > ? ? ? ?"/Users/brainysmurf/Desktop" as POSIX file as alias > end tell > > I'm writing a wrapper class for the Finder and want to be able to pass > /path/to/doc to its methods and so I need a way to convert from paths > to file objects that the Finder can do things with. Reading the docs I > tried: > > appscript.app("Finder").AS_newreference(appscript.app.elements('psxf').byname('/Users/brainysmurf/Desktop')) > > But I get an error saying that elements is not an attribute. I get the > same deal with appscript.app('Finder'). > > Using appscript 1.0.0 > > Help? > > -Adam > From elmickerino at gmail.com Thu Aug 11 18:35:10 2011 From: elmickerino at gmail.com (Michael Schmidt) Date: Thu, 11 Aug 2011 11:35:10 -0500 Subject: [Pythonmac-SIG] using py2app with scipy Message-ID: Hi Everyone, I'm trying to create a stand-alone app for some scientific analysis code using py2app, and I'm running into problems when I try to include scipy in my application (same goes for matplotlib). As you can guess, this is a necessary pre-requisite for my app to be at all useful. The documentation on the py2app site is a couple of years old now, and mailing list entries about the subject are from 2007, so I'm really hoping someone out there in the intertubes has succesfully packaged these into a stand-alone program. The terminal commands look just fine when I do: python --make_setup test_app.py python setup.py py2app The problem only arises when I try to actually run the application. I get an error window stating "test_app Error" and nothing else. My sample code is attached. I'm using Max OS 10.6.8, python version 2.6.1, numpy version 2.0.0, scipy version 0.9.0 and matplotlib version 1.0.0 My goal is to create a program that future grad students in my lab will be able to re-use - any help here would be much appreciated, and would further the progress of scientific inquiry (a lil' bit). Thanks a bunch! Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_app.py Type: application/octet-stream Size: 336 bytes Desc: not available URL: From nad at acm.org Thu Aug 11 19:03:28 2011 From: nad at acm.org (Ned Deily) Date: Thu, 11 Aug 2011 10:03:28 -0700 Subject: [Pythonmac-SIG] translate applescript to appscript References: Message-ID: In article , Adam Morris wrote: > I posted a question a few months ago and didn't quite get the answer I > was looking for, so this is my second attempt. > > I need the following applescript translated into python appscript: > > tell application "Finder" to "/path/to/file" as POSIX file as alias > > The earlier answer given was: > > mactypes.Alias("/path/to/file") > > But this is not sufficient, because I'm looking for the "Finder > reference form", and it seems that mactypes.Alias returns an "alias > reference form" (See here for context on those terms: > http://macscripter.net/viewtopic.php?id=24575) > > The ugly solution I'm using now is to manually build the Finder > reference form by parsing the string (folder('path').folder('to')), > and this is not sufficient either, because there are folders (such as > the /tmp folder) that are not "visible" to the Finder and so fail. Try this reference form: app("Finder").items[mactypes.Alias("/path/to/file")] -- Ned Deily, nad at acm.org From rowen at uw.edu Thu Aug 11 20:29:01 2011 From: rowen at uw.edu (Russell E. Owen) Date: Thu, 11 Aug 2011 11:29:01 -0700 Subject: [Pythonmac-SIG] using py2app with scipy References: Message-ID: In article , Michael Schmidt wrote: > Hi Everyone, > > I'm trying to create a stand-alone app for some scientific analysis code > using py2app, and I'm running into problems when I try to include scipy in > my application (same goes for matplotlib). As you can guess, this is a > necessary pre-requisite for my app to be at all useful. The documentation > on the py2app site is a couple of years old now, and mailing list entries > about the subject are from 2007, so I'm really hoping someone out there in > the intertubes has succesfully packaged these into a stand-alone program. > > The terminal commands look just fine when I do: > > python --make_setup test_app.py > python setup.py py2app > > The problem only arises when I try to actually run the application. I get > an error window stating "test_app Error" and nothing else. > > My sample code is attached. I'm using Max OS 10.6.8, python version 2.6.1, > numpy version 2.0.0, scipy version 0.9.0 and matplotlib version 1.0.0 > > My goal is to create a program that future grad students in my lab will be > able to re-use - any help here would be much appreciated, and would further > the progress of scientific inquiry (a lil' bit). > > Thanks a bunch! > Michael > --------------------------------------------------------------------- For matplotlib I specify matplotlib as a package for py2app. Here's the relevant bit of my setup.py: inclModules = ( # "email.Utils", # needed for Python 2.5 "FileDialog", ) # packages to include recursively inclPackages = ( "TUI", "RO", "matplotlib", # py2app already does this, but it doesn't hurt to insist ) plist = Plist( CFBundleName = appName, CFBundleShortVersionString = shortVersStr, CFBundleGetInfoString = "%s %s" % (appName, fullVersStr), CFBundleExecutable = appName, ) setup( app = [mainProg], setup_requires = ["py2app"], options = dict( py2app = dict ( plist = plist, iconfile = iconFile, includes = inclModules, packages = inclPackages, ) ), ) From elmickerino at gmail.com Fri Aug 12 17:56:21 2011 From: elmickerino at gmail.com (Michael Schmidt) Date: Fri, 12 Aug 2011 10:56:21 -0500 Subject: [Pythonmac-SIG] using py2app with scipy (Russell E. Owen) Message-ID: Thanks for the quick response. Unfortunately I can't get this to work, now for other reasons. I've attached the updated setup.py file and my simple test program (test_app.py) to this email. The problem seems to lie with pytz: ] python setup.py py2app ....(lots of byte-compiling messages here).... ] byte-compiling /Users/maschmidt/test_app.py to test_app.pyc ] error: cannot copy tree '/Library/Python/2.6/site-packages/pytz-2011h-py2.6.egg/pytz/zoneinfo': not a directory I did some googling and found that this is a persistent problem with matplotlib, but none of the work-arounds I tried worked. I tried editing the recipe/matplotlib.py file to read 'tzinfo' instead of 'zoneinfo' and that didn't work, and I tried explicitly including pytz and letting pytz.zoneinfo = pytz.tzinfo in my setup.py file. Something else seems to be askign for pytz.zoneinfo. I'm using python 2.6.1, scipy 0.9.0 dev, numpy 2.0.0 dev, matplotlib 1.0.0, py2app 0.6.3 I'd love to know if anyone has successfully gotten py2app to bundle a stand-alone app using numpy, scipy and matplotlib, and if so, could they please send me a sample script? Thanks a bunch, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: setup.py Type: application/octet-stream Size: 370 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: test_app.py Type: application/octet-stream Size: 355 bytes Desc: not available URL: From emanuelesantos at gmail.com Fri Aug 12 18:24:36 2011 From: emanuelesantos at gmail.com (Emanuele Santos) Date: Fri, 12 Aug 2011 13:24:36 -0300 Subject: [Pythonmac-SIG] using py2app with scipy (Russell E. Owen) In-Reply-To: References: Message-ID: Hi, Michael I have built an application that includes numpy, scipy and matplotlib. My script is very similar to yours and I tested your script files and the app is built fine on my machine, so I guess the problem could be with your installation of matplotlib. I am running python 2.7.2 from python.org on Snow Leopard, matplotlib 1.0.1 built from source, py2app 0.6.4. Maybe updating your version of matplotlib solves the problem. Thanks, -- Emanuele. On Fri, Aug 12, 2011 at 12:56 PM, Michael Schmidt wrote: > Thanks for the quick response.? Unfortunately I can't get this to work, now > for other reasons.? I've attached the updated setup.py file and my simple > test program (test_app.py) to this email. > > The problem seems to lie with pytz: > > ] python setup.py py2app > > ....(lots of byte-compiling messages here).... > > ] byte-compiling /Users/maschmidt/test_app.py to test_app.pyc > ] error: cannot copy tree > '/Library/Python/2.6/site-packages/pytz-2011h-py2.6.egg/pytz/zoneinfo': not > a directory > > I did some googling and found that this is a persistent problem with > matplotlib, but none of the work-arounds I tried worked.? I tried editing > the recipe/matplotlib.py file to read 'tzinfo' instead of 'zoneinfo' and > that didn't work, and I tried explicitly including pytz and letting > pytz.zoneinfo = pytz.tzinfo in my setup.py file.? Something else seems to be > askign for pytz.zoneinfo. > > I'm using python 2.6.1, scipy 0.9.0 dev, numpy 2.0.0 dev, matplotlib 1.0.0, > py2app 0.6.3 > > I'd love to know if anyone has successfully gotten py2app to bundle a > stand-alone app using numpy, scipy and matplotlib, and if so, could they > please send me a sample script? > > Thanks a bunch, > Michael > > > _______________________________________________ > Pythonmac-SIG maillist ?- ?Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > From half.italian at gmail.com Fri Aug 12 18:35:33 2011 From: half.italian at gmail.com (Sean DiZazzo) Date: Fri, 12 Aug 2011 09:35:33 -0700 Subject: [Pythonmac-SIG] using py2app with scipy (Russell E. Owen) In-Reply-To: References: Message-ID: Sorry if this is naive, but you might want to try unzipping the egg at /Library/Python/2.6/site-packages/pytz-2011h-py2.6.egg It reminds me of the error I get when I try to edit a file in a package that was installed as an egg. On Fri, Aug 12, 2011 at 8:56 AM, Michael Schmidt wrote: > Thanks for the quick response. Unfortunately I can't get this to work, now > for other reasons. I've attached the updated setup.py file and my simple > test program (test_app.py) to this email. > > The problem seems to lie with pytz: > > ] python setup.py py2app > > ....(lots of byte-compiling messages here).... > > ] byte-compiling /Users/maschmidt/test_app.py to test_app.pyc > ] error: cannot copy tree > '/Library/Python/2.6/site-packages/pytz-2011h-py2.6.egg/pytz/zoneinfo': not > a directory > > I did some googling and found that this is a persistent problem with > matplotlib, but none of the work-arounds I tried worked. I tried editing > the recipe/matplotlib.py file to read 'tzinfo' instead of 'zoneinfo' and > that didn't work, and I tried explicitly including pytz and letting > pytz.zoneinfo = pytz.tzinfo in my setup.py file. Something else seems to be > askign for pytz.zoneinfo. > > I'm using python 2.6.1, scipy 0.9.0 dev, numpy 2.0.0 dev, matplotlib 1.0.0, > py2app 0.6.3 > > I'd love to know if anyone has successfully gotten py2app to bundle a > stand-alone app using numpy, scipy and matplotlib, and if so, could they > please send me a sample script? > > Thanks a bunch, > Michael > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From elmickerino at gmail.com Fri Aug 12 19:27:24 2011 From: elmickerino at gmail.com (Michael Schmidt) Date: Fri, 12 Aug 2011 12:27:24 -0500 Subject: [Pythonmac-SIG] using py2app with scipy (Russell E. Owen) In-Reply-To: References: Message-ID: I just tried unzipping it, but unfortunately it still doesn't work - same error. Thanks for the tip though. On Fri, Aug 12, 2011 at 11:35 AM, Sean DiZazzo wrote: > Sorry if this is naive, but you might want to try unzipping the egg at > /Library/Python/2.6/site-packages/pytz-2011h-py2.6.egg > It reminds me of the error I get when I try to edit a file in a package > that was installed as an egg. > > On Fri, Aug 12, 2011 at 8:56 AM, Michael Schmidt wrote: > >> Thanks for the quick response. Unfortunately I can't get this to work, >> now for other reasons. I've attached the updated setup.py file and my >> simple test program (test_app.py) to this email. >> >> The problem seems to lie with pytz: >> >> ] python setup.py py2app >> >> ....(lots of byte-compiling messages here).... >> >> ] byte-compiling /Users/maschmidt/test_app.py to test_app.pyc >> ] error: cannot copy tree >> '/Library/Python/2.6/site-packages/pytz-2011h-py2.6.egg/pytz/zoneinfo': not >> a directory >> >> I did some googling and found that this is a persistent problem with >> matplotlib, but none of the work-arounds I tried worked. I tried editing >> the recipe/matplotlib.py file to read 'tzinfo' instead of 'zoneinfo' and >> that didn't work, and I tried explicitly including pytz and letting >> pytz.zoneinfo = pytz.tzinfo in my setup.py file. Something else seems to be >> askign for pytz.zoneinfo. >> >> I'm using python 2.6.1, scipy 0.9.0 dev, numpy 2.0.0 dev, matplotlib >> 1.0.0, py2app 0.6.3 >> >> I'd love to know if anyone has successfully gotten py2app to bundle a >> stand-alone app using numpy, scipy and matplotlib, and if so, could they >> please send me a sample script? >> >> Thanks a bunch, >> Michael >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rowen at uw.edu Fri Aug 12 20:45:20 2011 From: rowen at uw.edu (Russell E. Owen) Date: Fri, 12 Aug 2011 11:45:20 -0700 Subject: [Pythonmac-SIG] using py2app with scipy (Russell E. Owen) References: Message-ID: In article , Michael Schmidt wrote: > Thanks for the quick response. Unfortunately I can't get this to work, now > for other reasons. I've attached the updated setup.py file and my simple > test program (test_app.py) to this email. > > The problem seems to lie with pytz: > > ] python setup.py py2app > > ....(lots of byte-compiling messages here).... > > ] byte-compiling /Users/maschmidt/test_app.py to test_app.pyc > ] error: cannot copy tree > '/Library/Python/2.6/site-packages/pytz-2011h-py2.6.egg/pytz/zoneinfo': not > a directory This may be a problem that bit me awhile ago. If so, it was a bug in py2app that has since been fixed. I suggest you install the most recent version of py2app. I also suggest you install matplotlib 1.0.1 (I believe you said you were using 1.0?) using the binary installer; that will give you a fresh pytz. If you really want to play it safe: - Save an archived copy of your site-packages, just in case - Throw away dateutil, pytz and matplotlib and pylab - Edit easy_install.pth and remove any mention of these packages - Install a new matplotlib from the Mac binary; this should give you fresh copies of all these -- Russell From amorris at mistermorris.com Sat Aug 13 01:24:23 2011 From: amorris at mistermorris.com (Adam Morris) Date: Sat, 13 Aug 2011 07:24:23 +0800 Subject: [Pythonmac-SIG] translate applescript to appscript In-Reply-To: References: Message-ID: > ?app("Finder").items[mactypes.Alias("/path/to/file")] It works! Thanks!! (So simple, actually) From nad at acm.org Sat Aug 13 01:38:36 2011 From: nad at acm.org (Ned Deily) Date: Fri, 12 Aug 2011 16:38:36 -0700 Subject: [Pythonmac-SIG] translate applescript to appscript References: Message-ID: In article , Adam Morris wrote: > > ?app("Finder").items[mactypes.Alias("/path/to/file")] > It works! Thanks!! > (So simple, actually) It is simple but not necessarily obvious. I've been using appscript for a number of years but it was just fairly recently that I ran across that reference form somewhere. Perhaps we can persuade HAS to add an example to the appscript documentation. -- Ned Deily, nad at acm.org From elmickerino at gmail.com Sat Aug 13 03:46:16 2011 From: elmickerino at gmail.com (Michael Schmidt) Date: Fri, 12 Aug 2011 20:46:16 -0500 Subject: [Pythonmac-SIG] using py2app with scipy Message-ID: > I am running python 2.7.2 from python.org on Snow Leopard, matplotlib > 1.0.1 built from source, py2app 0.6.4. Maybe updating your version of > matplotlib solves the problem. Got it to work after installing python2.7 and building numpy, scipy and matplotlib from the source to run in 64 bit mode. Thanks for the suggestion! As an aside, it's a real pain in the arse to install all that from source....see http://blog.hyperjeff.net/?p=160 for specific instructions -Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From precipice.development at gmail.com Tue Aug 16 01:45:42 2011 From: precipice.development at gmail.com (precipice.development) Date: Mon, 15 Aug 2011 16:45:42 -0700 Subject: [Pythonmac-SIG] Py2App - MySQLdb - OSX Lion Message-ID: <4E49AFA6.6020408@gmail.com> An HTML attachment was scrubbed... URL: From precipice.development at gmail.com Tue Aug 16 01:53:58 2011 From: precipice.development at gmail.com (precipice.development) Date: Mon, 15 Aug 2011 16:53:58 -0700 Subject: [Pythonmac-SIG] Py2App-Lion-MySQLdb Error Msg Message-ID: <4E49B196.7050609@gmail.com> Hello First, my apologies for not checking my Thunderbird email settings initially. Looking for some clues as to deciphering the following error: ImportError: dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynload/_mysql.so, 2): Symbol not found: _strnlen 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.dylib Background Did a Hello World type test app on Lion. Used py2app to bundle it into an OSX app. Works fine. Copied over to a fresh install of Snow Leopard 10.6.8 and works fine. Bundle is standalone. Now, added MySQLdb and made a database connection on Lion - works as expected - result returned from simple query. MySQL database is on a third machine. Now copied bundle over to Snow Leopard machine (again a fresh install) and received the following error: 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Traceback (most recent call last): 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File "/Users/jph/Public/hello.app/Contents/Resources/__boot__.py", line 57, in 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] _run('hello.py') 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File "/Users/jph/Public/hello.app/Contents/Resources/__boot__.py", line 54, in _run 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] execfile(path, globals(), globals()) 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File "/Users/jph/Public/hello.app/Contents/Resources/hello.py", line 9, in 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] import MySQLdb 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File "MySQLdb/__init__.pyc", line 19, in 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] ImportError: dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynload/_mysql.so, 2): Symbol not found: _strnlen 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.dylib 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Expected in: /usr/lib/libSystem.B.dylib 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] in /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.dylib 8/15/11 4:30:09 PM hello[716] hello Error 8/15/11 4:30:10 PM com.apple.launchd.peruser.501[102] ([0x0-0x2e02e].org.pythonmac.unspecified.hello[716]) Exited with exit code: 255 The key line seems to be ImportError: dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynload/_mysql.so, 2): Symbol not found: _strnlen 8/15/11 4:30:08 PM [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.dylib Python on Lion is from MacPorts. Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin Type "help", "copyright", "credits" or "license" for more information. /opt/local/bin/python: Mach-O 64-bit executable x86_64 MySQLdb is also from MacPorts mysql5/mysql/libmysqlclient.16.dylib: Mach-O 64-bit dynamically linked shared library x86_64 mysql5/mysql/libmysqlclient_r.16.dylib: Mach-O 64-bit dynamically linked shared library x86_64 Py2App script setup.py from setuptools import setup setup( app = ['hello.py'], options = { 'py2app': { 'argv_emulation': 0, #'plist': { #plist'LSPrefersPPC': False, #}, 'includes': ['PySide.QtCore', 'PySide.QtGui', 'PySide.QtWebKit', 'PySide.QtNetwork', 'MySQLdb'], 'site_packages': 1 } }, data_files = ['copying.txt'], setup_requires = ['py2app'], ) Does anyone have any ideas of how to correct this. Cheers PrecipiceDev From nad at acm.org Tue Aug 16 02:20:08 2011 From: nad at acm.org (Ned Deily) Date: Mon, 15 Aug 2011 17:20:08 -0700 Subject: [Pythonmac-SIG] Py2App-Lion-MySQLdb Error Msg References: <4E49B196.7050609@gmail.com> Message-ID: In article <4E49B196.7050609 at gmail.com>, "precipice.development" wrote: > ImportError: > dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa > d/_mysql.so, > 2): Symbol not found: _strnlen > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: > /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d > ylib > > Background > Did a Hello World type test app on Lion. Used py2app to bundle it into > an OSX app. Works fine. Copied over to a fresh install of Snow Leopard > 10.6.8 and works fine. Bundle is standalone. > > Now, added MySQLdb and made a database connection on Lion - works as > expected - result returned from simple query. MySQL database is on a > third machine. Now copied bundle over to Snow Leopard machine (again a > fresh install) and received the following error: > > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Traceback (most > recent call last): > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File > "/Users/jph/Public/hello.app/Contents/Resources/__boot__.py", line 57, > in > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] _run('hello.py') > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File > "/Users/jph/Public/hello.app/Contents/Resources/__boot__.py", line 54, > in _run > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] execfile(path, > globals(), globals()) > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File > "/Users/jph/Public/hello.app/Contents/Resources/hello.py", line 9, in > > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] import MySQLdb > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File > "MySQLdb/__init__.pyc", line 19, in > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] ImportError: > dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa > d/_mysql.so, > 2): Symbol not found: _strnlen > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: > /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d > ylib > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Expected in: > /usr/lib/libSystem.B.dylib > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] in > /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d > ylib > 8/15/11 4:30:09 PM hello[716] hello Error > 8/15/11 4:30:10 PM com.apple.launchd.peruser.501[102] > ([0x0-0x2e02e].org.pythonmac.unspecified.hello[716]) Exited with exit > code: 255 > > The key line seems to be ImportError: > dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa > d/_mysql.so, > 2): Symbol not found: _strnlen > 8/15/11 4:30:08 PM > [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: > /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d > ylib > > Python on Lion is from MacPorts. > > Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) > [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on > darwin > Type "help", "copyright", "credits" or "license" for more information. > > /opt/local/bin/python: Mach-O 64-bit executable x86_64 > > MySQLdb is also from MacPorts > > mysql5/mysql/libmysqlclient.16.dylib: Mach-O 64-bit dynamically linked > shared library x86_64 > mysql5/mysql/libmysqlclient_r.16.dylib: Mach-O 64-bit dynamically linked > shared library x86_64 > Py2App script > > setup.py > from setuptools import setup > > setup( > app = ['hello.py'], > options = { > 'py2app': { > 'argv_emulation': 0, > #'plist': { > #plist'LSPrefersPPC': > False, > #}, > 'includes': ['PySide.QtCore', > 'PySide.QtGui', 'PySide.QtWebKit', 'PySide.QtNetwork', 'MySQLdb'], > 'site_packages': 1 > } > }, > data_files = ['copying.txt'], > setup_requires = ['py2app'], > ) > > Does anyone have any ideas of how to correct this. On 10.7, did you build all of the installed MacPorts MySQL packages with MACOSX_DEPLOYMENT_TARGET=10.6 and the 10.6 SDK? (I'm not sure how well that is supported with MacPorts.) It's always dicey building something on release n (10.7 in this case) and using it on release n-1 (10.6) unless you use the appropriate SDK and deployment target. It is generally safe to do the reverse, though: build on 10.6 to deploy on 10.7. -- Ned Deily, nad at acm.org From precipice.development at gmail.com Tue Aug 16 06:13:45 2011 From: precipice.development at gmail.com (precipice.development) Date: Mon, 15 Aug 2011 21:13:45 -0700 Subject: [Pythonmac-SIG] Py2App-Lion-MySQLdb Error Msg In-Reply-To: References: <4E49B196.7050609@gmail.com> Message-ID: <4E49EE79.1020601@gmail.com> On 15/8/11 5:20 PM, Ned Deily wrote: > In article<4E49B196.7050609 at gmail.com>, > "precipice.development" wrote: >> ImportError: >> dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa >> d/_mysql.so, >> 2): Symbol not found: _strnlen >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: >> /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d >> ylib >> >> Background >> Did a Hello World type test app on Lion. Used py2app to bundle it into >> an OSX app. Works fine. Copied over to a fresh install of Snow Leopard >> 10.6.8 and works fine. Bundle is standalone. >> >> Now, added MySQLdb and made a database connection on Lion - works as >> expected - result returned from simple query. MySQL database is on a >> third machine. Now copied bundle over to Snow Leopard machine (again a >> fresh install) and received the following error: >> >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Traceback (most >> recent call last): >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File >> "/Users/jph/Public/hello.app/Contents/Resources/__boot__.py", line 57, >> in >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] _run('hello.py') >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File >> "/Users/jph/Public/hello.app/Contents/Resources/__boot__.py", line 54, >> in _run >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] execfile(path, >> globals(), globals()) >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File >> "/Users/jph/Public/hello.app/Contents/Resources/hello.py", line 9, in >> >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] import MySQLdb >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File >> "MySQLdb/__init__.pyc", line 19, in >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] ImportError: >> dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa >> d/_mysql.so, >> 2): Symbol not found: _strnlen >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: >> /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d >> ylib >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Expected in: >> /usr/lib/libSystem.B.dylib >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] in >> /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d >> ylib >> 8/15/11 4:30:09 PM hello[716] hello Error >> 8/15/11 4:30:10 PM com.apple.launchd.peruser.501[102] >> ([0x0-0x2e02e].org.pythonmac.unspecified.hello[716]) Exited with exit >> code: 255 >> >> The key line seems to be ImportError: >> dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa >> d/_mysql.so, >> 2): Symbol not found: _strnlen >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: >> /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d >> ylib >> >> Python on Lion is from MacPorts. >> >> Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) >> [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on >> darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >> /opt/local/bin/python: Mach-O 64-bit executable x86_64 >> >> MySQLdb is also from MacPorts >> >> mysql5/mysql/libmysqlclient.16.dylib: Mach-O 64-bit dynamically linked >> shared library x86_64 >> mysql5/mysql/libmysqlclient_r.16.dylib: Mach-O 64-bit dynamically linked >> shared library x86_64 >> Py2App script >> >> setup.py >> from setuptools import setup >> >> setup( >> app = ['hello.py'], >> options = { >> 'py2app': { >> 'argv_emulation': 0, >> #'plist': { >> #plist'LSPrefersPPC': >> False, >> #}, >> 'includes': ['PySide.QtCore', >> 'PySide.QtGui', 'PySide.QtWebKit', 'PySide.QtNetwork', 'MySQLdb'], >> 'site_packages': 1 >> } >> }, >> data_files = ['copying.txt'], >> setup_requires = ['py2app'], >> ) >> >> Does anyone have any ideas of how to correct this. > On 10.7, did you build all of the installed MacPorts MySQL packages with > MACOSX_DEPLOYMENT_TARGET=10.6 and the 10.6 SDK? (I'm not sure how well > that is supported with MacPorts.) It's always dicey building something > on release n (10.7 in this case) and using it on release n-1 (10.6) > unless you use the appropriate SDK and deployment target. It is > generally safe to do the reverse, though: build on 10.6 to deploy on > 10.7. > No, I let MacPorts do its default thing. I realise that going with the latest and greatest tends to be dodgy at times. Let me try rebuilding MySQL and see what happens. From precipice.development at gmail.com Tue Aug 16 19:43:26 2011 From: precipice.development at gmail.com (precipice.development) Date: Tue, 16 Aug 2011 10:43:26 -0700 Subject: [Pythonmac-SIG] Py2App-Lion-MySQLdb Error Msg In-Reply-To: References: <4E49B196.7050609@gmail.com> Message-ID: <4E4AAC3E.9050303@gmail.com> On 15/8/11 5:20 PM, Ned Deily wrote: > In article<4E49B196.7050609 at gmail.com>, > "precipice.development" wrote: >> ImportError: >> dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa >> d/_mysql.so, >> 2): Symbol not found: _strnlen >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: >> /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d >> ylib >> >> Background >> Did a Hello World type test app on Lion. Used py2app to bundle it into >> an OSX app. Works fine. Copied over to a fresh install of Snow Leopard >> 10.6.8 and works fine. Bundle is standalone. >> >> Now, added MySQLdb and made a database connection on Lion - works as >> expected - result returned from simple query. MySQL database is on a >> third machine. Now copied bundle over to Snow Leopard machine (again a >> fresh install) and received the following error: >> >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Traceback (most >> recent call last): >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File >> "/Users/jph/Public/hello.app/Contents/Resources/__boot__.py", line 57, >> in >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] _run('hello.py') >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File >> "/Users/jph/Public/hello.app/Contents/Resources/__boot__.py", line 54, >> in _run >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] execfile(path, >> globals(), globals()) >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File >> "/Users/jph/Public/hello.app/Contents/Resources/hello.py", line 9, in >> >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] import MySQLdb >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] File >> "MySQLdb/__init__.pyc", line 19, in >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] ImportError: >> dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa >> d/_mysql.so, >> 2): Symbol not found: _strnlen >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: >> /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d >> ylib >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Expected in: >> /usr/lib/libSystem.B.dylib >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] in >> /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d >> ylib >> 8/15/11 4:30:09 PM hello[716] hello Error >> 8/15/11 4:30:10 PM com.apple.launchd.peruser.501[102] >> ([0x0-0x2e02e].org.pythonmac.unspecified.hello[716]) Exited with exit >> code: 255 >> >> The key line seems to be ImportError: >> dlopen(/Users/jph/Public/hello.app/Contents/Resources/lib/python2.7/lib-dynloa >> d/_mysql.so, >> 2): Symbol not found: _strnlen >> 8/15/11 4:30:08 PM >> [0x0-0x2e02e].org.pythonmac.unspecified.hello[716] Referenced from: >> /Users/jph/Public/hello.app/Contents/MacOS/../Frameworks/libmysqlclient_r.16.d >> ylib >> >> Python on Lion is from MacPorts. >> >> Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05) >> [GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on >> darwin >> Type "help", "copyright", "credits" or "license" for more information. >> >> /opt/local/bin/python: Mach-O 64-bit executable x86_64 >> >> MySQLdb is also from MacPorts >> >> mysql5/mysql/libmysqlclient.16.dylib: Mach-O 64-bit dynamically linked >> shared library x86_64 >> mysql5/mysql/libmysqlclient_r.16.dylib: Mach-O 64-bit dynamically linked >> shared library x86_64 >> Py2App script >> >> setup.py >> from setuptools import setup >> >> setup( >> app = ['hello.py'], >> options = { >> 'py2app': { >> 'argv_emulation': 0, >> #'plist': { >> #plist'LSPrefersPPC': >> False, >> #}, >> 'includes': ['PySide.QtCore', >> 'PySide.QtGui', 'PySide.QtWebKit', 'PySide.QtNetwork', 'MySQLdb'], >> 'site_packages': 1 >> } >> }, >> data_files = ['copying.txt'], >> setup_requires = ['py2app'], >> ) >> >> Does anyone have any ideas of how to correct this. > On 10.7, did you build all of the installed MacPorts MySQL packages with > MACOSX_DEPLOYMENT_TARGET=10.6 and the 10.6 SDK? (I'm not sure how well > that is supported with MacPorts.) It's always dicey building something > on release n (10.7 in this case) and using it on release n-1 (10.6) > unless you use the appropriate SDK and deployment target. It is > generally safe to do the reverse, though: build on 10.6 to deploy on > 10.7. > I went ahead and added the following to macports.conf in order to for the target to 10.6 macosx_deployment_target 10.6 sdkroot /Developer/SDKs/MacOSX10.6.sdk Unfortunately, I got a compilation error in qt :info:build kernel/qt_cocoa_helpers_mac.mm:1523: warning: invalid receiver type ?void *? :info:build make[2]: *** [.obj/debug-shared/qt_cocoa_helpers_mac.o] Error 1 :info:build make[2]: *** Waiting for unfinished jobs.... :info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/ qt-everywhere-opensource-src-4.7.3/src/gui' :info:build make[1]: *** [debug-all] Error 2 :info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/ qt-everywhere-opensource-src-4.7.3/src/gui' :info:build make: *** [sub-gui-all-ordered] Error 2 :info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt- everywhere-opensource-src-4.7.3' :info:build shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/work/qt- everywhere-opensource-src-4.7.3" && /usr/bin/make -j4 -w all " returned error 2 :error:build Target org.macports.build returned: shell command failed (see log for details) :debug:build Backtrace: shell command failed (see log for details) while executing "command_exec build" (procedure "portbuild::build_main" line 8) invoked from within "$procedure $targetname" :info:build Warning: the following items did not execute (for qt4-mac): org.macports.activate org.macports.build org.macports.destroot org.macports.install :error:build Failed to install qt4-mac :notice:build Log for qt4-mac is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_aqua_qt4-mac/qt4-mac/main.log Looks like reverting back may be the only option for now. Thanks for your help. From ronaldoussoren at mac.com Thu Aug 18 15:49:19 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 18 Aug 2011 15:49:19 +0200 Subject: [Pythonmac-SIG] Python on iphone for developers In-Reply-To: <83804.1312489260@parc.com> References: <010c01cc4fe5$bb132180$31396480$@com> <82313.1312484338@parc.com> <1045b3e3974137f8c65564302a520a92@rosspixelworks.com> <83804.1312489260@parc.com> Message-ID: On 4 Aug, 2011, at 22:21, Bill Janssen wrote: > Dan Ross wrote: > >> So how does one use this to make an iOS app then? > > That's an exercise for the reader. Basically, you build an Objective-C > iOS app, but implement the callbacks and program logic as thin C > wrappers that call into Python to get things done. This is simpler with > a working PyObjC for iOS, of course, but I don't know what the status > of that is. There appears to be a port of pyobjc to iOS, but that's not something I support. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Aug 18 15:53:18 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 18 Aug 2011 15:53:18 +0200 Subject: [Pythonmac-SIG] Ownership of installed Python on Mac In-Reply-To: <20110810002437.GA13370@illinois.edu> References: <20110810002437.GA13370@illinois.edu> Message-ID: On 10 Aug, 2011, at 2:24, Nicholas Riley wrote: > On Tue, Aug 09, 2011 at 11:35:11PM +0100, Michael Foord wrote: >> On 9 August 2011 22:42, Ned Deily wrote: >> Hmm... for 3.2 and 2.7 I was using Activestate installers not Python.org >> ones - so perhaps it's their bug (in which case sorry for the noise). > > Nope - this is from a new Mac mini that shipped with Lion and has not > had any non-system Pythons installed: > > bookworm% ls -ld /Library/Python/*/site-packages > drwxr-xr-x 4 root wheel 136 Jun 25 08:05 /Library/Python/2.3/site-packages > drwxr-xr-x 3 root wheel 102 Jul 2 17:08 /Library/Python/2.5/site-packages > drwxr-xr-x 3 root wheel 102 Jul 2 17:08 /Library/Python/2.6/site-packages > drwxr-xr-x 3 root wheel 102 Jul 2 17:08 /Library/Python/2.7/site-packages /Library/Python/x.y/site-packages is a site-packages directory for Apple's copy of Python, the pyhon.org installer uses a site-packages directory embedded in the framework. Ronald -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Aug 18 15:48:16 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 18 Aug 2011 15:48:16 +0200 Subject: [Pythonmac-SIG] Python bridgesupport issue on Lion In-Reply-To: References: Message-ID: On 4 Aug, 2011, at 18:43, luke skywalker wrote: > Hi, > I have Mac OS X Lion 10.7 running. I'm trying to use bluetooth with python. I've installed the lightblue library as it seems to be the only way to have easy access to bluetooth through python. However, when I do: > import lighblue > > I get this: > Traceback (most recent call last): > File "", line 1, in > File "/Library/Python/2.7/site-packages/lightblue/__init__.py", line 160, in > from _lightblue import * > File "/Library/Python/2.7/site-packages/lightblue/_lightblue.py", line 27, in > import _IOBluetooth > File "/Library/Python/2.7/site-packages/lightblue/_IOBluetooth.py", line 47, in > globals=globals()) > File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 142, in initFrameworkWrapper > _parseBridgeSupport(data, globals, frameworkName) > File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/PyObjC/objc/_bridgesupport.py", line 42, in _parseBridgeSupport > objc.parseBridgeSupport(data, globals, frameworkName, *args, **kwds) > ValueError: cftype for 'IOBluetoothDeviceInquiryRef' must include gettypeid_func, tollfree or both > > > Looking at: > /System/Library/Frameworks/IOBluetooth.framework/Versions/A/Resources/BridgeSupport/IOBluetooth.bridgesupport > No cftypes declared in it have a gettypeid function or a tollfree. Anybody knows what's wrong? I've checked other bridgesupport files and they also have the same pattern (cftypes without gettypeid or tollfree). > > Thx. Apple's brigesupport files are hopeless, that's why PyObjC ships with its own copy of them, which btw. is why I haven't done a new release of pyobjc yet: I need to update my version of these files. Ronald > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From janssen at parc.com Thu Aug 18 19:08:10 2011 From: janssen at parc.com (Bill Janssen) Date: Thu, 18 Aug 2011 10:08:10 PDT Subject: [Pythonmac-SIG] Python on iphone for developers In-Reply-To: References: <010c01cc4fe5$bb132180$31396480$@com> <82313.1312484338@parc.com> <1045b3e3974137f8c65564302a520a92@rosspixelworks.com> <83804.1312489260@parc.com> Message-ID: <84286.1313687290@parc.com> Ronald Oussoren wrote: > > On 4 Aug, 2011, at 22:21, Bill Janssen wrote: > > > Dan Ross wrote: > > > >> So how does one use this to make an iOS app then? > > > > That's an exercise for the reader. Basically, you build an Objective-C > > iOS app, but implement the callbacks and program logic as thin C > > wrappers that call into Python to get things done. This is simpler with > > a working PyObjC for iOS, of course, but I don't know what the status > > of that is. > > There appears to be a port of pyobjc to iOS, but that's not something I support. I'm confused. On http://www.saurik.com/id/5, it says, ``Having done this then put me in the perfect frame of mind to try to get other languages over, and the #1 request was Python, which already has an amazing project behind it: PyObjC.'' ``The effort for porting this turned out to be minimal, and the maintainer of the project (Ronald Oussoren) has contacted me about merging my changes, which means that its support that is likely to stay around for quite a while.'' Never happened, eh? The merge, that is. Bill From janssen at parc.com Thu Aug 18 20:03:59 2011 From: janssen at parc.com (Bill Janssen) Date: Thu, 18 Aug 2011 11:03:59 PDT Subject: [Pythonmac-SIG] Python on iphone for developers In-Reply-To: <090A9E37-2571-43C1-8983-1B06EDE491BD@mac.com> References: <010c01cc4fe5$bb132180$31396480$@com> <82313.1312484338@parc.com> <1045b3e3974137f8c65564302a520a92@rosspixelworks.com> <83804.1312489260@parc.com> <84286.1313687290@parc.com> <090A9E37-2571-43C1-8983-1B06EDE491BD@mac.com> Message-ID: <85094.1313690639@parc.com> Ronald Oussoren wrote: > > On 18 Aug, 2011, at 19:08, Bill Janssen wrote: > > > Ronald Oussoren wrote: > > > >> > >> On 4 Aug, 2011, at 22:21, Bill Janssen wrote: > >> > >>> Dan Ross wrote: > >>> > >>>> So how does one use this to make an iOS app then? > >>> > >>> That's an exercise for the reader. Basically, you build an Objective-C > >>> iOS app, but implement the callbacks and program logic as thin C > >>> wrappers that call into Python to get things done. This is simpler with > >>> a working PyObjC for iOS, of course, but I don't know what the status > >>> of that is. > >> > >> There appears to be a port of pyobjc to iOS, but that's not something I support. > > > > I'm confused. On http://www.saurik.com/id/5, it says, > > > > ``Having done this then put me in the perfect frame of mind to try to > > get other languages over, and the #1 request was Python, which already > > has an amazing project behind it: PyObjC.'' > > > > ``The effort for porting this turned out to be minimal, and the > > maintainer of the project (Ronald Oussoren) has contacted me about > > merging my changes, which means that its support that is likely to stay > > around for quite a while.'' > > > > Never happened, eh? The merge, that is. > > The merge never happened and I is unlikely to happen anytime soon. > > I'm not interested in supporting iOS myself, while it is likely that I > will get support calls when I would merge. I can certainly appreciate that just supporting the various flavors of OS X is work enough. Not sure how big the differences are between iOS and OS X, but probably bigger than just between Snow Leopard and Lion. And I also understand the frustration of dangling items on the issue tracker that one has no resources to respond with. So if we (the world) wanted this to happen, we'd have to fork PyObjC? Or would you be willing to add a developer interested in taking on the iOS work? It certainly seems more interesting now that there are Python-powered apps like PyMath in the app store. Bill From ronaldoussoren at mac.com Thu Aug 18 19:12:26 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 18 Aug 2011 19:12:26 +0200 Subject: [Pythonmac-SIG] Python on iphone for developers In-Reply-To: <84286.1313687290@parc.com> References: <010c01cc4fe5$bb132180$31396480$@com> <82313.1312484338@parc.com> <1045b3e3974137f8c65564302a520a92@rosspixelworks.com> <83804.1312489260@parc.com> <84286.1313687290@parc.com> Message-ID: <090A9E37-2571-43C1-8983-1B06EDE491BD@mac.com> On 18 Aug, 2011, at 19:08, Bill Janssen wrote: > Ronald Oussoren wrote: > >> >> On 4 Aug, 2011, at 22:21, Bill Janssen wrote: >> >>> Dan Ross wrote: >>> >>>> So how does one use this to make an iOS app then? >>> >>> That's an exercise for the reader. Basically, you build an Objective-C >>> iOS app, but implement the callbacks and program logic as thin C >>> wrappers that call into Python to get things done. This is simpler with >>> a working PyObjC for iOS, of course, but I don't know what the status >>> of that is. >> >> There appears to be a port of pyobjc to iOS, but that's not something I support. > > I'm confused. On http://www.saurik.com/id/5, it says, > > ``Having done this then put me in the perfect frame of mind to try to > get other languages over, and the #1 request was Python, which already > has an amazing project behind it: PyObjC.'' > > ``The effort for porting this turned out to be minimal, and the > maintainer of the project (Ronald Oussoren) has contacted me about > merging my changes, which means that its support that is likely to stay > around for quite a while.'' > > Never happened, eh? The merge, that is. The merge never happened and I is unlikely to happen anytime soon. I'm not interested in supporting iOS myself, while it is likely that I will get support calls when I would merge. Ronald > > Bill -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From dan at rosspixelworks.com Thu Aug 18 20:59:35 2011 From: dan at rosspixelworks.com (Dan Ross) Date: Thu, 18 Aug 2011 13:59:35 -0500 Subject: [Pythonmac-SIG] Py2app and PyPy Message-ID: Does py2app work with PyPy? Has anyone tried it? From erik.myllymaki at gmail.com Fri Aug 19 19:04:00 2011 From: erik.myllymaki at gmail.com (Erik Myllymaki) Date: Fri, 19 Aug 2011 10:04:00 -0700 Subject: [Pythonmac-SIG] New Mach-O header is too large to relocate Message-ID: <4E4E9780.3040309@gmail.com> I'm trying to make an app on a MB Pro with Snow Leopard(10.6.7) - and keep getting this error: "New Mach-O header is too large to relocate" A quick search found a suggestion about how to fix this: http://www.danplanet.com/home/82-codemonkeying/88-using-py2app-with-gtk basically, in this file: /opt/local/share/macports/Tcl/port1.0/portconfigure.tcl change this line: default configure.ldflags {-L${prefix}/lib} to: default configure.ldflags {"-L${prefix}/lib -Xlinker -headerpad_max_install_names"} and reinstall all macports packages. While this fix has allowed the build process to get further along, it still ends up failing with the same error eventually. Any advice greatly appreciated. From vinay_sajip at yahoo.co.uk Tue Aug 23 10:16:06 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Tue, 23 Aug 2011 08:16:06 +0000 (UTC) Subject: [Pythonmac-SIG] Running PyObjC projects after installing 3.3 for testing Message-ID: I've installed Python 3.3 for some testing on a Leopard machine, and now a 2.x PyObjC application won't run from its bundle because the 3.3 binary in /Library/Frameworks/Python.framework is picked up. Of course if I run python MyBundled.App/Contents/Resources/main.py the system Python (2.5.1) is used, but running MyBundled.App/Contents/MacOS/MyBundled runs with Python 3.3 and, of course, fails because the 2.5 site-packages used aren't found. Short of removing the 3.3 installation (which I still need for testing), how does one configure things so that the /Library/Frameworks/Python.framework binary is skipped and the system Python picked up? I've failed to find the appropriate info via Google, since "bundle", "path" etc. are seemingly too generic to home in on any posted info on the topic. I've considered that it might be a build-time thing, but looking at XCode (3.1.4) preferences, I can't see how to specify a particular Python to use. Thanks, Vinay Sajip From vinay_sajip at yahoo.co.uk Tue Aug 23 14:24:39 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Tue, 23 Aug 2011 12:24:39 +0000 (UTC) Subject: [Pythonmac-SIG] =?utf-8?q?Running_PyObjC_projects_after_installin?= =?utf-8?q?g_3=2E3_for=09testing?= References: Message-ID: Vinay Sajip yahoo.co.uk> writes: > I've considered that it might be a build-time thing, but looking at XCode > (3.1.4) preferences, I can't see how to specify a particular Python to use. Additional info: if I look at "Get Info" for the Python.framework, it shows the one in /System/Library/Frameworks, but otool shows that the executable is linked with the Python.framework in /Library/Frameworks. Regards, Vinay Sajip From ronaldoussoren at mac.com Thu Aug 25 09:47:26 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 25 Aug 2011 09:47:26 +0200 Subject: [Pythonmac-SIG] Running PyObjC projects after installing 3.3 for testing In-Reply-To: References: Message-ID: On 23 Aug, 2011, at 10:16, Vinay Sajip wrote: > I've installed Python 3.3 for some testing on a Leopard machine, and now a 2.x > PyObjC application won't run from its bundle because the 3.3 binary in > /Library/Frameworks/Python.framework is picked up. Of course if I run > > python MyBundled.App/Contents/Resources/main.py > > the system Python (2.5.1) is used, but running > > MyBundled.App/Contents/MacOS/MyBundled > > runs with Python 3.3 and, of course, fails because the 2.5 site-packages used > aren't found. > > Short of removing the 3.3 installation (which I still need for testing), how > does one configure things so that the /Library/Frameworks/Python.framework > binary is skipped and the system Python picked up? I've failed to find the > appropriate info via Google, since "bundle", "path" etc. are seemingly too > generic to home in on any posted info on the topic. > > I've considered that it might be a build-time thing, but looking at XCode > (3.1.4) preferences, I can't see how to specify a particular Python to use. The easiest fix is to open /Library/Frameworks/Python.framework/Versions in the terminal. That directory contains a symlink 'Current', with some luck removing it will re-enable building applications using Xcode, an other alternative it to point the link the version you want to use (you could even link it to /System/Library/Frameworks/Python.framework/Versions/Current). And one final workaround: the configure script has an option named '--with-framework-name=NAME'. This will install the framework as NAME.framework instead of Python.framework. I use this to install multiple build variants of Python, and to keep my regular Python.framework separate from development builds. Ronald > > Thanks, > > Vinay Sajip > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From ronaldoussoren at mac.com Thu Aug 25 09:41:35 2011 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Thu, 25 Aug 2011 09:41:35 +0200 Subject: [Pythonmac-SIG] Py2app and PyPy In-Reply-To: References: Message-ID: <3B94D248-9E42-46E7-A110-ADED62B7BA68@mac.com> On 18 Aug, 2011, at 20:59, Dan Ross wrote: > Does py2app work with PyPy? Has anyone tried it? It probably doesn't work with PyPy at the moment: py2app creates an application bundle by copying your python code, the python framework and common main executable into the appropriate directory structure. The first step should work just fine with PyPy, the other two require changes to py2app to work correctly. The second step should be easy enough, just copy the relevant bits of PyPy instead of CPython. The last step might be harder, the main executable calls CPython API functions and will have to be rewritten. It might be possible to tweak the PyPy build to generate an executable that is useable as this main executable, I don't know if that's possible or how hard that would be. Ronald > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available URL: From vinay_sajip at yahoo.co.uk Thu Aug 25 16:18:57 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Thu, 25 Aug 2011 14:18:57 +0000 (UTC) Subject: [Pythonmac-SIG] Running PyObjC projects after installing 3.3 for testing References: Message-ID: Ronald Oussoren mac.com> writes: > And one final workaround: the configure script has an option named '--with-framework-name=NAME'. This > will install the framework as NAME.framework instead of Python.framework. I use this to install > multiple build variants of Python, and to keep my regular Python.framework separate from development builds. This sounds like a good approach to try. Thanks, Vinay Sajip From half.italian at gmail.com Fri Aug 26 00:32:50 2011 From: half.italian at gmail.com (Sean DiZazzo) Date: Thu, 25 Aug 2011 15:32:50 -0700 Subject: [Pythonmac-SIG] Running PyObjC projects after installing 3.3 for testing In-Reply-To: References: Message-ID: Does virtualenv work on Mac nowadays? It might be another approach. It works great for keeping different installations on the same machine separate. Not sure how it would work with framework builds though. On Thu, Aug 25, 2011 at 7:18 AM, Vinay Sajip wrote: > Ronald Oussoren mac.com> writes: > > > And one final workaround: the configure script has an option named > '--with-framework-name=NAME'. This > > will install the framework as NAME.framework instead of Python.framework. > I > use this to install > > multiple build variants of Python, and to keep my regular > Python.framework > separate from development builds. > > This sounds like a good approach to try. > > Thanks, > > Vinay Sajip > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG > -------------- next part -------------- An HTML attachment was scrubbed... URL: From pazerp at hotmail.com Thu Aug 18 22:45:36 2011 From: pazerp at hotmail.com (Paul Patterson) Date: Thu, 18 Aug 2011 21:45:36 +0100 Subject: [Pythonmac-SIG] installation trouble Message-ID: I'm trying to install py-appscript to work with Python 3.1. My first attempt didn't exactly fail, rather py-appscript installed itself to work with the version of Python pre-installed on my computer (Python 2.6 on macbook pro running snow leopard). In an effort to get it working with 3.1, I then downloaded distribute 0.6.19 and appscript 1.0, moved them both to the directory where python 3.1 is installed. I installed distribute then tried to install appscript. After spewing out a ton of error messages, it ended with the line "error: command 'gcc-4.0 failed with exit status 1". Thinking it maybe had something to do with gcc (though I've no idea what gcc is), I ran the command: export CC=/usr/bin/gcc-4.0 Unfortunately It still didn't work and returned another error message (see attachment for screenshot). Can anyone tell me what my next step should be? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: errorMessage.png Type: image/png Size: 29309 bytes Desc: not available URL: From vinay_sajip at yahoo.co.uk Fri Aug 26 10:49:48 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Fri, 26 Aug 2011 09:49:48 +0100 (BST) Subject: [Pythonmac-SIG] Running PyObjC projects after installing 3.3 for testing In-Reply-To: References: Message-ID: <1314348588.85107.YahooMailNeo@web25802.mail.ukl.yahoo.com> Hi Sean, Thanks for your suggestion. virtualenv does work on Macs (and I do use it), but in this case it's not a solution - the problem is which Python framework is used when linking the C stub for the Python application. Ronald's suggestion to use another name than "Python.framework" does the job, though. Regards, Vinay Sajip >________________________________ >Does virtualenv work on Mac nowadays? ?It might be another approach. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nad at acm.org Sat Aug 27 08:12:48 2011 From: nad at acm.org (Ned Deily) Date: Fri, 26 Aug 2011 23:12:48 -0700 Subject: [Pythonmac-SIG] installation trouble References: Message-ID: In article , Paul Patterson wrote: > I'm trying to install py-appscript to work with Python 3.1. My first attempt > didn't exactly fail, rather py-appscript installed itself to work with the > version of Python pre-installed on my computer (Python 2.6 on macbook pro > running snow leopard). In an effort to get it working with 3.1, I then > downloaded distribute 0.6.19 and appscript 1.0, moved them both to the > directory where python 3.1 is installed. I installed distribute then tried > to install appscript. After spewing out a ton of error messages, it ended > with the line > "error: command 'gcc-4.0 failed with exit status 1". > > Thinking it maybe had something to do with gcc (though I've no idea what gcc > is), I ran the command: > export CC=/usr/bin/gcc-4.0 > Unfortunately It still didn't work and returned another error message (see > attachment for screenshot). > > Can anyone tell me what my next step should be? If you are using a python.org Python 3.1 and have installed Distribute properly, you should be able to use it by ensuring that the Python 3 bin directory is on your shell PATH. One way to do that, temporarily for one terminal session, is to enter the following: export PATH=/Library/Frameworks/Python.framework/Versions/3.1/bin:"$PATH" then you should be able to install Appscript with: easy_install-3.1 appscript Because py-appscript includes a C extension module, you need to ensure that you have the Apple Developer Tools package (aka Xcode) installed. For OS X 10.6 (Snow Leopard) there are two versions of Xcode available: the original Xcode 3 which should have come with your Mac's install DVD or with the retail copy of Snow Leopard. If not, it can be downloaded (after free registration) from the Apple Developer Connection website. There is also a newer Xcode 4, which is somewhat experimental for Snow Leopard but is standard on OS X 10.7, Lion. Be aware that Python 3.1 is already obsolete and in security fix mode only. Python 3.2.1 is current and 3.2.2 is scheduled to be released this weekend. If you are using the standard python.org Python 3.1 installer, you will likely have problems installing packages like appscript if you have installed Xcode 4 and you will definitely have problems if you upgrade to Lion. For all of these reasons unless you have a specific need to stick with 3.1, I would strongly urge you to, instead, install the latest 64-bit/32-bit installer for Python 3.2 (a 3.2.2 installer should be available by Monday or so): http://www.python.org/download/ That will work fine with either Xcode 3 or Xcode 4 and either Snow Leopard or Lion. You'll need to reinstall Distribute for it. And just change the "3.1" to "3.2" in the "export" command above. -- Ned Deily, nad at acm.org From praveen.venkata at gmail.com Mon Aug 29 03:04:30 2011 From: praveen.venkata at gmail.com (Praveen) Date: Sun, 28 Aug 2011 21:04:30 -0400 Subject: [Pythonmac-SIG] Button Label change on EVT_BUTTON in wxpython!!! Message-ID: Some system info before proceeding further: Platform: Mac OS X 10.7.1 Python Version: ActiveState Python 2.7.1 wxPython Version: [url= http://downloads.sourceforge.net/wxpython/wxPython2.9-osx-2.9.2.1-cocoa-py2.7.dmg]wxPython2.9-osx-cocoa-py2.7[/url ] I want the button label to be changed while performing a task So, here is what I did/want: self.run_button=wx.Button(self.panel,ID_RUN_BUTTON,label='Install') self.Bind(wx.EVT_BUTTON, self.OnRun,id=ID_RUN_BUTTON) def OnRun(self,evt): self.run_button.SetLabel('Installing..') #call a function that does the installation task installation_task() #After task completion, set the button label back to "Install" self.run_button.SetLabel('Install') When I try doing this, it doesn't set the label to "Installing" while the task is being performed. Any suggestions how do I achieve this? -- Have a nice day !!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinay_sajip at yahoo.co.uk Mon Aug 29 14:00:23 2011 From: vinay_sajip at yahoo.co.uk (Vinay Sajip) Date: Mon, 29 Aug 2011 12:00:23 +0000 (UTC) Subject: [Pythonmac-SIG] PyObjC and signal handling Message-ID: How does PyObjC deal with signals received by an application? If I run a windowed PyObjC application, I can't interrupt it with Ctrl-C (this is on Leopard). I know this is no big deal, since I can always use Cmd-., but there are instances where a signal might be sent programmatically to a process. In such cases, a Python-installed signal handler would not be invoked if the application is inside C code waiting for events, until it returns from C back to Python code - potentially a long delay if no other events arrive for a while. There appears to be code in the PyObjC codebase to deal with it (e.g. installMachInterrupt) but I can't see how it gets called. It appears to use a C-level library called _machsignals, which I can't find on the system. Is this particular functionality in PyObjC no longer used? Thanks for any pointers, Vinay Sajip From Chris.Barker at noaa.gov Mon Aug 29 18:09:36 2011 From: Chris.Barker at noaa.gov (Chris.Barker) Date: Mon, 29 Aug 2011 09:09:36 -0700 Subject: [Pythonmac-SIG] Button Label change on EVT_BUTTON in wxpython!!! In-Reply-To: References: Message-ID: <4E5BB9C0.8070604@noaa.gov> A) this is a good question for the wxPython list -- probably not a Mcac issue B) http://wiki.wxpython.org/MakingSampleApps That being said: > self.run_button=wx.Button(self.panel,ID_RUN_BUTTON,label='Install') > self.Bind(wx.EVT_BUTTON, self.OnRun,id=ID_RUN_BUTTON) I prefer this style: self.run_button=wx.Button(self.panel, label='Install') self.run_button.Bind(wx.EVT_BUTTON, self.OnRun) explicit IDs are kind of ugly. http://wiki.wxpython.org/wxPython%20Style%20Guide def OnRun(self,evt): self.run_button.SetLabel('Installing..') #call a function that does the installation task installation_task() #After task completion, set the button label back to "Install" self.run_button.SetLabel('Install') > When I try doing this, it doesn't set the label to "Installing" while > the task is being performed. Any suggestions how do I achieve this? wx blocks the event loop (and locks up the GUI) when handling an event, so you need to separate out the installation_task() function. This may work: def OnRun(self,evt): self.run_button.SetLabel('Installing..') #call a function that does the installation task wx.CallAfter(installation_task()) #After task completion, set the button label back to "Install" wx.CallAfter(self.run_button.SetLabel('Install')) wx.CallAfter() puts an event on the event stack, then proceeds on, so the OnRun() function can finish, the GUI will update, then the events will be run. Another option would be to post en event that's bound to the installation_task() function, and call that from OnRun, then have it post antoher even when it's done -- but that's really jsut a more complicated way to do the above. Third option: try calling "self.run_button.Update()", after changing the button text. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (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