From jdc at uwo.ca Tue Oct 2 01:05:59 2007 From: jdc at uwo.ca (Dan Christensen) Date: Mon, 01 Oct 2007 19:05:59 -0400 Subject: [Pythonmac-SIG] python program in menu bar References: <24d517dd0709262116r6be377a6q3d8ba2b139d04f2b@mail.gmail.com> <24d517dd0709292216w7225e9c8p285efa8e4aef054d@mail.gmail.com> Message-ID: Another question: is there a way I can make an LED on my MacBook Pro flash? My program is a mail notifier, and I'd like to know when I have new mail without unblanking my screen, something I'm used to with xbuffy under linux. The LEDs I'm thinking of are the caplocks light, the light to the left of the latch for the lid, and the LED on the power connector, but if there's another I haven't thought of that would be fine too. A google search didn't turn anything up... Dan From delza at livingcode.org Tue Oct 2 06:15:43 2007 From: delza at livingcode.org (Dethe Elza) Date: Mon, 1 Oct 2007 21:15:43 -0700 Subject: [Pythonmac-SIG] python program in menu bar In-Reply-To: References: <24d517dd0709262116r6be377a6q3d8ba2b139d04f2b@mail.gmail.com> <24d517dd0709292216w7225e9c8p285efa8e4aef054d@mail.gmail.com> Message-ID: <24d517dd0710012115t5d602bbr101d84969f80542d@mail.gmail.com> Hi Dan, On 10/1/07, Dan Christensen wrote: > Another question: is there a way I can make an LED on my MacBook Pro > flash? My program is a mail notifier, and I'd like to know when I have > new mail without unblanking my screen, something I'm used to with xbuffy > under linux. The LEDs I'm thinking of are the caplocks light, the light > to the left of the latch for the lid, and the LED on the power > connector, but if there's another I haven't thought of that would be > fine too. A google search didn't turn anything up... I agree that would be cool to do, but I don't know how to do it. Does anyone else here know how to blink the LEDs on a MacBook? --Dethe From massimodisasha at yahoo.it Tue Oct 2 12:25:29 2007 From: massimodisasha at yahoo.it (massimo di stefano) Date: Tue, 2 Oct 2007 12:25:29 +0200 Subject: [Pythonmac-SIG] pywps on mac osx Message-ID: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> HI Apologize me for this mail if it is off topic here... i'm new to python, i've just a little experience about this wonderfull language :-) i'm tring to configure a python web processing server "pywps" on my mbp http://pywps.wald.intevation.org/ it is an open project to port python environment on the web to use it in on-line mapping application like web-gis i'm tring to configure it on mac osx but it don't works as aspected, i tried to resolve the problem with the developpers of pywps but they haven't a mac machine to try it :-( pywps is designed to use application like R or GRASS installed on a server and use this application with local data trought the web , with local data. to configure and try it, a Grass installation is needed, have any experience about? i'v grass installed from source and i followed the instruction to install pywps, but i've an error to import the "subprocess" routine (colling it from pyshall : - import subprocess it works ) the error that i've is : ./wps.py "service=WPS&version=0.4.0&request=getcapabilities" Traceback (most recent call last): File "./wps.py", line 74, in ? raise ServerError(e) File "/Library/WebServer/CGI-Executables/pywps-2.0.0-rc3/pywps/Wps/ wpsexceptions.py", line 105, in __init__ raise NoApplicableCode(value) pywps.Wps.wpsexceptions.NoApplicableCodePyWPS NoApplicableCode: No module named subprocess Content-type: text/xml to configure it this is what i done : cp /pywps-2.0.0-rc4 /Library/WebServer/CGI-Executables/pywps-2.0.0- rc4/ cd /Library/WebServer/CGI-Executables/pywps-2.0.0-rc4/ python setup.py install ln -s /Library/WebServer/CGI-Executables/pywps-2.0.0-rc4/wps.py / Library/WebServer/CGI-Executables/wps.py i'm very happy if anyone mac python expert, woul?d give me an help to figure out :-) if you wont try it, i can post the instruction needed to have a mac grass installation. (it have a .app make file to build a binary installation to solve the grass dependancies a really nice frameworks are avaible on : http://www.kyngchaos.com/software/unixport/ ) thanks for any suggestion about! Massimo. From hraban at fiee.net Tue Oct 2 13:52:56 2007 From: hraban at fiee.net (Henning Hraban Ramm) Date: Tue, 2 Oct 2007 13:52:56 +0200 Subject: [Pythonmac-SIG] pywps on mac osx In-Reply-To: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> References: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> Message-ID: Am 2007-10-02 um 12:25 schrieb massimo di stefano: > ./wps.py "service=WPS&version=0.4.0&request=getcapabilities" > Traceback (most recent call last): > File "./wps.py", line 74, in ? > raise ServerError(e) > File "/Library/WebServer/CGI-Executables/pywps-2.0.0-rc3/pywps/Wps/ > wpsexceptions.py", line 105, in __init__ > raise NoApplicableCode(value) > pywps.Wps.wpsexceptions.NoApplicableCodePyWPS NoApplicableCode: No > module named subprocess > Content-type: text/xml "No module named subprocess" seems rather clear to me, even if that normally rises an ImportError. I guess you run Python 2.3? AFAIR subprocess is a core library since 2.4, before you could install it separately. Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From tmj at visi.com Tue Oct 2 14:19:11 2007 From: tmj at visi.com (Thomas Juntunen) Date: Tue, 2 Oct 2007 07:19:11 -0500 Subject: [Pythonmac-SIG] pywps on mac osx In-Reply-To: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> References: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> Message-ID: <20071002071911693435.7e5b13e5@visi.com> On Tue, 2 Oct 2007 12:25:29 +0200, massimo di stefano wrote: > i'm tring to configure a python web processing server "pywps" on my mbp > > http://pywps.wald.intevation.org/ > > it is an open project to port python environment on the web > to use it in on-line mapping application like web-gis I haven't used GRASS, but Barry Rowlingson just presented at FOSS4G about an integrated system called "Arlat" using Quantum GIS (available for Mac OS X) for desktop mapping and R as a statistics engine, connected with Python. http://www.foss4g2007.org/presentations/view.php?abstract_id=135 He is planning on posting details to the R-SIG-Geo list (https://stat.ethz.ch/mailman/listinfo/r-sig-geo), but there is a paper describing the implementation here: http://www.bepress.com/cgi/viewcontent.cgi?article=1103&context=jhubiostat I'm looking into this for use with MapServer: http://mapserver.gis.umn.edu/ William Kyngesburye has Mac OS X binaries of MapServer at his kyngchaos site, although I don't recall if they use Apple's Apache 1.3 or permit you to install your own Apache 2. This doesn't solve your immediate problem, but if you want to serve up spatial data via a web interface, I think you'll find MapServer much easier to use than rolling your own. Thomas Juntunen From scotthz at yahoo.com Tue Oct 2 16:24:01 2007 From: scotthz at yahoo.com (scott herzinger) Date: Tue, 2 Oct 2007 10:24:01 -0400 Subject: [Pythonmac-SIG] python program in menu bar In-Reply-To: <24d517dd0710012115t5d602bbr101d84969f80542d@mail.gmail.com> References: <24d517dd0709262116r6be377a6q3d8ba2b139d04f2b@mail.gmail.com> <24d517dd0709292216w7225e9c8p285efa8e4aef054d@mail.gmail.com> <24d517dd0710012115t5d602bbr101d84969f80542d@mail.gmail.com> Message-ID: I assume, but don't know for certain, that MacBook keyboards are USB HID devices. In that case, this document: http://www.usb.org/developers/devclass_docs/Hut1_11.pdf discusses extended HID usages, including those which can be used in toggling on/off controls, of which LEDs are one instance. From there, I'd go to the IOKit framework and see what APIs exist for playing with OOCs. IOHIDUsageTables.h contains useful constants. Scott On Oct 2, 2007, at 12:15 AM, Dethe Elza wrote: > Hi Dan, > > On 10/1/07, Dan Christensen wrote: >> Another question: is there a way I can make an LED on my MacBook Pro >> flash? My program is a mail notifier, and I'd like to know when I >> have >> new mail without unblanking my screen, something I'm used to with >> xbuffy >> under linux. The LEDs I'm thinking of are the caplocks light, the >> light >> to the left of the latch for the lid, and the LED on the power >> connector, but if there's another I haven't thought of that would be >> fine too. A google search didn't turn anything up... > > I agree that would be cool to do, but I don't know how to do it. Does > anyone else here know how to blink the LEDs on a MacBook? > > --Dethe > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From Chris.Barker at noaa.gov Tue Oct 2 18:33:24 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 02 Oct 2007 09:33:24 -0700 Subject: [Pythonmac-SIG] pywps on mac osx In-Reply-To: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> References: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> Message-ID: <470272D4.30902@noaa.gov> massimo di stefano wrote: > i'm tring to configure a python web processing server "pywps" on my mbp > > http://pywps.wald.intevation.org/ building stuff on OS-X is often a bit different than other *nix systems. I'd recommend that you try using these packages: http://www.kyngchaos.com/software/unixport And also use the Framework Python 2.5 from: http://pythonmac.org/packages/py25-fat/index.html That's a good source of other assorted packages that you may need, also. Good luck! -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 massimodisasha at yahoo.it Tue Oct 2 21:35:52 2007 From: massimodisasha at yahoo.it (massimo di stefano) Date: Tue, 2 Oct 2007 21:35:52 +0200 Subject: [Pythonmac-SIG] pywps on mac osx In-Reply-To: <20071002071911693435.7e5b13e5@visi.com> References: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> <20071002071911693435.7e5b13e5@visi.com> Message-ID: Hi, thanks for the suggestion, already i've installed on my mac grass, qgis, R, ossim, ossimplanet, mapserver + kamap all works fine :-) thanks to william and to all mac comunity (really great people !) i'll try to explain why a wps : i need pywps beacouse my targhet is to have a web-processing server (not a simple web gis) i.e. use the function of grass and R (installed on a server) through the web, by a web-gis interface called from a kml file loaded into ossimplanet. something like "embrio" or "openlayer + pywps" : http:// pywps.ominiverdi.org/ i need this solution to try the integration of ossimplanet too ossimplanet is able to load kml file and wms map i done a script to produce kml , elevation-data and wms map from grass data, using pywps i can integrate this script in ossimplanet using the "kml" as connection point apologize me for my englesh and for the bad explanation of what i want try to do :-/ let me know if anyone wont help me toinstall pywps :-) thanks for any suggestion! Massimo. Il giorno 02/ott/07, alle ore 14:19, Thomas Juntunen ha scritto: > On Tue, 2 Oct 2007 12:25:29 +0200, massimo di stefano wrote: > >> i'm tring to configure a python web processing server "pywps" on >> my mbp >> >> http://pywps.wald.intevation.org/ >> >> it is an open project to port python environment on the web >> to use it in on-line mapping application like web-gis > > I haven't used GRASS, but Barry Rowlingson just presented at FOSS4G > about an > integrated system called "Arlat" using Quantum GIS (available for > Mac OS X) for > desktop mapping and R as a statistics engine, connected with Python. > > http://www.foss4g2007.org/presentations/view.php?abstract_id=135 > > He is planning on posting details to the R-SIG-Geo list > (https://stat.ethz.ch/mailman/listinfo/r-sig-geo), but there is a > paper > describing the implementation here: > http://www.bepress.com/cgi/viewcontent.cgi? > article=1103&context=jhubiostat > > I'm looking into this for use with MapServer: > http://mapserver.gis.umn.edu/ > > William Kyngesburye has Mac OS X binaries of MapServer at his > kyngchaos site, > although I don't recall if they use Apple's Apache 1.3 or permit > you to install > your own Apache 2. > > This doesn't solve your immediate problem, but if you want to serve > up spatial > data via a web interface, I think you'll find MapServer much easier > to use than > rolling your own. > > Thomas Juntunen From Chris.Barker at noaa.gov Tue Oct 2 22:11:39 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 02 Oct 2007 13:11:39 -0700 Subject: [Pythonmac-SIG] pywps on mac osx In-Reply-To: References: <5F95C6BF-AC03-450F-9492-34AEC05F3C57@yahoo.it> <20071002071911693435.7e5b13e5@visi.com> Message-ID: <4702A5FB.9030402@noaa.gov> massimo di stefano wrote: > let me know if anyone wont help me toinstall pywps :-) You need to tell us what you've done so far, and what the errors are. IN any case: 1) install the Framework build of either python2.4 or 2.5 (whichever one the pywps folks are using) 2) What python external modules does pywps require? Are they in the repository at pythonmac.org/packages 3) Does pywps have any compiled components? If so, try building them with "setup.py build". If that doesn't work, what errors do you get? etc.... -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 massimodisasha at yahoo.it Wed Oct 3 03:13:19 2007 From: massimodisasha at yahoo.it (massimo di stefano) Date: Wed, 3 Oct 2007 03:13:19 +0200 Subject: [Pythonmac-SIG] pywps on mac osx Message-ID: <4F453ADB-683D-4425-BD1B-44300710D683@yahoo.it> HI how defoult i'm using the framework build 2.5 : Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) /Library/Frameworks/Python.framework/Versions/2.5/bin/python i'v also : - Python 2.4.4 (#1, Oct 18 2006, 10:34:39) /Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4 whith a sim link in : /usr/local/bin/python2.4 and a fink installation : - Python 2.4.3 (#1, Aug 8 2007, 21:43:02) /sw/bin/python2.4 From the pywps doc about the required extra packages (only xml is required ) this is what i done to install pywps : - unzip the archive pywps-2.0.0.tar.gz and copy the pywps-2.0.0-rc4 folder in : /Library/WebServer/CGI-Executables/ - cd /Library/WebServer/CGI-Executables/pywps-2.0.0-rc4/ - python setup.py install - ln -s /Library/WebServer/CGI-Executables/pywps-2.0.0-rc4/wps.py / Library/WebServer/CGI-Executables/wps.py in /Library/WebServer/CGI-Executables/pywps-2.0.0-rc4/pywps/processes/ - renamed __init__.py-dist to __init__.py and addvalue.py-dist to addvalue.py in __init__.py - added a comment to all processes axcept for : addvalue.py it looks like : __all__ = [ "addvalue", # "classify" , # "flow", # "ndvi", # "shortestpath", # "spearpath", # "visibility", # "inputsoutputs", # "buffer", # "convert", ] - created a directory in : /Library/WebServer/Documents/wps/wpsoutputs/ ( it have read-write permisions ) - modified the file : /Library/WebServer/CGI-Executables/pywps-2.0.0-rc4/pywps/settings.py /Library/WebServer/CGI-Executables/pywps-2.0.0-rc4/pywps/etc/grass.py to reflect my environment to test if it works (as explained in the docs) i tried to run : cd /Library/WebServer/CGI-Executables/pywps-2.0.0-rc4/pywps/ ./wps.py http://rafb.net/p/lvWEOw58.html http://rapidshare.com/files/59870693/pywps_setting.tgz.html i have grass installed from source in : /usr/local/grass-6.3.cvs this is the error log : computer-di-epifanio:/Library/WebServer/CGI-Executables/pywps-2.0.0- rc1 epifanio$ ./wps.py Traceback (most recent call last): File "./wps.py", line 73, in ? raise ServerError(e) File "/Library/WebServer/CGI-Executables/pywps-2.0.0-rc1/pywps/Wps/ wpsexceptions.py", line 105, in __init__ raise NoApplicableCode(value) pywps.Wps.wpsexceptions.NoApplicableCodePyWPS NoApplicableCode: No module named subprocess mybe i'm missing/wrong something :-( thanks for your help :-) Massimo. Il giorno 02/ott/07, alle ore 22:11, Christopher Barker ha scritto: massimo di stefano wrote: let me know if anyone wont help me toinstall pywps :-) You need to tell us what you've done so far, and what the errors are. IN any case: 1) install the Framework build of either python2.4 or 2.5 (whichever one the pywps folks are using) 2) What python external modules does pywps require? Are they in the repository at pythonmac.org/packages 3) Does pywps have any compiled components? If so, try building them with "setup.py build". If that doesn't work, what errors do you get? etc.... -Chris -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071003/a59ad3c4/attachment-0001.htm From massimodisasha at yahoo.it Wed Oct 3 03:14:49 2007 From: massimodisasha at yahoo.it (massimo di stefano) Date: Wed, 3 Oct 2007 03:14:49 +0200 Subject: [Pythonmac-SIG] pywps on mac osx Message-ID: HI Il giorno 03/ott/07, alle ore 00:36, Thomas Juntunen ha scritto: > On Tue, 2 Oct 2007 21:35:52 +0200, massimo di stefano wrote: > >> grass, qgis, R, ossim, ossimplanet, mapserver + kamap >> all works fine :-) > > Wow, you're way ahead of me. :-) i've used grass ossim and R for my study but i'm really newbie to the web section. i've installed mapserver 5 from william's binary package and setup kamap for the first time a week ago ...so i've a lot of things to learn about web and web-gis deveopping > > >> i'll try to explain why a wps : >> >> i need pywps beacouse my targhet is to have a web-processing >> server (not a >> simple web gis) >> >> i.e. use the function of grass and R (installed on a server) >> through the >> web, by a web-gis interface >> called from a kml file loaded into ossimplanet. >> >> something like "embrio" or "openlayer + pywps" : http:// >> pywps.ominiverdi.org/ >> >> i need this solution to try the integration of ossimplanet too >> >> ossimplanet is able to load kml file and wms map > > OK, but I think this is just another way to do the same things. > MapServer + > Apache also can handle WPS/WMS, has Java/PHP/Python and even > JavaScript > interfaces for both client and server side processing. As far as > graphics, > MapServer uses GDAL to handle them, so should handle anything the > Ominiverdi > platform can. Plus, the brand new version 5.0 has something new > called AGG that > has the MapServer mailing list all excited. > > Possibly KML is a problem, but lots of people seem able to use > Google's KML > with MapServer so there is probably a way. i've a scarse knowdledge about the web tools that we can use i do not know what tools can i prefer to do this. i've decided to use pywps, only beacouse whit it i can use a grass sintax to performs processes and use a lot of grass commands that is familiar to me. can other tools cominicate with grass as well we can do using pywps ? > >> i done a script to produce kml , elevation-data and wms map from >> grass data, >> >> using pywps i can integrate this script in ossimplanet using the >> "kml" as >> connection point > > I guess since you've got several pieces already running, it makes > sense to use > them. From reading the MapServer mailing list, it's clear to me > that there is a > lot involved with serving WMS that's scalable and reasonably fast. > I wouldn't > want to drag the extra complexity/overhead of a web services > framework in > unless it provided something I couldn't get any other way. > to produce wms map i'll use mapserv as it is, so no pywps for this, what probably i need is to set-up a link into the kml that point to a form where one can select what grass layer want convert to wms feature use wps to export the layer (or produce it if no exist ... like ndvi etc..) then use a script to produce a mapserv wms map to (at the moment i ignore how manage this part, never tried it) and use pywps to run specific grass script to produce some output loadable with ossimplanet and put this output in a ftp connection to download and load it. > Regardless, I hope you can get pywps going. I wish I knew more > about Python and > could offer some useful advice. > i've send a mail where i tried to describe how i'm tring to install pywps >> apologize me for my englesh and for the bad explanation of what >> i want try >> to do :-/ > > I think I understood what you were saying. I don't speak any > Italian at all, so > again, you are way ahead of me! ;-) chat and ml are my englesh teachers .... i hope that you never listen my englesh :-) thanks fro your help! Massimo Di stefano > > Thomas Juntunen From massimodisasha at yahoo.it Wed Oct 3 03:27:31 2007 From: massimodisasha at yahoo.it (massimo di stefano) Date: Wed, 3 Oct 2007 03:27:31 +0200 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 54, Issue 3 In-Reply-To: References: Message-ID: <49F8B13F-E7B5-4322-8642-983A1C0EC803@yahoo.it> hi i'm using python 2.5 from the python shall subprocess works : host716:~ epifanio$ python Python 2.5.1 (r251:54869, Apr 18 2007, 22:08:04) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess >>> >>> >>> from subprocess import * >>> to macpython * thanks for your time, you're very kind! Massimo Il giorno 03/ott/07, alle ore 03:15, pythonmac-sig-request at python.org ha scritto: > "No module named subprocess" > seems rather clear to me, even if that normally rises an ImportError. > > I guess you run Python 2.3? > AFAIR subprocess is a core library since 2.4, before you could > install it separately. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071003/b82f5653/attachment.htm From ronaldoussoren at mac.com Wed Oct 3 07:28:27 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 3 Oct 2007 07:28:27 +0200 Subject: [Pythonmac-SIG] pywps on mac osx In-Reply-To: <4F453ADB-683D-4425-BD1B-44300710D683@yahoo.it> References: <4F453ADB-683D-4425-BD1B-44300710D683@yahoo.it> Message-ID: <1438A194-1275-4968-876E-8980C929EB8B@mac.com> On 3 Oct, 2007, at 3:13, massimo di stefano wrote: > > > this is the error log : > > computer-di-epifanio:/Library/WebServer/CGI-Executables/pywps-2.0.0- > rc1 epifanio$ ./wps.py > Traceback (most recent call last): > File "./wps.py", line 73, in ? > raise ServerError(e) > File > "/Library/WebServer/CGI-Executables/pywps-2.0.0-rc1/pywps/Wps/ > wpsexceptions.py", line 105, in __init__ > raise NoApplicableCode(value) > pywps.Wps.wpsexceptions.NoApplicableCodePyWPS NoApplicableCode: No > module named subprocess > > > mybe i'm missing/wrong something :-( What's the first line of 'wps.py'? I get the feeling that wps.py is using a different python interpreter than you are thinking it is. Ronald From massimodisasha at yahoo.it Wed Oct 3 10:38:20 2007 From: massimodisasha at yahoo.it (massimo di stefano) Date: Wed, 3 Oct 2007 10:38:20 +0200 Subject: [Pythonmac-SIG] pywps on mac osx In-Reply-To: <1438A194-1275-4968-876E-8980C929EB8B@mac.com> References: <4F453ADB-683D-4425-BD1B-44300710D683@yahoo.it> <1438A194-1275-4968-876E-8980C929EB8B@mac.com> Message-ID: Il giorno 03/ott/07, alle ore 07:28, Ronald Oussoren ha scritto: > > On 3 Oct, 2007, at 3:13, massimo di stefano wrote: >> >> >> this is the error log : >> >> computer-di-epifanio:/Library/WebServer/CGI-Executables/ >> pywps-2.0.0-rc1 epifanio$ ./wps.py >> Traceback (most recent call last): >> File "./wps.py", line 73, in ? >> raise ServerError(e) >> File >> "/Library/WebServer/CGI-Executables/pywps-2.0.0-rc1/pywps/Wps/ >> wpsexceptions.py", line 105, in __init__ >> raise NoApplicableCode(value) >> pywps.Wps.wpsexceptions.NoApplicableCodePyWPS NoApplicableCode: No >> module named subprocess >> >> >> mybe i'm missing/wrong something :-( > > What's the first line of 'wps.py'? I get the feeling that wps.py is > using a different python interpreter than you are thinking it is. > yor're right!!! it use as interpreter : #!/usr/bin/python that is the osx standard python 2.3 changing to the right environment i not have the "subprocess" error :-) now i'll try to read more about the pywps setting and try to configure it to do some example. and see what happens. thanks to all !!! > Ronald > From altern2 at gmail.com Wed Oct 3 11:16:06 2007 From: altern2 at gmail.com (altern) Date: Wed, 03 Oct 2007 11:16:06 +0200 Subject: [Pythonmac-SIG] was : py2app: how to include the entire standard library of modules? Message-ID: <47035DD6.4080608@gmail.com> hi Nick did you finally manage to include the entire standard library into an executable app? I am pretty interested to know about this, I had an idea where I needed to achieve this and I want to try again. thanks! enrike From jack at nocixel.com Wed Oct 3 12:12:48 2007 From: jack at nocixel.com (jack rothwell) Date: Wed, 3 Oct 2007 11:12:48 +0100 Subject: [Pythonmac-SIG] py2app? Message-ID: hi. can anyone tell me how to use py2app? im just a novice python programmer and i have no idea how to use it. does anyone know if theres a gui version around? i have no idea what distutils or anything like that even MEANS. i just want to be able to send pygame games to friends. please help! give me a push in the right direction! una.x From altern2 at gmail.com Wed Oct 3 15:45:42 2007 From: altern2 at gmail.com (altern) Date: Wed, 03 Oct 2007 15:45:42 +0200 Subject: [Pythonmac-SIG] py2app? In-Reply-To: References: Message-ID: <47039D06.5080501@gmail.com> hi there was a gui version for py2exe (windows equivalent of py2app) but i dont know any for py2app. Anyway if what you are doing is simple you can easily deal with the setup.py script. this is the py2app documentation http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html the option reference http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html#option-reference Attached there is an example of a setup.py script that uses pygame, i think it should work, you just need to edit the name variable and run it like this $ python setup.py py2app However if you have assets like images, sounds etc... you need to make sure that they are also included, check the extra_file variable. IN that example it will put a file "data/slicer_pd.pd" into a folder called "data" inside the app. Otherwise keep extra_files = [] Please anyone correct if there is anything wrong, i just quickly put this together from another more complex script. good luck enrike jack rothwell(e)k dio: > hi. > can anyone tell me how to use py2app? im just a novice python > programmer and i have no idea how to use it. does anyone know if > theres a gui version around? i have no idea what distutils or > anything like that even MEANS. i just want to be able to send pygame > games to friends. > please help! give me a push in the right direction! > una.x > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -------------- next part -------------- A non-text attachment was scrubbed... Name: setup.py Type: text/x-python Size: 467 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071003/19048c2b/attachment.py From brett.calcott at gmail.com Wed Oct 3 16:24:20 2007 From: brett.calcott at gmail.com (Brett Calcott) Date: Thu, 4 Oct 2007 00:24:20 +1000 Subject: [Pythonmac-SIG] entire applications in python? Message-ID: Hi, I've recently moved to the mac from windows (some experience on unix/linux too). I programmed a lot in C++ and a fair amount python. I much prefer coding in python these days. I've written a lot of user interface code (MFC/wxWindows/wxPython), and I'd like to get up to speed to writing some presentable applications on the mac using the native tools. I was wondering how best to make a start. A few questions (but any hints would be good) Do any of the experienced mac developers out there recommend doing everything in python? Or should I dabble with objective-c applications first? I've seen the pyobjc examples, but are the people out there writing complete applications just using python? Are there any open source examples? Is there "the book" for learning the basics of the mac system? Likewise, is there a book on objective-c for experienced programmers? Thanks in advance, Brett -- Brett Calcott Philosophy Program, Research School of Social Sciences, AND Centre for Macroevolution & Macroecology, School of Botany & Zoology, AUSTRALIAN NATIONAL UNIVERSITY, Canberra, ACT, 0200, AUSTRALIA From kw at codebykevin.com Wed Oct 3 16:37:36 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 03 Oct 2007 10:37:36 -0400 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: References: Message-ID: <4703A930.8080907@codebykevin.com> Brett Calcott wrote: > A few questions (but any hints would be good) > > Do any of the experienced mac developers out there recommend doing > everything in python? Or should I dabble with objective-c applications > first? You can do pretty much anything you want in Python--nearly all of the major toolkits (Cocoa/Objc, wxPython, Tk, PyQt) are natively supported on the Mac. I develop a commercial application in Python/Tk-Aqua. See http://wiki.python.org/moin/MacPython/MacSoftwareUsingPython for a partial list of Python apps on the Mac. > > I've seen the pyobjc examples, but are the people out there writing > complete applications just using python? Are there any open source > examples? RestEdit is open-source; Google for its current location. > > Is there "the book" for learning the basics of the mac system? > Likewise, is there a book on objective-c for experienced programmers? Aaron Hillegass's book on Cocoa programming is highly recommended. --Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com From ronaldoussoren at mac.com Wed Oct 3 17:04:29 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 03 Oct 2007 08:04:29 -0700 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: <4703A930.8080907@codebykevin.com> References: <4703A930.8080907@codebykevin.com> Message-ID: <3E033F5D-0115-1000-AA27-F8224417704B-Webmail-10022@mac.com> On Wednesday, October 03, 2007, at 04:38PM, "Kevin Walzer" wrote: > >> >> I've seen the pyobjc examples, but are the people out there writing >> complete applications just using python? Are there any open source >> examples? > >RestEdit is open-source; Google for its current location. Checkout (http://www.checkoutapp.com/) is a commercial application written in Python using PyObjC. > >> >> Is there "the book" for learning the basics of the mac system? >> Likewise, is there a book on objective-c for experienced programmers? > >Aaron Hillegass's book on Cocoa programming is highly recommended. +1 there. If you already know Python and C it should be easy to learn Objective-C, the hard part is learning about the Cocoa libraries and there a book like the Hillegass one can be very helpfull. Ronald From glassfordm at gmail.com Wed Oct 3 17:31:07 2007 From: glassfordm at gmail.com (Michael Glassford) Date: Wed, 03 Oct 2007 11:31:07 -0400 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: <3E033F5D-0115-1000-AA27-F8224417704B-Webmail-10022@mac.com> References: <4703A930.8080907@codebykevin.com> <3E033F5D-0115-1000-AA27-F8224417704B-Webmail-10022@mac.com> Message-ID: <4703B5BB.7060605@gmail.com> Ronald Oussoren wrote: > > On Wednesday, October 03, 2007, at 04:38PM, "Kevin Walzer" wrote: >>> I've seen the pyobjc examples, but are the people out there writing >>> complete applications just using python? Are there any open source >>> examples? >> RestEdit is open-source; Google for its current location. > > Checkout (http://www.checkoutapp.com/) is a commercial application written in Python using PyObjC. Likewise, Goombah (http://www.goombah.com) is a free commercial application written in Python using PyObjC for the Mac version. Mike From glassfordm at gmail.com Wed Oct 3 17:31:07 2007 From: glassfordm at gmail.com (Michael Glassford) Date: Wed, 03 Oct 2007 11:31:07 -0400 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: <3E033F5D-0115-1000-AA27-F8224417704B-Webmail-10022@mac.com> References: <4703A930.8080907@codebykevin.com> <3E033F5D-0115-1000-AA27-F8224417704B-Webmail-10022@mac.com> Message-ID: <4703B5BB.7060605@gmail.com> Ronald Oussoren wrote: > > On Wednesday, October 03, 2007, at 04:38PM, "Kevin Walzer" wrote: >>> I've seen the pyobjc examples, but are the people out there writing >>> complete applications just using python? Are there any open source >>> examples? >> RestEdit is open-source; Google for its current location. > > Checkout (http://www.checkoutapp.com/) is a commercial application written in Python using PyObjC. Likewise, Goombah (http://www.goombah.com) is a free commercial application written in Python using PyObjC for the Mac version. Mike From bwaters at nrao.edu Wed Oct 3 18:14:44 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Wed, 3 Oct 2007 10:14:44 -0600 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: References: Message-ID: <6CD4463C-A934-45D3-A7FB-74DA25F31E17@nrao.edu> On Oct 3, 2007, at 8:24 AM, Brett Calcott wrote: > Is there "the book" for learning the basics of the mac system? > Likewise, is there a book on objective-c for experienced programmers? I attended the Big Nerd Ranch Boot Camp this Spring, which is a perfect introduction to native programming on the Macintosh platform. I had never programmed Mac OSX via Objective-C before. I have yet to really use these skills for a full application, but now I know enough to find my way around the guts of a Mac application. I may go ahead and write apps in PyObjC now that I know about the GUI, NIB files, bindings, and the like. http://www.bignerdranch.com/ http://www.bignerdranch.com/classes/cocoa.shtml http://www.bignerdranch.com/classes/python.shtml I was able to re-package our open-source application suite as a Macintosh application bundle with a bunch of shell scripts and lots of install_name_tool re-mangling of the Python frameworks etc. I wish I knew more about py2app in order to make this easier, but I did it all "by hand" and by inspecting the layout of a "hello world" program created by py2app. Our application (CASA) is a rather complex scientific data analysis application, implemented mostly as a bunch of C++ wrapped by Python, with a GUI or two via Qt. While CASA is a lousy example of a "typical", GUI, Apple application, it's a nice lesson on deploying a (mostly) command-line shell tool on a Mac as an application, without alienating our "switcher" user base of scientists that are coming from a Linux environment. So it may be of interest to see how I wrapped the generic python application via an AppleScript launcher (which in turn calls a shell script and then launches a Terminal window, runs a C++ wrapper than *finally* calls a Python script to setup IPython). Yeah, that bootstrap process is way too convoluted, but it'll get better. The program is NOT released yet or intended for general use (no support provided), but you're welcome to take a look at it: https://wikio.nrao.edu/bin/view/Software/ObtainingCASA At the moment (3 October 2007) the PowerPC version is still a tarball that installs a UNIX-y collection of libraries and Python; it's not a Mac "application". The same thing is re-packaged as a "real" Mac application in the Intel version. By comparing the two you might learn something. I don't know. GPL'd. I attempted to write some of this up in a poster: http://www.aoc.nrao.edu/~bwaters/papers/WWDC-2007-CASA-poster.pdf Hope this helps... it's not the recommended "Mac way" to do things, but it's how we ported from Linux. - boyd Boyd Waters Scientific Programmer National Radio Astronomy Observatory http://www.aoc.nrao.edu/~bwaters From livingstonemark at gmail.com Thu Oct 4 01:09:28 2007 From: livingstonemark at gmail.com (Mark Livingstone) Date: Thu, 4 Oct 2007 09:09:28 +1000 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: References: Message-ID: Hi Brett, On 04/10/2007, Brett Calcott wrote: > Is there "the book" for learning the basics of the mac system? > Likewise, is there a book on objective-c for experienced programmers? I don't know if you are a podcast listener. There is a helpful Mac / Objective C available through iTunes called Cocoacast (www.cocoacast.com) which uses Aaron Hillegass' book to teach ObjectiveC. Best Regards, MarkL From vivacarlie at gmail.com Thu Oct 4 01:46:32 2007 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Wed, 3 Oct 2007 18:46:32 -0500 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: References: Message-ID: <65fadfc30710031646h371735c3i71d196fc248b5342@mail.gmail.com> On 10/3/07, Nehemiah Dacres wrote: > > Seriously, before you go learning Objective C, I suggest you continue > with python and learn the basics of py2app. complete apps in c++ are written > or ported in either the carbon environment or to make it reall OSX like, > objective C++. Both of these environments are documented on apple's site. If > you want a truly portable app, try KDE as a basis or gtk cocoa port, or find > out how xchat was ported to mac so cleanly (it even does transparency!) For > mac USERS, I would suggest "mac osx the missing manual", if you wan't to > learn cocoa then Aaron Hillegass's book is king, that and Step Into Xcode is > a good tutorial on the xcode programming environment (though slightly > dissorganized by my opinion after a short checkout of my library). Finally > for the Final book, try the 3 inch (i kid u not) Mac OSX system internals ( > osxbook.com). I wouldn't go into that unless you want to do Operating > system programming or to fully grok mac OS 10. > On 10/3/07, Mark Livingstone wrote: > > Hi Brett, > > On 04/10/2007, Brett Calcott wrote: > > > Is there "the book" for learning the basics of the mac system? > > Likewise, is there a book on objective-c for experienced programmers? > > I don't know if you are a podcast listener. There is a helpful Mac / > Objective C available through iTunes called Cocoacast > (www.cocoacast.com) which uses Aaron Hillegass' book to teach > ObjectiveC. > > Best Regards, > > MarkL > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- "lalalalala! it's not broken because I can use it" http://linux.slashdot.org/comments.pl?sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071003/65c41a04/attachment.htm From brett.calcott at gmail.com Thu Oct 4 04:50:51 2007 From: brett.calcott at gmail.com (Brett Calcott) Date: Thu, 4 Oct 2007 12:50:51 +1000 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: References: Message-ID: Thanks to everyone for their replies; very useful stuff. I must say that getting a large number of replies so quickly is also incredibly encouraging. It is good to know that there are people out there who love python and work on the mac! Thanks again, Brett From vip at avatar.com.au Thu Oct 4 05:48:39 2007 From: vip at avatar.com.au (David Worrall) Date: Thu, 4 Oct 2007 13:48:39 +1000 Subject: [Pythonmac-SIG] entire applications in python? In-Reply-To: References: Message-ID: <9CCAF79B-BE58-401A-86D5-EE4118C93168@avatar.com.au> Hi Brett, Yep, There's plenty of us! Many I know migrated from FORTH at one end and APL at the other ... the important continuity being an interpretive environ. which is more conducing to figuring out what one is actually trying to do. Having done that, we can crunch CPU cycles using C/Fortran etc libraries if needs be. Whilst not specifically a mac thing, the python community is well entrenched nearly everywhere and there are some fantastic tools which can be integrated. Its not a single piece of software, nor even finished project, but you might like to look at my sonipy.sourceforge.net for some toolset ideas. It is being developed in the first instance on OSX. good luck! David On 04/10/2007, at 12:50 PM, Brett Calcott wrote: > Thanks to everyone for their replies; very useful stuff. > > I must say that getting a large number of replies so quickly is also > incredibly encouraging. It is good to know that there are people out > there who love python and work on the mac! > > Thanks again, > Brett > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > _________________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg From mhjorleifsson at mac.com Thu Oct 4 16:01:33 2007 From: mhjorleifsson at mac.com (Michele Hjorleifsson) Date: Thu, 4 Oct 2007 10:01:33 -0400 Subject: [Pythonmac-SIG] Generic Question In-Reply-To: References: Message-ID: <7EB57A12-AC37-4C83-BA6C-28F32CB0952F@mac.com> Anyone aware of a bootcamp for python and or python on mac ? If there isn't one, would anyone be interested in attending one ? Regards, Mike From hraban at fiee.net Thu Oct 4 17:18:31 2007 From: hraban at fiee.net (Henning Hraban Ramm) Date: Thu, 4 Oct 2007 17:18:31 +0200 Subject: [Pythonmac-SIG] Generic Question In-Reply-To: <7EB57A12-AC37-4C83-BA6C-28F32CB0952F@mac.com> References: <7EB57A12-AC37-4C83-BA6C-28F32CB0952F@mac.com> Message-ID: Am 2007-10-04 um 16:01 schrieb Michele Hjorleifsson: > Anyone aware of a bootcamp for python and or python on mac ? > > If there isn't one, would anyone be interested in attending one ? Boyd Waters just yesterday posted something about Big Nerd Ranch Boot Camp. Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) From bejarar at sbcglobal.net Thu Oct 4 18:55:45 2007 From: bejarar at sbcglobal.net (Rafael Bejarano) Date: Thu, 4 Oct 2007 11:55:45 -0500 Subject: [Pythonmac-SIG] easygui Message-ID: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> Hello, I just subscribed to this list, so please allow me to introduce myself. Although I am a long-time Mac user, I just recently started learning python. My primary interest in python is as a way to create simple programs with which to run psychological experiments (I am an experimental psychologist). This means that I need to be able to create simple GUIs to collect behavioral measures from research participants, such as response times (how long it takes them to respond to a stimulus after appears on the screen). Given this, I was delighted to discover easygui, a module for creating simple GUIs. When I tried to run it following the instructions that I downloaded from the python website, however, I couldn't get it to work on my iBook g4. I did not get an error message, but no buttons or dialog boxes appeared, either. Can anyone on this list tell me if easygui works on the Mac, and if so, what steps I need to take to make it work? Your assistance with this problem would be grately appreciated. Cordially, Rafael Bejarano From adam.naples at yale.edu Thu Oct 4 19:46:56 2007 From: adam.naples at yale.edu (adam naples) Date: Thu, 4 Oct 2007 10:46:56 -0700 Subject: [Pythonmac-SIG] easygui In-Reply-To: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> Message-ID: <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> I would suggest visionegg www.visionegg.org perfect for experimental psychology experiments, at least mine, and installs nicely on the mac with some gui demos. All python, and cross platform. there is also psychopy, which looks similar to visionegg, but I've not had the need to try it. hope this helps -a On Oct 4, 2007, at 9:55 AM, Rafael Bejarano wrote: > Hello, > > I just subscribed to this list, so please allow me to introduce > myself. Although I am a long-time Mac user, I just recently started > learning python. My primary interest in python is as a way to create > simple programs with which to run psychological experiments (I am an > experimental psychologist). This means that I need to be able to > create simple GUIs to collect behavioral measures from research > participants, such as response times (how long it takes them to > respond to a stimulus after appears on the screen). > > Given this, I was delighted to discover easygui, a module for > creating simple GUIs. When I tried to run it following the > instructions that I downloaded from the python website, however, I > couldn't get it to work on my iBook g4. I did not get an error > message, but no buttons or dialog boxes appeared, either. Can anyone > on this list tell me if easygui works on the Mac, and if so, what > steps I need to take to make it work? > > Your assistance with this problem would be grately appreciated. > > Cordially, > Rafael Bejarano > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig The information contained in this message may be privileged and confidential. If you are NOT the intended recipient, please notify the sender immediately with a copy to hipaa.security at yale.edu and destroy this message. Please be aware that email communication can be intercepted in transmission or misdirected. Your use of email to communicate protected health information to us indicates that you acknowledge and accept the possible risks associated with such communication. Please consider communicating any sensitive information by telephone, fax or mail. If you do not wish to have your information sent by email, please contact the sender immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071004/36d11c9c/attachment.htm From delza at livingcode.org Thu Oct 4 19:54:21 2007 From: delza at livingcode.org (Dethe Elza) Date: Thu, 4 Oct 2007 10:54:21 -0700 Subject: [Pythonmac-SIG] easygui In-Reply-To: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> Message-ID: <24d517dd0710041054x5a07f38aob662b6e23bcc5a5@mail.gmail.com> Hi Rafael, I'm not familiar with EasyGUI, but it uses Tkinter, which I try to avoid on the Mac. If you need an easy way to create GUIs and you're OK with it being Mac-specific, then I'd recommend using Interface Builder (comes with the free OS X developer tools) to create your GUI and PyObjC to write the application in Python. If you need cross-platform GUIs, that won't work, but for the Mac it is the best choice. If you have problems with any of that, I can give more pointers, but for starters: http://developers.apple.com/ for developer tools and Interface Builder docs (requires free account to download latest developer tools) http://pyobjc.sf.net/ for PyObjC, the Python/Objective-C bridge (gives you access to all of Apple's Cocoa libraries from Python) HTH --Dethe From kent37 at tds.net Thu Oct 4 20:07:34 2007 From: kent37 at tds.net (Kent Johnson) Date: Thu, 04 Oct 2007 14:07:34 -0400 Subject: [Pythonmac-SIG] easygui In-Reply-To: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> Message-ID: <47052BE6.7010005@tds.net> Rafael Bejarano wrote: > Can anyone > on this list tell me if easygui works on the Mac, and if so, what > steps I need to take to make it work? It works fine for me using Python 2.5.1 on MacBook Pro. I don't think I did anything special to install it. Kent From kw at codebykevin.com Thu Oct 4 20:51:31 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Thu, 04 Oct 2007 14:51:31 -0400 Subject: [Pythonmac-SIG] easygui In-Reply-To: <24d517dd0710041054x5a07f38aob662b6e23bcc5a5@mail.gmail.com> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <24d517dd0710041054x5a07f38aob662b6e23bcc5a5@mail.gmail.com> Message-ID: <47053633.4030902@codebykevin.com> Dethe Elza wrote: > I'm not familiar with EasyGUI, but it uses Tkinter, which I try to > avoid on the Mac. If you need an easy way to create GUIs and you're > OK with it being Mac-specific, then I'd recommend using Interface > Builder (comes with the free OS X developer tools) to create your GUI > and PyObjC to write the application in Python. If you need > cross-platform GUIs, that won't work, but for the Mac it is the best > choice. I @Dethe: EasyGUI is very limited in what it does--it basically provides some canned dialogs, nothing more. It's similar to EasyDialogs from the older MacPython days. My guess is PyObjC would be overkill or too complicated for his needs (otherwise he'd be writing his GUI in Tkinter). @Rafael: Running EasyGUI itself is as simple as double-clicking "easygui.py" in Finder. It brings up a demo with illustrations of the various dialogs/widgets that EasyGUI can implement. Without a bit more information about what you are doing, I can't help diagnose the problem. -- Kevin Walzer Code by Kevin http://www.codebykevin.com From bejarar at sbcglobal.net Thu Oct 4 20:51:35 2007 From: bejarar at sbcglobal.net (Rafael Bejarano) Date: Thu, 4 Oct 2007 13:51:35 -0500 Subject: [Pythonmac-SIG] easygui In-Reply-To: <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> Message-ID: Thanks. I'll definitely give it a try. Rafael On Oct 4, 2007, at 12:46 PM, adam naples wrote: > I would suggest > visionegg > www.visionegg.org > perfect for experimental psychology experiments, at least mine, and > installs nicely on the mac with some gui demos. > All python, and cross platform. > there is also psychopy, which looks similar to visionegg, but I've > not had the need to try it. > hope this helps > -a > On Oct 4, 2007, at 9:55 AM, Rafael Bejarano wrote: > >> Hello, >> >> I just subscribed to this list, so please allow me to introduce >> myself. Although I am a long-time Mac user, I just recently started >> learning python. My primary interest in python is as a way to create >> simple programs with which to run psychological experiments (I am an >> experimental psychologist). This means that I need to be able to >> create simple GUIs to collect behavioral measures from research >> participants, such as response times (how long it takes them to >> respond to a stimulus after appears on the screen). >> >> Given this, I was delighted to discover easygui, a module for >> creating simple GUIs. When I tried to run it following the >> instructions that I downloaded from the python website, however, I >> couldn't get it to work on my iBook g4. I did not get an error >> message, but no buttons or dialog boxes appeared, either. Can anyone >> on this list tell me if easygui works on the Mac, and if so, what >> steps I need to take to make it work? >> >> Your assistance with this problem would be grately appreciated. >> >> Cordially, >> Rafael Bejarano >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > The information contained in this message may be privileged and > confidential. If you are NOT the intended recipient, please notify > the sender immediately with a copy to hipaa.security at yale.edu and > destroy this message. > > Please be aware that email communication can be intercepted in > transmission or misdirected. Your use of email to communicate > protected health information to us indicates that you acknowledge > and accept the possible risks associated with such communication. > Please consider communicating any sensitive information by > telephone, fax or mail. If you do not wish to have your information > sent by email, please contact the sender immediately. > > > From bejarar at sbcglobal.net Thu Oct 4 20:55:40 2007 From: bejarar at sbcglobal.net (Rafael Bejarano) Date: Thu, 4 Oct 2007 13:55:40 -0500 Subject: [Pythonmac-SIG] easygui In-Reply-To: <24d517dd0710041054x5a07f38aob662b6e23bcc5a5@mail.gmail.com> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <24d517dd0710041054x5a07f38aob662b6e23bcc5a5@mail.gmail.com> Message-ID: Thanks for the info. I'll let you know if I need more assistance with this option. Rafael On Oct 4, 2007, at 12:54 PM, Dethe Elza wrote: > Hi Rafael, > > I'm not familiar with EasyGUI, but it uses Tkinter, which I try to > avoid on the Mac. If you need an easy way to create GUIs and you're > OK with it being Mac-specific, then I'd recommend using Interface > Builder (comes with the free OS X developer tools) to create your GUI > and PyObjC to write the application in Python. If you need > cross-platform GUIs, that won't work, but for the Mac it is the best > choice. If you have problems with any of that, I can give more > pointers, but for starters: > > http://developers.apple.com/ for developer tools and Interface > Builder docs (requires free account to download latest developer > tools) > > http://pyobjc.sf.net/ for PyObjC, the Python/Objective-C bridge > (gives you access to all of Apple's Cocoa libraries from Python) > > HTH > > --Dethe From bejarar at sbcglobal.net Thu Oct 4 21:12:56 2007 From: bejarar at sbcglobal.net (Rafael Bejarano) Date: Thu, 4 Oct 2007 14:12:56 -0500 Subject: [Pythonmac-SIG] easygui In-Reply-To: <47053633.4030902@codebykevin.com> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <24d517dd0710041054x5a07f38aob662b6e23bcc5a5@mail.gmail.com> <47053633.4030902@codebykevin.com> Message-ID: <6D88D557-6A10-4036-8297-AD7D54FFE800@sbcglobal.net> I just had a quick look at the description of VisionEgg, and it appears to be far better suited to my needs than easygui is. So, Before asking for additional help with easygui, I will first explore VisionEgg in greater depth. Thanks to everyone for responding so promptly to my request for help. Rafael On Oct 4, 2007, at 1:51 PM, Kevin Walzer wrote: > Dethe Elza wrote: > >> I'm not familiar with EasyGUI, but it uses Tkinter, which I try to >> avoid on the Mac. If you need an easy way to create GUIs and you're >> OK with it being Mac-specific, then I'd recommend using Interface >> Builder (comes with the free OS X developer tools) to create your GUI >> and PyObjC to write the application in Python. If you need >> cross-platform GUIs, that won't work, but for the Mac it is the best >> choice. I > > @Dethe: > EasyGUI is very limited in what it does--it basically provides some > canned dialogs, nothing more. It's similar to EasyDialogs from the > older MacPython days. My guess is PyObjC would be overkill or too > complicated for his needs (otherwise he'd be writing his GUI in > Tkinter). > > @Rafael: > Running EasyGUI itself is as simple as double-clicking "easygui.py" > in Finder. It brings up a demo with illustrations of the various > dialogs/widgets that EasyGUI can implement. Without a bit more > information about what you are doing, I can't help diagnose the > problem. > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com From an003141 at gmail.com Wed Oct 3 23:59:34 2007 From: an003141 at gmail.com (Nick Anderson) Date: Wed, 3 Oct 2007 17:59:34 -0400 Subject: [Pythonmac-SIG] was : py2app: how to include the entire standard library of modules? Message-ID: You wrote: >hi Nick > >did you finally manage to include the entire standard library into an >executable app? I am pretty interested to know about this, I had an idea >where I needed to achieve this and I want to try again. > >thanks! > >enrike I did find a solution, but it involves using another script to edit the setup.py script created by py2applet. (If anyone knows of an easier way to do this, let me know.) Make the following changes to setup.py: includes = [] OPTIONS = {'argv_emulation': True, 'plist':plist, 'includes':includes, Next you will run the following script in the same folder as your setup.py. Put the names of the packages you don't want included in the skip list. #Collects all standard modules with paths and inserts them into the config file #for py2app. import os import os.path import sys path = '/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5' modules = [] skip = ['site-packages', 'lib-tk', 'test', 'idlelib'] for root, dirs, files in os.walk(path): for item in skip: if item in dirs: dirs.remove(item) for f in files: d = root.replace(path, '') full_path = os.path.join(d, f) if '\\' in full_path: full_path = full_path.replace('\\', '.') if '/' in full_path: full_path = full_path.replace('/', '.') if full_path[0] == '.': full_path = full_path[1:] if full_path.startswith('plat-mac.'): full_path = full_path[9:] if full_path.startswith('lib-scriptpackages.'): full_path = full_path[18:] if full_path.startswith('plat-darwin.'): full_path = full_path[11:] if full_path.startswith('.'): continue #Ignore .pyc and .pyo files if f.endswith('.py') \ and not f.startswith('_'): full_path = full_path[:-3] #Save each part of the file path as part of the module name: #foo.foo1.foo2.py has a package foo, a sub-package foo1, #and a module foo2. Save foo, foo.foo1, and foo.foo1.foo2.py. section_total = full_path.count('.') start = 0 for x in range(section_total): stop = full_path.find('.', start) if stop != -1: package = full_path[:stop] if package and package not in modules: modules.append(package) start = stop + 1 if full_path and full_path not in modules: modules.append(full_path) modules.remove('anydbm') #This module fails for some reason. print 'The number of modules is', len(modules) mac_file = open('setup.py', 'r') lines = mac_file.readlines() mac_file.close() for x in range(len(lines)): if lines[x].startswith('includes ='): lines[x] = 'includes = ' + str(modules) break mac_file = open('setup.py', 'w') mac_file.writelines(lines) mac_file.close() From noah.gift at gmail.com Thu Oct 4 21:07:36 2007 From: noah.gift at gmail.com (Noah Gift) Date: Thu, 4 Oct 2007 15:07:36 -0400 Subject: [Pythonmac-SIG] Pythonmac-SIG Digest, Vol 54, Issue 7 In-Reply-To: References: Message-ID: Rafael, You might also want to consider using Applescript Studio and then making "do shell script" calls to python. This is quite effective for simple dialog boxes. I have made a few of these applications and they have a huge bang for the buck. Noah From vip at avatar.com.au Fri Oct 5 03:57:25 2007 From: vip at avatar.com.au (David Worrall) Date: Fri, 5 Oct 2007 11:57:25 +1000 Subject: [Pythonmac-SIG] easygui In-Reply-To: References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> Message-ID: <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> Hi Rafael, Not a comprhensive list by any means, but here are a couple of my links: http://www.psychopy.org/ you may find this useful: http://psy.ck.sissa.it/OtherStuff/OtherStuff.html also pythoncard has lots of examples which might get you into a ballpark: http://pythoncard.sourceforge.net/ the wxpython community may have some other references. You'll notice that the visonary egg producers have chickened out of audio. :-) I've yet to find a satisfactory Mac/psych testing package that deals with audio well. (such that you can play audio and have people answer questions about it. Does anyone have any suggestions in this regard? On 05/10/2007, at 4:51 AM, Rafael Bejarano wrote: > Thanks. I'll definitely give it a try. > > Rafael > On Oct 4, 2007, at 12:46 PM, adam naples wrote: > >> I would suggest >> visionegg >> www.visionegg.org >> perfect for experimental psychology experiments, at least mine, and >> installs nicely on the mac with some gui demos. >> All python, and cross platform. >> there is also psychopy, which looks similar to visionegg, but I've >> not had the need to try it. >> hope this helps >> -a ... _________________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg From bejarar at sbcglobal.net Fri Oct 5 04:29:33 2007 From: bejarar at sbcglobal.net (Rafael Bejarano) Date: Thu, 4 Oct 2007 21:29:33 -0500 Subject: [Pythonmac-SIG] easygui In-Reply-To: <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> Message-ID: Much obliged! Rafael On Oct 4, 2007, at 8:57 PM, David Worrall wrote: > Hi Rafael, > > Not a comprhensive list by any means, but here are a couple of my > links: > > http://www.psychopy.org/ > > you may find this useful: > http://psy.ck.sissa.it/OtherStuff/OtherStuff.html > > also pythoncard has lots of examples which might get you into a > ballpark: > http://pythoncard.sourceforge.net/ > > the wxpython community may have some other references. > > You'll notice that the visonary egg producers have chickened out of > audio. :-) > > I've yet to find a satisfactory Mac/psych testing package that deals > with audio well. > (such that you can play audio and have people answer questions > about it. > > Does anyone have any suggestions in this regard? > > > On 05/10/2007, at 4:51 AM, Rafael Bejarano wrote: > >> Thanks. I'll definitely give it a try. >> >> Rafael >> On Oct 4, 2007, at 12:46 PM, adam naples wrote: >> >>> I would suggest >>> visionegg >>> www.visionegg.org >>> perfect for experimental psychology experiments, at least mine, and >>> installs nicely on the mac with some gui demos. >>> All python, and cross platform. >>> there is also psychopy, which looks similar to visionegg, but I've >>> not had the need to try it. >>> hope this helps >>> -a > ... > _________________________________________________ > experimental polymedia: www.avatar.com.au > Sonic Communications Research Group, > University of Canberra: creative.canberra.edu.au/scrg > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From jdc at uwo.ca Fri Oct 5 04:58:33 2007 From: jdc at uwo.ca (Dan Christensen) Date: Thu, 04 Oct 2007 22:58:33 -0400 Subject: [Pythonmac-SIG] python program in menu bar References: <24d517dd0709262116r6be377a6q3d8ba2b139d04f2b@mail.gmail.com> <24d517dd0709292216w7225e9c8p285efa8e4aef054d@mail.gmail.com> <24d517dd0710012115t5d602bbr101d84969f80542d@mail.gmail.com> Message-ID: scott herzinger writes: > I assume, but don't know for certain, that MacBook keyboards are USB > HID devices. In that case, this document: > > http://www.usb.org/developers/devclass_docs/Hut1_11.pdf > > discusses extended HID usages, including those which can be used in > toggling on/off controls, of which LEDs are one instance. > > From there, I'd go to the IOKit framework and see what APIs exist for > playing with OOCs. IOHIDUsageTables.h contains useful constants. Thanks for those pointers. Unfortunately, I did a fair bit of googling but couldn't find anything about how to play with OOCs. The pdf you linked to, and the .h file you mention, say to use "single button toggle" mode, but I couldn't find anything about that, either. Any other suggestions? Is there a more appropriate mailing list I should try? Thanks, Dan From lanceboyle at qwest.net Fri Oct 5 12:59:17 2007 From: lanceboyle at qwest.net (Jerry) Date: Fri, 5 Oct 2007 03:59:17 -0700 Subject: [Pythonmac-SIG] easygui In-Reply-To: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> Message-ID: Don't overlook Pashua and CocoaDialog. I've used Pashua and it is incredibly easy to use. You write a simple text file and Pashua reads it and sets up the dialogs etc. that you specify. Pashua itself is a native Cocoa application. The download includes a Python example. (Pashua works with any language that can read text files.) The kinds of things that you can do is somewhat limited but it sounds like it might be enough for your application. I can't stress how easy Pashua is to use. CocoaDialog is similar but I haven't used it myself. Jerry On Oct 4, 2007, at 9:55 AM, Rafael Bejarano wrote: > Hello, > > I just subscribed to this list, so please allow me to introduce > myself. Although I am a long-time Mac user, I just recently started > learning python. My primary interest in python is as a way to create > simple programs with which to run psychological experiments (I am an > experimental psychologist). This means that I need to be able to > create simple GUIs to collect behavioral measures from research > participants, such as response times (how long it takes them to > respond to a stimulus after appears on the screen). > > Given this, I was delighted to discover easygui, a module for > creating simple GUIs. When I tried to run it following the > instructions that I downloaded from the python website, however, I > couldn't get it to work on my iBook g4. I did not get an error > message, but no buttons or dialog boxes appeared, either. Can anyone > on this list tell me if easygui works on the Mac, and if so, what > steps I need to take to make it work? > > Your assistance with this problem would be grately appreciated. > > Cordially, > Rafael Bejarano > From scotthz at yahoo.com Fri Oct 5 13:14:55 2007 From: scotthz at yahoo.com (scott herzinger) Date: Fri, 5 Oct 2007 07:14:55 -0400 Subject: [Pythonmac-SIG] python program in menu bar In-Reply-To: References: <24d517dd0709262116r6be377a6q3d8ba2b139d04f2b@mail.gmail.com> <24d517dd0709292216w7225e9c8p285efa8e4aef054d@mail.gmail.com> <24d517dd0710012115t5d602bbr101d84969f80542d@mail.gmail.com> Message-ID: <5AD1E4AC-15C3-4017-8964-0505E9C602A1@yahoo.com> This document http://developer.apple.com/documentation/DeviceDrivers/Conceptual/HID/intro/chapter_1_section_1.html#/ /apple_ref/doc/uid/TP40000970-CH202-DontLinkElementID_10 is a guide to working with HID devices. It provides some sample code for accessing and controlling HID devices. An OOC is an "on/off control". The following might also be a useful guide: http://developer.apple.com/documentation/DeviceDrivers/Conceptual/AccessingHardware/index.html#/ /apple_ref/doc/uid/TP30000376 Scott On Oct 4, 2007, at 10:58 PM, Dan Christensen wrote: > scott herzinger writes: > >> I assume, but don't know for certain, that MacBook keyboards are USB >> HID devices. In that case, this document: >> >> http://www.usb.org/developers/devclass_docs/Hut1_11.pdf >> >> discusses extended HID usages, including those which can be used in >> toggling on/off controls, of which LEDs are one instance. >> >> From there, I'd go to the IOKit framework and see what APIs exist for >> playing with OOCs. IOHIDUsageTables.h contains useful constants. > > Thanks for those pointers. Unfortunately, I did a fair bit of > googling > but couldn't find anything about how to play with OOCs. The pdf you > linked to, and the .h file you mention, say to use "single button > toggle" mode, but I couldn't find anything about that, either. > > Any other suggestions? Is there a more appropriate mailing list I > should try? > > Thanks, > > Dan > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From bejarar at sbcglobal.net Fri Oct 5 20:15:18 2007 From: bejarar at sbcglobal.net (Rafael Bejarano) Date: Fri, 5 Oct 2007 13:15:18 -0500 Subject: [Pythonmac-SIG] easygui In-Reply-To: References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> Message-ID: <1D69829E-3819-42FF-8923-F9C19CC61C56@sbcglobal.net> Thanks for suggesting these programs. Do you know the link from which I can download them? Cordially, Rafael Bejarano On Oct 5, 2007, at 5:59 AM, Jerry wrote: > Don't overlook Pashua and CocoaDialog. I've used Pashua and it is > incredibly easy to use. You write a simple text file and Pashua > reads it and sets up the dialogs etc. that you specify. Pashua > itself is a native Cocoa application. The download includes a > Python example. (Pashua works with any language that can read text > files.) The kinds of things that you can do is somewhat limited but > it sounds like it might be enough for your application. > > I can't stress how easy Pashua is to use. > > CocoaDialog is similar but I haven't used it myself. > > Jerry > > > On Oct 4, 2007, at 9:55 AM, Rafael Bejarano wrote: > >> Hello, >> >> I just subscribed to this list, so please allow me to introduce >> myself. Although I am a long-time Mac user, I just recently started >> learning python. My primary interest in python is as a way to create >> simple programs with which to run psychological experiments (I am an >> experimental psychologist). This means that I need to be able to >> create simple GUIs to collect behavioral measures from research >> participants, such as response times (how long it takes them to >> respond to a stimulus after appears on the screen). >> >> Given this, I was delighted to discover easygui, a module for >> creating simple GUIs. When I tried to run it following the >> instructions that I downloaded from the python website, however, I >> couldn't get it to work on my iBook g4. I did not get an error >> message, but no buttons or dialog boxes appeared, either. Can anyone >> on this list tell me if easygui works on the Mac, and if so, what >> steps I need to take to make it work? >> >> Your assistance with this problem would be grately appreciated. >> >> Cordially, >> Rafael Bejarano >> From adam.naples at yale.edu Fri Oct 5 20:45:35 2007 From: adam.naples at yale.edu (adam naples) Date: Fri, 5 Oct 2007 11:45:35 -0700 Subject: [Pythonmac-SIG] easygui In-Reply-To: <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> Message-ID: I've had some occasions to fight with getting audio working like I want in visionegg and had no problems beyond the normal 'nothing- working-like-you-expect-the-first-time'. I've been using it for presenting stimuli for eye-tracking and sentence comprehension, and I just make sure all my stimuli are aiff or wav. Really it's been much less bug prone than my experiences with director, e-prime and psyscope. If you need to present video it's a little more of a hassle, but not so much. What problems were you having with visionegg and audio? I'm happy to help if i can. -a On Oct 4, 2007, at 6:57 PM, David Worrall wrote: > Hi Rafael, > > Not a comprhensive list by any means, but here are a couple of my > links: > > http://www.psychopy.org/ > > you may find this useful: > http://psy.ck.sissa.it/OtherStuff/OtherStuff.html > > also pythoncard has lots of examples which might get you into a > ballpark: > http://pythoncard.sourceforge.net/ > > the wxpython community may have some other references. > > You'll notice that the visonary egg producers have chickened out of > audio. :-) > > I've yet to find a satisfactory Mac/psych testing package that deals > with audio well. > (such that you can play audio and have people answer questions > about it. > > Does anyone have any suggestions in this regard? > > > On 05/10/2007, at 4:51 AM, Rafael Bejarano wrote: > >> Thanks. I'll definitely give it a try. >> >> Rafael >> On Oct 4, 2007, at 12:46 PM, adam naples wrote: >> >>> I would suggest >>> visionegg >>> www.visionegg.org >>> perfect for experimental psychology experiments, at least mine, and >>> installs nicely on the mac with some gui demos. >>> All python, and cross platform. >>> there is also psychopy, which looks similar to visionegg, but I've >>> not had the need to try it. >>> hope this helps >>> -a > ... > _________________________________________________ > experimental polymedia: www.avatar.com.au > Sonic Communications Research Group, > University of Canberra: creative.canberra.edu.au/scrg > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig The information contained in this message may be privileged and confidential. If you are NOT the intended recipient, please notify the sender immediately with a copy to hipaa.security at yale.edu and destroy this message. Please be aware that email communication can be intercepted in transmission or misdirected. Your use of email to communicate protected health information to us indicates that you acknowledge and accept the possible risks associated with such communication. Please consider communicating any sensitive information by telephone, fax or mail. If you do not wish to have your information sent by email, please contact the sender immediately. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071005/4bfeadd9/attachment.htm From jdc at uwo.ca Fri Oct 5 21:53:03 2007 From: jdc at uwo.ca (Dan Christensen) Date: Fri, 05 Oct 2007 15:53:03 -0400 Subject: [Pythonmac-SIG] python program in menu bar References: <24d517dd0709262116r6be377a6q3d8ba2b139d04f2b@mail.gmail.com> <24d517dd0709292216w7225e9c8p285efa8e4aef054d@mail.gmail.com> <24d517dd0710012115t5d602bbr101d84969f80542d@mail.gmail.com> <5AD1E4AC-15C3-4017-8964-0505E9C602A1@yahoo.com> Message-ID: scott herzinger writes: > This document > > http://developer.apple.com/documentation/DeviceDrivers/Conceptual/HID/intro/chapter_1_section_1.html#/ > /apple_ref/doc/uid/TP40000970-CH202-DontLinkElementID_10 > > is a guide to working with HID devices. It provides some sample code > for accessing and controlling HID devices. An OOC is an "on/off > control". > > The following might also be a useful guide: > > http://developer.apple.com/documentation/DeviceDrivers/Conceptual/AccessingHardware/index.html#/ > /apple_ref/doc/uid/TP30000376 Thanks again for those pointers! I looked through them but didn't find anything about OOCs. And a search of the apple developer connection website for "on/off control" only turns up hits about power buttons. I did find two links that might be relevant. This first says there is an "ADB/USB shim [that] allows applications to set the caps lock LED on the Apple USB keyboard", but I'm not sure if this will be helpful: http://developer.apple.com/documentation/Hardware/Developer_Notes/Macintosh_CPUs-G4/PowerMac_G4_16Feb00/G4Rev3-43.html The second mentions kHIDUsage_KeyboardLockingCapsLock: http://developer.apple.com/samplecode/GLCarbonAGLFullScreen/listing12.html Unfortunately, given that I've never programmed in Objective C before, this is probably getting beyond what I have time to figure out myself. I may try asking on another list to see if someone can point to explicit code that already does what I want. I appreciate everything that people on this list have done! Dan From Chris.Barker at noaa.gov Fri Oct 5 23:04:19 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Fri, 05 Oct 2007 14:04:19 -0700 Subject: [Pythonmac-SIG] easygui In-Reply-To: <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> Message-ID: <4706A6D3.9070503@noaa.gov> David Worrall wrote: > the wxpython community may have some other references. Check out Dabo -- it's pretty slick, and not just for database apps (though it's great for those) (wxPython based) http://www.dabodev.com/ -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 lanceboyle at qwest.net Sat Oct 6 01:29:41 2007 From: lanceboyle at qwest.net (Jerry) Date: Fri, 5 Oct 2007 16:29:41 -0700 Subject: [Pythonmac-SIG] easygui In-Reply-To: <1D69829E-3819-42FF-8923-F9C19CC61C56@sbcglobal.net> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <1D69829E-3819-42FF-8923-F9C19CC61C56@sbcglobal.net> Message-ID: <67200089-1401-41B8-AC4A-D31D8C41C999@qwest.net> They are each the top links on Google using the programs' names. Jerry P.S. They are both free. On Oct 5, 2007, at 11:15 AM, Rafael Bejarano wrote: > Thanks for suggesting these programs. Do you know the link from > which I can download them? > > Cordially, > Rafael Bejarano > On Oct 5, 2007, at 5:59 AM, Jerry wrote: > >> Don't overlook Pashua and CocoaDialog. I've used Pashua and it is >> incredibly easy to use. You write a simple text file and Pashua >> reads it and sets up the dialogs etc. that you specify. Pashua >> itself is a native Cocoa application. The download includes a >> Python example. (Pashua works with any language that can read text >> files.) The kinds of things that you can do is somewhat limited >> but it sounds like it might be enough for your application. >> >> I can't stress how easy Pashua is to use. >> >> CocoaDialog is similar but I haven't used it myself. >> >> Jerry >> >> >> On Oct 4, 2007, at 9:55 AM, Rafael Bejarano wrote: >> >>> Hello, >>> >>> I just subscribed to this list, so please allow me to introduce >>> myself. Although I am a long-time Mac user, I just recently started >>> learning python. My primary interest in python is as a way to create >>> simple programs with which to run psychological experiments (I am an >>> experimental psychologist). This means that I need to be able to >>> create simple GUIs to collect behavioral measures from research >>> participants, such as response times (how long it takes them to >>> respond to a stimulus after appears on the screen). >>> >>> Given this, I was delighted to discover easygui, a module for >>> creating simple GUIs. When I tried to run it following the >>> instructions that I downloaded from the python website, however, I >>> couldn't get it to work on my iBook g4. I did not get an error >>> message, but no buttons or dialog boxes appeared, either. Can anyone >>> on this list tell me if easygui works on the Mac, and if so, what >>> steps I need to take to make it work? >>> >>> Your assistance with this problem would be grately appreciated. >>> >>> Cordially, >>> Rafael Bejarano >>> > > From robin.meier at free.fr Sat Oct 6 15:42:01 2007 From: robin.meier at free.fr (robin meier) Date: Sat, 6 Oct 2007 15:42:01 +0200 Subject: [Pythonmac-SIG] easygui In-Reply-To: References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> Message-ID: <45786AB3-C11C-4B58-B667-97F0548D5249@free.fr> hello, for simple gui's using different media (audio, video, openGL etc ) you might consider pure data (open source) http://en.wikipedia.org/ wiki/Pure_Data or max msp jitter (expensive... cycling74.com) both environments have objects which enable you to integrate your python code. maybe this helps... best, robin On 5 Oct 2007, at 20:45, adam naples wrote: > I've had some occasions to fight with getting audio working like I > want in visionegg and had no problems beyond the normal 'nothing- > working-like-you-expect-the-first-time'. > > I've been using it for presenting stimuli for eye-tracking and > sentence comprehension, and I just make sure all my stimuli are > aiff or wav. Really it's been much less bug prone than my > experiences with director, e-prime and psyscope. If you need to > present video it's a little more of a hassle, but not so much. > > What problems were you having with visionegg and audio? I'm happy > to help if i can. > -a > > On Oct 4, 2007, at 6:57 PM, David Worrall wrote: > >> Hi Rafael, >> >> Not a comprhensive list by any means, but here are a couple of my >> links: >> >> http://www.psychopy.org/ >> >> you may find this useful: >> http://psy.ck.sissa.it/OtherStuff/OtherStuff.html >> >> also pythoncard has lots of examples which might get you into a >> ballpark: >> http://pythoncard.sourceforge.net/ >> >> the wxpython community may have some other references. >> >> You'll notice that the visonary egg producers have chickened out of >> audio. :-) >> >> I've yet to find a satisfactory Mac/psych testing package that deals >> with audio well. >> (such that you can play audio and have people answer questions >> about it. >> >> Does anyone have any suggestions in this regard? >> >> >> On 05/10/2007, at 4:51 AM, Rafael Bejarano wrote: >> >>> Thanks. I'll definitely give it a try. >>> >>> Rafael >>> On Oct 4, 2007, at 12:46 PM, adam naples wrote: >>> >>>> I would suggest >>>> visionegg >>>> www.visionegg.org >>>> perfect for experimental psychology experiments, at least mine, and >>>> installs nicely on the mac with some gui demos. >>>> All python, and cross platform. >>>> there is also psychopy, which looks similar to visionegg, but I've >>>> not had the need to try it. >>>> hope this helps >>>> -a >> ... >> _________________________________________________ >> experimental polymedia: www.avatar.com.au >> Sonic Communications Research Group, >> University of Canberra: creative.canberra.edu.au/scrg >> >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > > The information contained in this message may be privileged and > confidential. If you are NOT the intended recipient, please notify > the sender immediately with a copy to hipaa.security at yale.edu and > destroy this message. > > Please be aware that email communication can be intercepted in > transmission or misdirected. Your use of email to communicate > protected health information to us indicates that you acknowledge > and accept the possible risks associated with such communication. > Please consider communicating any sensitive information by > telephone, fax or mail. If you do not wish to have your information > sent by email, please contact the sender immediately. > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071006/a088c6bc/attachment.htm From vip at avatar.com.au Sat Oct 6 16:54:29 2007 From: vip at avatar.com.au (David Worrall) Date: Sun, 7 Oct 2007 00:54:29 +1000 Subject: [Pythonmac-SIG] easygui In-Reply-To: <45786AB3-C11C-4B58-B667-97F0548D5249@free.fr> References: <20E87624-14A8-4F60-AF39-77F1AE05A167@sbcglobal.net> <2BFC1AE4-28A9-4989-B334-0BCA0132B6B2@yale.edu> <346E7E79-88F8-4DE2-9A9C-42E0459EC7FE@avatar.com.au> <45786AB3-C11C-4B58-B667-97F0548D5249@free.fr> Message-ID: Hi Robin, I know them both very well. Good at what they do. Supercollider is even better (IMO) However they both only have python for scripting. If it's python you want, approach with caution .... David On 06/10/2007, at 11:42 PM, robin meier wrote: > hello, > > for simple gui's using different media (audio, video, openGL etc ) > you might consider pure data (open source) http://en.wikipedia.org/ > wiki/Pure_Data or max msp jitter (expensive... cycling74.com) > > both environments have objects which enable you to integrate your > python code. > > maybe this helps... > best, > robin > > On 5 Oct 2007, at 20:45, adam naples wrote: > >> I've had some occasions to fight with getting audio working like I >> want in visionegg and had no problems beyond the normal 'nothing- >> working-like-you-expect-the-first-time'. >> >> I've been using it for presenting stimuli for eye-tracking and >> sentence comprehension, and I just make sure all my stimuli are >> aiff or wav. Really it's been much less bug prone than my >> experiences with director, e-prime and psyscope. If you need to >> present video it's a little more of a hassle, but not so much. >> >> What problems were you having with visionegg and audio? I'm happy >> to help if i can. >> -a >> I don't know visionegg so I went to their website entered a couple of audio words into their search engine and they all drew a blank. So it's nice to hear that it has an approach to audio. I'll check it out. .... _________________________________________ experimental polymedia: www.avatar.com.au Sonic Communications Research Group, University of Canberra: creative.canberra.edu.au/scrg From lyndsey.ferguson at gmail.com Mon Oct 8 22:57:03 2007 From: lyndsey.ferguson at gmail.com (Lyndsey Ferguson) Date: Mon, 8 Oct 2007 16:57:03 -0400 Subject: [Pythonmac-SIG] P4Python, MySQLdb, or Python Extensions Message-ID: <8532cb8c0710081357g1f3e31f8gb4fa4172c60e68df@mail.gmail.com> Hello everyone, Short time lurker, first time poster. I'm trying to install P4Python and MySQLdb, but am running into a host of issues. The trouble I've had trying to install these two and the number of similar experiences I've read through googling leads me to believe that Python can be difficult on the Mac. I will talk about P4Python as it seems to be the easier of the two. I'm trying to compile the given c++ file to build a Python Extension, but the setup.py doesn't work as it should be linking in CoreFoundation, but it is not. ImportError: Failure linking new module: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/P4Client.so: Symbol not found: ___CFConstantStringClassReference Referenced from: /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/P4Client.so Expected in: dynamic lookup I tried to use Xcode to build something that can go where the site-packages go. But I have no idea what to build. It is not a dynamic library, it is not a relocatable object, I get this error when I try to import: Traceback (most recent call last): File "", line 1, in ? File "p4.py", line 19, in ? import P4Client ImportError: Inappropriate file type for dynamic loading Has anyone done this? How do I build a Python Extension using Xcode? Or perhaps even better, how do I get setup.py to work on the Mac? Thanks for any and all tips! Lyndsey Ferguson -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071008/5d3947e4/attachment.htm From vivacarlie at gmail.com Tue Oct 9 16:16:38 2007 From: vivacarlie at gmail.com (Nehemiah Dacres) Date: Tue, 9 Oct 2007 09:16:38 -0500 Subject: [Pythonmac-SIG] P4Python, MySQLdb, or Python Extensions In-Reply-To: <8532cb8c0710081357g1f3e31f8gb4fa4172c60e68df@mail.gmail.com> References: <8532cb8c0710081357g1f3e31f8gb4fa4172c60e68df@mail.gmail.com> Message-ID: <65fadfc30710090716s4ade34c7o9dc9a8bec22347a7@mail.gmail.com> .so, if im not mistaken is eather a linux shared library or not a mac shared library (someone correct me if im wrong) try making sure the python version you chose is the one for mac. the best supported python for mac is macpython(distributes in a mac installer package) from the python website but another more linux like one would be the darwinports one or the fink one. Try looking here http://wiki.python.org/moin/MacPython/PythonDistributionsForMac On 10/8/07, Lyndsey Ferguson wrote: > > > Hello everyone, > Short time lurker, first time poster. > > I'm trying to install P4Python and MySQLdb, but am running into a host of > issues. > > The trouble I've had trying to install these two and the number of similar > experiences I've read through googling leads me to believe that Python can > be difficult on the Mac. > > I will talk about P4Python as it seems to be the easier of the two. I'm > trying to compile the given c++ file to build a Python Extension, but the > setup.py doesn't work as it should be linking in CoreFoundation, but it is > not. > > ImportError: Failure linking new module: > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/P4Client.so: > Symbol not found: ___CFConstantStringClassReference > Referenced from: > /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/P4Client.so > Expected in: dynamic lookup > > > I tried to use Xcode to build something that can go where the > site-packages go. But I have no idea what to build. It is not a dynamic > library, it is not a relocatable object, I get this error when I try to > import: > > Traceback (most recent call last): > File "", line 1, in ? > File "p4.py", line 19, in ? > import P4Client > ImportError: Inappropriate file type for dynamic loading > > > Has anyone done this? How do I build a Python Extension using Xcode? Or > perhaps even better, how do I get setup.py to work on the Mac? > > Thanks for any and all tips! > Lyndsey Ferguson > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > -- "lalalalala! it's not broken because I can use it" http://linux.slashdot.org/comments.pl?sid=194281&threshold=1&commentsort=0&mode=thread&cid=15927703 -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071009/92f2f66d/attachment.htm From lyndsey.ferguson at gmail.com Tue Oct 9 17:59:41 2007 From: lyndsey.ferguson at gmail.com (Lyndsey Ferguson) Date: Tue, 9 Oct 2007 11:59:41 -0400 Subject: [Pythonmac-SIG] P4Python, MySQLdb, or Python Extensions In-Reply-To: <65fadfc30710090716s4ade34c7o9dc9a8bec22347a7@mail.gmail.com> References: <8532cb8c0710081357g1f3e31f8gb4fa4172c60e68df@mail.gmail.com> <65fadfc30710090716s4ade34c7o9dc9a8bec22347a7@mail.gmail.com> Message-ID: <8532cb8c0710090859v414e9b4ak8075b43c3a92f6c2@mail.gmail.com> On 10/9/07, Nehemiah Dacres wrote: > > .so, if im not mistaken is eather a linux shared library or not a mac > shared library (someone correct me if im wrong) try making sure the python > version you chose is the one for mac. the best supported python for mac is > macpython (distributes in > a mac installer package) from the python website but another more linux like > one would be the darwinports one or the fink one. Try looking here > > http://wiki.python.org/moin/MacPython/PythonDistributionsForMac Thank you for the reply. I have removed older versions of Python and using your link, installed Python 2.5 for the Macintosh. After which I tried to build and install with the same problem. But I have solved it and will post it to the author and this list (in case someone follows in my footsteps). In the setup.py for the Macintosh case, I had to add the "extra_link_args=["-framework", "Carbon] to the setup call. This works and I was able to run it in python. Regards, Lyndsey Ferguson -- Lyndsey Ferguson -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071009/59d9c8a0/attachment.htm From Chris.Barker at noaa.gov Tue Oct 9 21:50:44 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 09 Oct 2007 12:50:44 -0700 Subject: [Pythonmac-SIG] P4Python, MySQLdb, or Python Extensions In-Reply-To: <8532cb8c0710090859v414e9b4ak8075b43c3a92f6c2@mail.gmail.com> References: <8532cb8c0710081357g1f3e31f8gb4fa4172c60e68df@mail.gmail.com> <65fadfc30710090716s4ade34c7o9dc9a8bec22347a7@mail.gmail.com> <8532cb8c0710090859v414e9b4ak8075b43c3a92f6c2@mail.gmail.com> Message-ID: <470BDB94.4050300@noaa.gov> Lyndsey Ferguson wrote: > In the setup.py for the Macintosh case, I had to add the > "extra_link_args=["-framework", "Carbon] to the setup call. This works > and I was able to run it in python. Shouldn't distutils do this for you? Anyone know? -CHB -- 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 kw at codebykevin.com Wed Oct 10 20:55:21 2007 From: kw at codebykevin.com (Kevin Walzer) Date: Wed, 10 Oct 2007 14:55:21 -0400 Subject: [Pythonmac-SIG] py2app: Leopard vs. Tiger Message-ID: <470D2019.5050309@codebykevin.com> I'm debating when to move my own development machine to Leopard. Right now all the components that I use to assemble my Python app were built on 10.4, so I know they should run on both 10.4 and 10.5; I want to continue to support 10.4. However, will an application that is bundled by py2app on 10.5 run on 10.4 if all the frameworks were originally build on 10.4? Does py2app introduce any kind of additional compilation that would break backward OS compatability? -- Kevin Walzer Code by Kevin http://www.codebykevin.com From ronaldoussoren at mac.com Wed Oct 10 21:29:28 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 10 Oct 2007 21:29:28 +0200 Subject: [Pythonmac-SIG] py2app: Leopard vs. Tiger In-Reply-To: <470D2019.5050309@codebykevin.com> References: <470D2019.5050309@codebykevin.com> Message-ID: <761A9C73-5B98-498A-8193-2D708988CE6F@mac.com> On 10 Oct, 2007, at 20:55, Kevin Walzer wrote: > I'm debating when to move my own development machine to Leopard. Right > now all the components that I use to assemble my Python app were built > on 10.4, so I know they should run on both 10.4 and 10.5; I want to > continue to support 10.4. However, will an application that is bundled > by py2app on 10.5 run on 10.4 if all the frameworks were originally > build on 10.4? Does py2app introduce any kind of additional > compilation > that would break backward OS compatability? py2app does not cause additional compilation. As long as the python framework and all extensions and shared libraries are build for 10.4 the resulting .app should work just fine. In theory it should even be possible to build extensions on 10.5, as long as the python framework is build with the 10.4u SDK and MACOSX_DEPLOYMENT_TARGET is set to 10.4. That's not something I've tested though, just compiling all C/C++ code on a 10.4 system is therefore the safest course. Ronald > > -- > Kevin Walzer > Code by Kevin > http://www.codebykevin.com > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071010/95b68139/attachment.bin From punch at cse.msu.edu Thu Oct 11 18:51:07 2007 From: punch at cse.msu.edu (punch) Date: Thu, 11 Oct 2007 12:51:07 -0400 Subject: [Pythonmac-SIG] Audio_mac.py fails in writeframes Message-ID: <470E547B.30401@cse.msu.edu> I'm running 'OS X' 10.4.10 and python 2.5.1 on a MacBook Pro SR. When I try to run any of the audio demos, specifically Audio_mac.py, I get errors. The error is in the writeframes method. It appears to try and pack the constant extSH (set to 0xFF) as a signed byte, which it cannot do. I've searched all around and found one guy on the net with this problem but no answer. I can over-ride the writeframes method but what should extSH be? Any help appreciated. -- >>>bill<<< From Jack.Jansen at cwi.nl Thu Oct 11 23:04:22 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Thu, 11 Oct 2007 23:04:22 +0200 Subject: [Pythonmac-SIG] Audio_mac.py fails in writeframes In-Reply-To: <470E547B.30401@cse.msu.edu> References: <470E547B.30401@cse.msu.edu> Message-ID: <46A9250A-6F02-48F0-A0DF-96C4A0182D46@cwi.nl> On 11-Oct-2007, at 18:51 , punch wrote: > I'm running 'OS X' 10.4.10 and python 2.5.1 on a MacBook Pro SR. > When I > try to run any of the audio demos, specifically Audio_mac.py, I get > errors. The error is in the writeframes method. It appears to try and > pack the constant extSH (set to 0xFF) as a signed byte, which it > cannot do. Change the struct.pack format from 'llHhllbbl' to 'llHhllBBl'. The code predates the distinction between signed and unsigned bytes in struct.pack. But be warned that this also shows how well-maintained the code is:-) -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071011/d3332e95/attachment.htm From gibbz at ou.edu Mon Oct 15 18:44:05 2007 From: gibbz at ou.edu (Jeremy Gibbs) Date: Mon, 15 Oct 2007 11:44:05 -0500 Subject: [Pythonmac-SIG] Packaging Imagemagick into wxPython standalones. Message-ID: <995EA334-1D41-43B0-A227-756CE6C39C30@ou.edu> I am creating a very simple front end to a vector graphics package that one of my professors wrote. His package writes the images out in .eps format. So in my code I just call ImageMagick's 'convert' function to jpeg. From jpeg I can use wxPython's ConvertToBitmap() feature to display the image to the user. This works great from the command line, but when I try to make a standalone with py2app, it fails due to 'convert' not working. When this didn't work, I tried using PIL and converting by Image.open and Image.save. Again, this worked great from the command line, but failed in the standalone version. I suspect it is likely that I am not including all relevant libraries needed for this to work. Has anyone had any experience using ImageMagick or PIL in a standalone application to convert image types? Thanks for any help. Jeremy Gibbs From Chris.Barker at noaa.gov Mon Oct 15 19:34:29 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 15 Oct 2007 10:34:29 -0700 Subject: [Pythonmac-SIG] Packaging Imagemagick into wxPython standalones. In-Reply-To: <995EA334-1D41-43B0-A227-756CE6C39C30@ou.edu> References: <995EA334-1D41-43B0-A227-756CE6C39C30@ou.edu> Message-ID: <4713A4A5.9020206@noaa.gov> Jeremy Gibbs wrote: > Has anyone had any experience using ImageMagick or PIL in a > standalone application to convert image types? PIL works fine in a stand-alone in general, but.... both ImageMagik and PIL are raster format packages. EPS is a vector format, so I think both PIL and ImageMagik use ghostscript to render the EPS for you, and I think they both use it as an external application, so the users of your stand-alone are going to need to have ghostscript installed. Also, when using ImageMagik, are you using the python bindings? or calling "convert" as a system call? -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 Larry.A.Meyn at nasa.gov Mon Oct 15 19:15:21 2007 From: Larry.A.Meyn at nasa.gov (Larry Meyn) Date: Mon, 15 Oct 2007 10:15:21 -0700 Subject: [Pythonmac-SIG] Packaging Imagemagick into wxPython standalones. In-Reply-To: <995EA334-1D41-43B0-A227-756CE6C39C30@ou.edu> References: <995EA334-1D41-43B0-A227-756CE6C39C30@ou.edu> Message-ID: <64A5ED91-BC61-4BD2-94F4-625D162AC073@nasa.gov> Jeremy, You should include the error trace when posting problems and preferably snippets of the misbehaving code. I had a similar problem with a py2app attempt that turned out be my not having a resource data directory included in the bundle that was built. Larry On Oct 15, 2007, at 9:44 AM, Jeremy Gibbs wrote: > I am creating a very simple front end to a vector graphics package > that one of my professors wrote. His package writes the images out > in .eps format. So in my code I just call ImageMagick's 'convert' > function to jpeg. From jpeg I can use wxPython's ConvertToBitmap() > feature to display the image to the user. This works great from the > command line, but when I try to make a standalone with py2app, it > fails due to 'convert' not working. > > When this didn't work, I tried using PIL and converting by Image.open > and Image.save. Again, this worked great from the command line, but > failed in the standalone version. I suspect it is likely that I am > not including all relevant libraries needed for this to work. > > Has anyone had any experience using ImageMagick or PIL in a > standalone application to convert image types? > > Thanks for any help. > > Jeremy Gibbs > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig Larry Meyn -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071015/bd5fe5a4/attachment.htm From BrunosJunk at Bronosky.com Fri Oct 19 21:24:59 2007 From: BrunosJunk at Bronosky.com (Richard Bronosky) Date: Fri, 19 Oct 2007 15:24:59 -0400 Subject: [Pythonmac-SIG] Anyone having luck py2app on wxPython (wxGlade)? Message-ID: I've been trying to package up the wxGlade app with py2app, and have had no luck. I've tried lots of different things with no luck. py2app was giving me macholib errors (from strip) trying to install py2app from source complained of not finding site-packages/site.py ideas? -- .!# RichardBronosky #!. From hengist.podd at virgin.net Sun Oct 21 21:33:42 2007 From: hengist.podd at virgin.net (has) Date: Sun, 21 Oct 2007 20:33:42 +0100 Subject: [Pythonmac-SIG] setuptools/distutils/py2app bug? (addendum) In-Reply-To: <0F899993-6AE2-4CFC-A801-1F9783CFFA3E@virgin.net> References: <0F899993-6AE2-4CFC-A801-1F9783CFFA3E@virgin.net> Message-ID: <1580C216-9676-4B97-83B4-33FEBEB857D2@virgin.net> On 21 Oct 2007, at 20:11, I wrote: > Getting the following error when using py2app to build ASDictionary: > [snip] Anonymous checkout here, for anyone that wants to try it themselves: svn checkout http://appscript.svn.sourceforge.net/svnroot/appscript/ ASDictionary I should also mention that the error doesn't occur if I delete the CFBundleDocumentTypes entry in setup.py. Thanks, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From hengist.podd at virgin.net Sun Oct 21 21:11:08 2007 From: hengist.podd at virgin.net (has) Date: Sun, 21 Oct 2007 20:11:08 +0100 Subject: [Pythonmac-SIG] setuptools/distutils/py2app bug? In-Reply-To: References: Message-ID: <0F899993-6AE2-4CFC-A801-1F9783CFFA3E@virgin.net> Hi folks, Getting the following error when using py2app to build ASDictionary: mb:~/appscript/ASDictionary/src has$ python setup.py py2app Traceback (most recent call last): File "setup.py", line 46, in iconfile='ASDictionary.icns' File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/distutils/core.py", line 112, in setup _setup_distribution = dist = klass(attrs) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/site-packages/setuptools-0.6c7-py2.5.egg/setuptools/ dist.py", line 223, in __init__ File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/distutils/dist.py", line 239, in __init__ for (opt, val) in cmd_options.items(): AttributeError: 'list' object has no attribute 'items' Freshly installed Python 2.5 on MBP. Relevant packages straight off PyPI: altgraph-0.6.7-py2.5.egg bdist_mpkg-0.4.3-py2.5.egg macholib-1.1-py2.5.egg modulegraph-0.7-py2.5.egg py2app-0.3.6-py2.5.egg setuptools-0.6c7-py2.5.egg Any ideas? Thanks, has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From noah.gift at gmail.com Mon Oct 22 07:51:57 2007 From: noah.gift at gmail.com (Noah Gift) Date: Mon, 22 Oct 2007 01:51:57 -0400 Subject: [Pythonmac-SIG] readline support for OS X Leopard Message-ID: I have been getting ready for the official leopard release in a few days, and have been a bit worried about readline support. I forgot what I did to get it to work for IPython, which I absolutely cannot live without anymore. Is there a plan for a Leopard binary that fixes readline, or can I help someone prepare some documentation on getting readline working properly. I don't have a lot of time during the next couple of weeks to get into compile hell, but if someone has any easy fix to get readline to work, I would greatly appreciate it. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071022/3aaf0189/attachment.htm From mhjorleifsson at mac.com Mon Oct 22 14:54:38 2007 From: mhjorleifsson at mac.com (Michele Hjorleifsson) Date: Mon, 22 Oct 2007 08:54:38 -0400 Subject: [Pythonmac-SIG] Python on Mac Book In-Reply-To: References: Message-ID: <638484B1-D01C-4CEC-9916-4754F6D5B0A0@mac.com> Is there a good book out there on programming python on mac ? From skip at pobox.com Mon Oct 22 15:02:09 2007 From: skip at pobox.com (skip at pobox.com) Date: Mon, 22 Oct 2007 08:02:09 -0500 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: Message-ID: <18204.40785.14763.936771@montanaro.dyndns.org> Noah> ... if someone has any easy fix to get readline to work, I would Noah> greatly appreciate it. Just install GNU readline and point the build system at it. For example, I have MacPorts (http://www.macports.org/) installed in /opt/local. GNU readline is installed there, and my readline module is linked against that: % otool -L ~/local/lib/python2.6/lib-dynload/readline.so /Users/skip/local/lib/python2.6/lib-dynload/readline.so: /opt/local/lib/libreadline.5.2.dylib (compatibility version 5.0.0, current version 5.2.0) /opt/local/lib/libncursesw.5.dylib (compatibility version 5.0.0, current version 5.0.0) /usr/lib/libmx.A.dylib (compatibility version 1.0.0, current version 93.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 88.1.10) Configured like so: ./configure --prefix=/Users/skip/local CPPFLAGS=-I/opt/local/include \ LDFLAGS=-L/opt/local/lib I don't do framework builds, but if CPPFLAGS and LDFLAGS are set appropriately those should work as well. Skip From ronaldoussoren at mac.com Mon Oct 22 15:03:46 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon, 22 Oct 2007 06:03:46 -0700 Subject: [Pythonmac-SIG] Python on Mac Book In-Reply-To: <638484B1-D01C-4CEC-9916-4754F6D5B0A0@mac.com> References: <638484B1-D01C-4CEC-9916-4754F6D5B0A0@mac.com> Message-ID: <686AE1B6-0115-1000-B630-5597B88EDBF8-Webmail-10015@mac.com> On Monday, October 22, 2007, at 02:56PM, "Michele Hjorleifsson" wrote: >Is there a good book out there on programming python on mac ? No. There are a number of good books on Python programming in general and those should get you going on the Python side. For the most part Python on the mac is just like Python on other unixy platforms. I know of no books that deal with mac-specific issues (like applescript and Cocoa) from the Python perspective, but that shouldn't be a problem unless you want to use mac-specific technologies. W.r.t. applescript: appscript is very useful and has good documentation. W.r.t. Cocoa: PyObjC does not have extensive documentation, but it should be easy enough learn just enough Objective-C to learn about Cocoa from the myriad of Objective-C Cocoa books. Ronald >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG at python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig > > From bschollnick at UR.Rochester.edu Mon Oct 22 15:44:47 2007 From: bschollnick at UR.Rochester.edu (Schollnick, Benjamin) Date: Mon, 22 Oct 2007 09:44:47 -0400 Subject: [Pythonmac-SIG] Safari Bookmarks via Python (or Applescript, etc). In-Reply-To: <638484B1-D01C-4CEC-9916-4754F6D5B0A0@mac.com> Message-ID: Has anyone found a reliable method to add Safari bookmarks via Python (or Applescript, etc?) I have used plistlib to modify the Safari Bookmarks plist, but something is ?going wrong?. Safari happily uses the bookmarks, but iTunes is not syncing the new bookmarks to the iPodTouch that I am trying to use... So I suspect I have a subtle error in my Python code... So has anyone found a better (or alternative method) to do create safari bookmarks? - Benjamin -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071022/4be51643/attachment.htm From janssen at parc.com Mon Oct 22 17:26:37 2007 From: janssen at parc.com (Bill Janssen) Date: Mon, 22 Oct 2007 08:26:37 PDT Subject: [Pythonmac-SIG] ctypes and OS X CF types? Message-ID: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> I'm trying to call the Spotlight system from Python, and I thought I'd try using the ctypes support in Python 2.5 to use the MDQuery framework. However, it seems that I'll have to unearth and write ctypes definitions for a number of Core Foundation C++ types, in order to do that. Has anyone already done this? Created ctypes definitions for the standard CF types, and made them available somewhere? Thanks. Bill From daniel at keystonewood.com Mon Oct 22 18:30:25 2007 From: daniel at keystonewood.com (Daniel Miller) Date: Mon, 22 Oct 2007 12:30:25 -0400 Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <07Oct22.082637pdt.57996@synergy1.parc.xerox.com> References: <07Oct22.082637pdt.57996@synergy1.parc.xerox.com> Message-ID: Please ignore my previous email. I hope it didn't come across as condescending. Really, I was only trying to help. Unfortunately, I had not read your question thoroughly enough. Bill Janssen wrote: > I'm trying to call the Spotlight system from Python, and I thought I'd > try using the ctypes support in Python 2.5 to use the MDQuery > framework. However, it seems that I'll have to unearth and write > ctypes definitions for a number of Core Foundation C++ types, in order > to do that. Has anyone already done this? Created ctypes definitions > for the standard CF types, and made them available somewhere? Are you asking about struct definitions and such? For example: from ctypes import Structure, c_float, c_double class PMRect(Structure): _fields_ = [ ("top", c_double), ("left", c_double), ("bottom", c_double), ("right", c_double), ] class CGPoint(Structure): _fields_ = [("x", c_float), ("y", c_float)] class CGSize(Structure): _fields_ = [("width", c_float), ("height", c_float)] class CGRect(Structure): _fields_ = [("origin", CGPoint), ("size", CGSize)] Those are the only ones I've used, and luckily they're pretty simple. I do not know of a library of definitions for standard CF types. Sorry. ~ Daniel From daniel at keystonewood.com Mon Oct 22 18:07:38 2007 From: daniel at keystonewood.com (Daniel Miller) Date: Mon, 22 Oct 2007 12:07:38 -0400 Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <07Oct22.082637pdt.57996@synergy1.parc.xerox.com> References: <07Oct22.082637pdt.57996@synergy1.parc.xerox.com> Message-ID: AFAIK you don't need to do anything special (i.e. write "ctypes definitions") to call the CF functions with ctypes. Just call them. Here's a snippet of code that I use to open a PDF document and get the number of pages: from ctypes import cdll, byref, c_void_p, c_int, c_uint, c_float, c_double from ctypes.util import find_library cf = cdll.LoadLibrary(find_library("ApplicatonServices")) filename = "/path/to/document.pdf" kCFAllocatorDefault = None kCFURLPOSIXPathStyle = 0 # open pdf document fileref = None fileurl = None try: fileref = cf.CFStringCreateWithCString(None, filename, 0) fileurl = cf.CFURLCreateWithFileSystemPath( kCFAllocatorDefault, fileref, kCFURLPOSIXPathStyle, 0 ) pdf = cf.CGPDFDocumentCreateWithURL(fileurl) if not pdf: raise PrintError("cannot open PDF document: %s" % filename) finally: if fileurl: cf.CFRelease(fileurl) if fileref: cf.CFRelease(fileref) numpages = cf.CGPDFDocumentGetNumberOfPages(pdf) if pdf: cf.CGPDFDocumentRelease(pdf) My experience with developing code like this is that it takes a lot of patience and trial and error to get it stable. Remember that you're dealing with C functions and pointers (it's called ctypes for a reason), which are not nearly as forgiving as normal Python functions and objects. For example, calling a C function with the wrong argument types will generally cause a cold hard segfault rather than give you a nice stack trace with some indication of what caused the error. When all else fails read the documentation for the library you're calling...again. ~ Daniel From njriley at uiuc.edu Mon Oct 22 19:08:13 2007 From: njriley at uiuc.edu (Nicholas Riley) Date: Mon, 22 Oct 2007 12:08:13 -0500 Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> References: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> Message-ID: <20071022170813.GA74240@uiuc.edu> On Mon, Oct 22, 2007 at 08:26:37AM -0700, Bill Janssen wrote: > I'm trying to call the Spotlight system from Python, and I thought I'd > try using the ctypes support in Python 2.5 to use the MDQuery > framework. However, it seems that I'll have to unearth and write > ctypes definitions for a number of Core Foundation C++ types, in order > to do that. Has anyone already done this? Created ctypes definitions > for the standard CF types, and made them available somewhere? CoreFoundation is C, not C++. That said, it'd probably be easier to use PyObjC with NSMetadataQuery instead. -- Nicholas Riley | From Chris.Barker at noaa.gov Mon Oct 22 19:32:14 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Mon, 22 Oct 2007 10:32:14 -0700 Subject: [Pythonmac-SIG] Anyone having luck py2app on wxPython (wxGlade)? In-Reply-To: References: Message-ID: <471CDE9E.10806@noaa.gov> I've had no problems using py2app with simpler wxPython programs. Richard Bronosky wrote: > py2app was giving me macholib errors (from strip) > trying to install py2app from source complained of not finding > site-packages/site.py How did you do the source install? For py2app in particular, easy_install is the easiest way to get it. Other than that, maybe some more specifics would help -- which versions of python, wxPython, wxGlade? a copy of your setup.py, text of the errors, etc, etc. -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 janssen at parc.com Mon Oct 22 19:38:11 2007 From: janssen at parc.com (Bill Janssen) Date: Mon, 22 Oct 2007 10:38:11 PDT Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: References: <07Oct22.082637pdt.57996@synergy1.parc.xerox.com> Message-ID: <07Oct22.103818pdt."57996"@synergy1.parc.xerox.com> > Are you asking about struct definitions and such? For example: Yes, that's right. Bill From janssen at parc.com Mon Oct 22 19:44:23 2007 From: janssen at parc.com (Bill Janssen) Date: Mon, 22 Oct 2007 10:44:23 PDT Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <20071022170813.GA74240@uiuc.edu> References: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> <20071022170813.GA74240@uiuc.edu> Message-ID: <07Oct22.104423pdt."57996"@synergy1.parc.xerox.com> > CoreFoundation is C, not C++. That said, it'd probably be easier to > use PyObjC with NSMetadataQuery instead. Unfortunately, the Objective-C API is not as functional. Bill From janssen at parc.com Mon Oct 22 19:50:47 2007 From: janssen at parc.com (Bill Janssen) Date: Mon, 22 Oct 2007 10:50:47 PDT Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> References: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> Message-ID: <07Oct22.105048pdt."57996"@synergy1.parc.xerox.com> Looks like Thomas Heller has a system for doing this: http://starship.python.net/crew/theller/wiki/Code_generation_for_Mac_OS_X_frameworks Unfortunately, it seems to be somewhat complicated, requiring the checkout and install of cmake, gccxml, and ctypeslib. Bill From delza at livingcode.org Mon Oct 22 20:07:12 2007 From: delza at livingcode.org (Dethe Elza) Date: Mon, 22 Oct 2007 11:07:12 -0700 Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <-7781530067078571428@unknownmsgid> References: <20071022170813.GA74240@uiuc.edu> <-7781530067078571428@unknownmsgid> Message-ID: <24d517dd0710221107w2708405by9aa62b5ba9661889@mail.gmail.com> On 10/22/07, Bill Janssen wrote: > > CoreFoundation is C, not C++. That said, it'd probably be easier to > > use PyObjC with NSMetadataQuery instead. > > Unfortunately, the Objective-C API is not as functional. Another option is to write the C wrapper in Objective-C (or find a third-party framework that already offers the functionality you want), then write a wrapper to expose it to Python using PyObjC. I've had success with this for using Quicktime features not exposed by Cocoa (I found a third-party library) and the Python wrapper is about three lines of boilerplate code, if I recall correctly. For cross-platform stuff, ctypes is probably the way to go. But if you're targeting OS X anyway, the PyObjC approach has worked well for me. --Dethe From emoy at apple.com Mon Oct 22 20:19:28 2007 From: emoy at apple.com (Edward Moy) Date: Mon, 22 Oct 2007 11:19:28 -0700 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: Message-ID: <8605F161-155A-49CD-840B-DE052514D406@apple.com> On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > I have been getting ready for the official leopard release in a few > days, and have been a bit worried about readline support. I forgot > what I did to get it to work for IPython, which I absolutely cannot > live without anymore. Is there a plan for a Leopard binary that > fixes readline, or can I help someone prepare some documentation on > getting readline working properly. I don't have a lot of time > during the next couple of weeks to get into compile hell, but if > someone has any easy fix to get readline to work, I would greatly > appreciate it. The installed version of python on Leopard will actually have readline support turned on by default, but it uses the EditLine (libedit) library, not the GNU Readline (due to licensing reasons). While functionally equivalent, the command syntax is different. From the python(1) man page: INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION The Python inteterpreter supports editing of the current input line and history substitution, similar to facilities found in the Korn shell and the GNU Bash shell. However, rather than being implemented using the GNU Readline library, this Python interpreter uses the BSD EditLine library editline(3) with a GNU Readline emulation layer. The readline module provides the access to the EditLine library, but there are a few major differences compared to a traditional implementa- tion using the Readline library. The command language used in the preference files is that of EditLine, as described in editrc(5) and not that used by the Readline library. This also means that the parse_and_bind() routines uses EditLine commands. And the preference file itself is ~/.editrc instead of ~/.inputrc. For example, the rlcompleter module, which defines a completion func- tion for the readline modules, works correctly with the EditLine libraries, but needs to be initialized somewhat differently: import rlcompleter import readline readline.parse_and_bind("bind ^I rl_complete") For vi mode, one needs: readline.parse_and_bind("bind -v") -------------------------------------------------------------------------- Edward Moy Apple Computer, Inc. emoy at apple.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071022/35aba03b/attachment.htm From hengist.podd at virgin.net Mon Oct 22 20:31:11 2007 From: hengist.podd at virgin.net (has) Date: Mon, 22 Oct 2007 19:31:11 +0100 Subject: [Pythonmac-SIG] Python on Mac Book In-Reply-To: References: Message-ID: <9B2E9B9E-23A2-4251-ABD5-7B856CE28692@virgin.net> Ronald Oussoren wrote: >> Is there a good book out there on programming python on mac ? > > No. There are a number of good books on Python programming in > general and those should get you going on the Python side. For the > most part Python on the mac is just like Python on other unixy > platforms. Also various online tutorials, if the OP's completely new to Python. Easy enough to find. > I know of no books that deal with mac-specific issues (like > applescript and Cocoa) from the Python perspective, but that > shouldn't be a problem unless you want to use mac-specific > technologies. W.r.t. applescript: appscript is very useful and has > good documentation. Yep, appscript is quite straightforward to use once you appreciate how it works. (It's basically a hybrid RPC+query-based system, not an object-oriented connected a-la COM or CORBA, and any syntax on top of that is just sugar to sweeten the taste.) The hard bit is dealing with the various bugs, quirks and inadequate documentation of the applications you want to script, but that's not something specific to appscript. Dealing with this tends to be a bit hand-to-mouth, involving a fair degree of intelligent guesswork, trial-and-error testing, studying existing scripts and generally looking and asking around for help. However, there's various folks here and in the AppleScript community who can provide advice on specific problems (and several mailing list and BBS archives you can search for past discussions) so don't be afraid to ask. > W.r.t. Cocoa: PyObjC does not have extensive documentation, but it > should be easy enough learn just enough Objective-C to learn about > Cocoa from the myriad of Objective-C Cocoa books. FWIW, this is how I did it: one copy of PyObjC (for obvious reasons), one copy of AppKiDo (for quickly looking up Cocoa API documentation), one copy of Hillegass (to grok the basic concepts behind Cocoa programming), one Google bookmark (for everything else), and just dived in and began writing code till it started to all make sense. The example code included with PyObjC is really handy for picking through and pulling apart to help understand the general principles and as a source of example solutions to various common design requirements. And again, there are plenty of folks here and in the wider Cocoa community (e.g. I also subscribe to Omni's MacOSX-dev and Apple's Cocoa-dev mailing lists) who you can ask for advice when you need it. HTH has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From noah.gift at gmail.com Mon Oct 22 20:35:39 2007 From: noah.gift at gmail.com (Noah Gift) Date: Mon, 22 Oct 2007 14:35:39 -0400 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: <8605F161-155A-49CD-840B-DE052514D406@apple.com> References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> Message-ID: Edward, Thanks for the information. Do you know of a way to get IPython to use edline instead? IPython is growing in popularity for Python programmers, and it seems like getting a way forward that works with edline makes sense, or maybe I am wrong and people will need to just manually install readline themselves. Noah On 10/22/07, Edward Moy wrote: > > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > > I have been getting ready for the official leopard release in a few days, > and have been a bit worried about readline support. I forgot what I did to > get it to work for IPython, which I absolutely cannot live without anymore. > Is there a plan for a Leopard binary that fixes readline, or can I help > someone prepare some documentation on getting readline working properly. I > don't have a lot of time during the next couple of weeks to get into compile > hell, but if someone has any easy fix to get readline to work, I would > greatly appreciate it. > > > > The installed version of python on Leopard will actually have readline > support turned on by default, but it uses the EditLine (libedit) library, > not the GNU Readline (due to licensing reasons). While functionally > equivalent, the command syntax is different. From the python(1) man page: > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > The Python inteterpreter supports editing of the current input line > and > history substitution, similar to facilities found in the Korn shell > and > the GNU Bash shell. However, rather than being implemented using > the > GNU Readline library, this Python interpreter uses the BSD > EditLine > library editline(3) with a GNU Readline emulation layer. > > > The readline module provides the access to the EditLine library, > but > there are a few major differences compared to a traditional > implementa- > tion using the Readline library. The command language used in > the > preference files is that of EditLine, as described in editrc(5) and > not > that used by the Readline library. This also means that > the > parse_and_bind() routines uses EditLine commands. And the > preference > file itself is ~/.editrc instead of ~/.inputrc. > > > For example, the rlcompleter module, which defines a completion > func- > tion for the readline modules, works correctly with the > EditLine > libraries, but needs to be initialized somewhat differently: > > > import rlcompleter > import readline > readline.parse_and_bind("bind ^I rl_complete") > > > For vi mode, one needs: > > > readline.parse_and_bind("bind -v") > > > > -------------------------------------------------------------------------- > > Edward Moy > > Apple Computer, Inc. > > emoy at apple.com > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071022/6fdf3f5a/attachment-0001.htm From bwaters at nrao.edu Mon Oct 22 20:55:02 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Mon, 22 Oct 2007 12:55:02 -0600 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> Message-ID: Interesting. FWIW I just built IPython against the system python (with libedit, apparently) and it works fine; I have readline-like command navigation, history support, etc. I was not aware of any change from using readline (which is what I used with 10.4.x) On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: > Edward, > > Thanks for the information. Do you know of a way to get IPython to > use edline instead? IPython is growing in popularity for Python > programmers, and it seems like getting a way forward that works with > edline makes sense, or maybe I am wrong and people will need to just > manually install readline themselves. > > Noah > > On 10/22/07, Edward Moy wrote: > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > >> I have been getting ready for the official leopard release in a few >> days, and have been a bit worried about readline support. I forgot >> what I did to get it to work for IPython, which I absolutely cannot >> live without anymore. Is there a plan for a Leopard binary that >> fixes readline, or can I help someone prepare some documentation on >> getting readline working properly. I don't have a lot of time >> during the next couple of weeks to get into compile hell, but if >> someone has any easy fix to get readline to work, I would greatly >> appreciate it. > > > The installed version of python on Leopard will actually have > readline support turned on by default, but it uses the EditLine > (libedit) library, not the GNU Readline (due to licensing reasons). > While functionally equivalent, the command syntax is different. > From the python(1) man page: > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > The Python inteterpreter supports editing of the current > input line and > history substitution, similar to facilities found in the Korn > shell and > the GNU Bash shell. However, rather than being implemented > using the > GNU Readline library, this Python interpreter uses the > BSD EditLine > library editline(3) with a GNU Readline emulation layer. > > > The readline module provides the access to the EditLine > library, but > there are a few major differences compared to a traditional > implementa- > tion using the Readline library. The command language > used in the > preference files is that of EditLine, as described in > editrc(5) and not > that used by the Readline library. This also means > that the > parse_and_bind() routines uses EditLine commands. And the > preference > file itself is ~/.editrc instead of ~/.inputrc. > > > For example, the rlcompleter module, which defines a > completion func- > tion for the readline modules, works correctly with > the EditLine > libraries, but needs to be initialized somewhat differently: > > > import rlcompleter > import readline > readline.parse_and_bind ("bind ^I rl_complete") > > > For vi mode, one needs: > > > readline.parse_and_bind("bind -v") > > > -------------------------------------------------------------------------- > Edward Moy > Apple Computer, Inc. > emoy at apple.com > > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From emoy at apple.com Mon Oct 22 21:02:17 2007 From: emoy at apple.com (Edward Moy) Date: Mon, 22 Oct 2007 12:02:17 -0700 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> Message-ID: <652B1E4E-5701-4796-8B59-1E28C427BD13@apple.com> We did fix a few bugs related to IPython and Leopard's python, so to some degree, it does work (sorry, I don't use IPython myself). There was a problem with IPython explicitly loading ~/.inputrc when readline support is available, which will fail due to the command syntax problem. Just guessing, but converting the .inputrc to EditLine syntax *should* probably fix that problem. Ed On Oct 22, 2007, at 11:35 AM, Noah Gift wrote: > Edward, > > Thanks for the information. Do you know of a way to get IPython to > use edline instead? IPython is growing in popularity for Python > programmers, and it seems like getting a way forward that works with > edline makes sense, or maybe I am wrong and people will need to just > manually install readline themselves. > > Noah > > On 10/22/07, Edward Moy wrote: > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > >> I have been getting ready for the official leopard release in a few >> days, and have been a bit worried about readline support. I forgot >> what I did to get it to work for IPython, which I absolutely cannot >> live without anymore. Is there a plan for a Leopard binary that >> fixes readline, or can I help someone prepare some documentation on >> getting readline working properly. I don't have a lot of time >> during the next couple of weeks to get into compile hell, but if >> someone has any easy fix to get readline to work, I would greatly >> appreciate it. > > > The installed version of python on Leopard will actually have > readline support turned on by default, but it uses the EditLine > (libedit) library, not the GNU Readline (due to licensing reasons). > While functionally equivalent, the command syntax is different. > From the python(1) man page: > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > The Python inteterpreter supports editing of the current > input line and > history substitution, similar to facilities found in the Korn > shell and > the GNU Bash shell. However, rather than being implemented > using the > GNU Readline library, this Python interpreter uses the > BSD EditLine > library editline(3) with a GNU Readline emulation layer. > > > The readline module provides the access to the EditLine > library, but > there are a few major differences compared to a traditional > implementa- > tion using the Readline library. The command language > used in the > preference files is that of EditLine, as described in > editrc(5) and not > that used by the Readline library. This also means > that the > parse_and_bind() routines uses EditLine commands. And the > preference > file itself is ~/.editrc instead of ~/.inputrc. > > > For example, the rlcompleter module, which defines a > completion func- > tion for the readline modules, works correctly with > the EditLine > libraries, but needs to be initialized somewhat differently: > > > import rlcompleter > import readline > readline.parse_and_bind ("bind ^I rl_complete") > > > For vi mode, one needs: > > > readline.parse_and_bind("bind -v") > > > -------------------------------------------------------------------------- > Edward Moy > Apple Computer, Inc. > emoy at apple.com > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071022/7a7183bb/attachment.htm From janssen at parc.com Mon Oct 22 21:54:26 2007 From: janssen at parc.com (Bill Janssen) Date: Mon, 22 Oct 2007 12:54:26 PDT Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <24d517dd0710221107w2708405by9aa62b5ba9661889@mail.gmail.com> References: <20071022170813.GA74240@uiuc.edu> <-7781530067078571428@unknownmsgid> <24d517dd0710221107w2708405by9aa62b5ba9661889@mail.gmail.com> Message-ID: <07Oct22.125433pdt."57996"@synergy1.parc.xerox.com> > For cross-platform stuff, ctypes is probably the way to go. But if > you're targeting OS X anyway, the PyObjC approach has worked well for > me. Thanks, but no thanks. I see no need to drag Objective-C (and PyObjC) into this. Anyone generated the CF types for CoreFoundation? Bill From janssen at parc.com Mon Oct 22 22:00:51 2007 From: janssen at parc.com (Bill Janssen) Date: Mon, 22 Oct 2007 13:00:51 PDT Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <07Oct22.105048pdt."57996"@synergy1.parc.xerox.com> References: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> <07Oct22.105048pdt."57996"@synergy1.parc.xerox.com> Message-ID: <07Oct22.130058pdt."57996"@synergy1.parc.xerox.com> > Unfortunately, it seems to be somewhat complicated, requiring the > checkout and install of cmake, gccxml, and ctypeslib. And now svn.python.org is down, so I can't get it anyway. Bill From ellisonbg.net at gmail.com Tue Oct 23 03:45:47 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Mon, 22 Oct 2007 19:45:47 -0600 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> Message-ID: <6ce0ac130710221845m5e79c00docfdaa74c2403360d@mail.gmail.com> I am forwarding this to the ipython-dev list. A number of the core ipython dev's use OS X, so we will surely jump on this one as soon as we get our hands on Leopard. This (libedit support) is great news as it has been one of the main problems with the built-in Python on OS X for a long time. Cheers, Brian On 10/22/07, Noah Gift wrote: > Edward, > > Thanks for the information. Do you know of a way to get IPython to use > edline instead? IPython is growing in popularity for Python programmers, > and it seems like getting a way forward that works with edline makes sense, > or maybe I am wrong and people will need to just manually install readline > themselves. > > Noah > > > On 10/22/07, Edward Moy wrote: > > > > > > > > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > > > > I have been getting ready for the official leopard release in a few days, > and have been a bit worried about readline support. I forgot what I did to > get it to work for IPython, which I absolutely cannot live without anymore. > Is there a plan for a Leopard binary that fixes readline, or can I help > someone prepare some documentation on getting readline working properly. I > don't have a lot of time during the next couple of weeks to get into compile > hell, but if someone has any easy fix to get readline to work, I would > greatly appreciate it. > > > > The installed version of python on Leopard will actually have readline > support turned on by default, but it uses the EditLine (libedit) library, > not the GNU Readline (due to licensing reasons). While functionally > equivalent, the command syntax is different. From the python(1) man page: > > > > > > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > > The Python inteterpreter supports editing of the current input line > and > > history substitution, similar to facilities found in the Korn shell > and > > the GNU Bash shell. However, rather than being implemented using > the > > GNU Readline library, this Python interpreter uses the BSD > EditLine > > library editline(3) with a GNU Readline emulation layer. > > > > > > The readline module provides the access to the EditLine library, > but > > there are a few major differences compared to a traditional > implementa- > > tion using the Readline library. The command language used in > the > > preference files is that of EditLine, as described in editrc(5) and > not > > that used by the Readline library. This also means that > the > > parse_and_bind() routines uses EditLine commands. And the > preference > > file itself is ~/.editrc instead of ~/.inputrc. > > > > > > For example, the rlcompleter module, which defines a completion > func- > > tion for the readline modules, works correctly with the > EditLine > > libraries, but needs to be initialized somewhat differently: > > > > > > import rlcompleter > > import readline > > readline.parse_and_bind ("bind ^I rl_complete") > > > > > > For vi mode, one needs: > > > > > > readline.parse_and_bind("bind -v") > > > > > > > > > > > > > -------------------------------------------------------------------------- > > > > Edward Moy > > > > Apple Computer, Inc. > > > > emoy at apple.com > > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > From noah.gift at gmail.com Tue Oct 23 03:55:42 2007 From: noah.gift at gmail.com (Noah Gift) Date: Mon, 22 Oct 2007 21:55:42 -0400 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: <6ce0ac130710221845m5e79c00docfdaa74c2403360d@mail.gmail.com> References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <6ce0ac130710221845m5e79c00docfdaa74c2403360d@mail.gmail.com> Message-ID: Brian, Thanks, I was just considering doing this myself. I would be happy to help document this if there is a suitable wiki for it, once a clear path gets figured out. If you do google searches for readline os x, or ipython, etc, you will tons, of people who have had this problem for quite some time. Getting clear documentation for OS X users will help the IPython cause greatly. I know in the book Jeremy Jones and I are writing, we covering IPython quite a bit, as we think it is the preferred tool for sysadmins to write code in. This is slightly off topic, but the doctest inclusion is the icing on the cake as far as I am concerned with IPython. Noah On 10/22/07, Brian Granger wrote: > > I am forwarding this to the ipython-dev list. A number of the core > ipython dev's use OS X, so we will surely jump on this one as soon as > we get our hands on Leopard. This (libedit support) is great news as > it has been one of the main problems with the built-in Python on OS X > for a long time. > > Cheers, > > Brian > > On 10/22/07, Noah Gift wrote: > > Edward, > > > > Thanks for the information. Do you know of a way to get IPython to use > > edline instead? IPython is growing in popularity for Python > programmers, > > and it seems like getting a way forward that works with edline makes > sense, > > or maybe I am wrong and people will need to just manually install > readline > > themselves. > > > > Noah > > > > > > On 10/22/07, Edward Moy wrote: > > > > > > > > > > > > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > > > > > > I have been getting ready for the official leopard release in a few > days, > > and have been a bit worried about readline support. I forgot what I did > to > > get it to work for IPython, which I absolutely cannot live without > anymore. > > Is there a plan for a Leopard binary that fixes readline, or can I help > > someone prepare some documentation on getting readline working > properly. I > > don't have a lot of time during the next couple of weeks to get into > compile > > hell, but if someone has any easy fix to get readline to work, I would > > greatly appreciate it. > > > > > > The installed version of python on Leopard will actually have readline > > support turned on by default, but it uses the EditLine (libedit) > library, > > not the GNU Readline (due to licensing reasons). While functionally > > equivalent, the command syntax is different. From the python(1) man > page: > > > > > > > > > > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > > > The Python inteterpreter supports editing of the current input > line > > and > > > history substitution, similar to facilities found in the Korn > shell > > and > > > the GNU Bash shell. However, rather than being implemented > using > > the > > > GNU Readline library, this Python interpreter uses the BSD > > EditLine > > > library editline(3) with a GNU Readline emulation layer. > > > > > > > > > The readline module provides the access to the EditLine > library, > > but > > > there are a few major differences compared to a traditional > > implementa- > > > tion using the Readline library. The command language > used in > > the > > > preference files is that of EditLine, as described in editrc(5) > and > > not > > > that used by the Readline library. > This also means that > > the > > > parse_and_bind() routines uses EditLine commands. And the > > preference > > > file itself is ~/.editrc instead of ~/.inputrc. > > > > > > > > > For example, the rlcompleter module, which defines a > completion > > func- > > > tion for the readline modules, works correctly with the > > EditLine > > > libraries, but needs to be initialized somewhat differently: > > > > > > > > > import rlcompleter > > > import readline > > > readline.parse_and_bind ("bind ^I rl_complete") > > > > > > > > > For vi mode, one needs: > > > > > > > > > readline.parse_and_bind("bind -v") > > > > > > > > > > > > > > > > > > > > > -------------------------------------------------------------------------- > > > > > > Edward Moy > > > > > > Apple Computer, Inc. > > > > > > emoy at apple.com > > > > > > > > > _______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071022/63373ee4/attachment-0001.htm From hengist.podd at virgin.net Sun Oct 21 22:49:05 2007 From: hengist.podd at virgin.net (has) Date: Sun, 21 Oct 2007 21:49:05 +0100 Subject: [Pythonmac-SIG] setuptools/distutils/py2app bug? (solved) In-Reply-To: <1580C216-9676-4B97-83B4-33FEBEB857D2@virgin.net> References: <0F899993-6AE2-4CFC-A801-1F9783CFFA3E@virgin.net> <1580C216-9676-4B97-83B4-33FEBEB857D2@virgin.net> Message-ID: <54E7DB18-0791-4F95-AF46-8EC9E7E66162@virgin.net> On 21 Oct 2007, at 20:33, has wrote: > I should also mention that the error doesn't occur if I delete the > CFBundleDocumentTypes entry in setup.py. Meh. That should've told me the solution straightaway - I put the CFBundleDocumentTypes entry in the wrong place. Fixed now. In my defense, I got thrown by the quite cryptic setuptools/distutils/ py2app-generated traceback [1], which made it look like the problem was further down. Also, having nephew and niece no.1 dropped on the doorstep at 4am this morning while youngest sister headed off to hospital to have niece no.2 may have taken the edge off me today. ;) Apologies for the bother, has [1] Any chance of implementing better error reporting here at some point in the future? -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From Chris.Barker at noaa.gov Tue Oct 23 18:33:19 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Tue, 23 Oct 2007 09:33:19 -0700 Subject: [Pythonmac-SIG] Anyone having luck py2app on wxPython (wxGlade)? In-Reply-To: References: <471CDE9E.10806@noaa.gov> Message-ID: <471E224F.4010807@noaa.gov> Richard Bronosky wrote: > A few things: That all looks good. > stripping ... > /usr/bin/strip: object: Here's that error: stripping datetime.so /usr/bin/strip: object: /PersonalStorage/Code/src/wxGlade-0.6/dist/wxglade.app/Contents/MacOS/python truncated or malformed object (linked_modules.offset field of LC_PREBIND_DYLIB command 10 extends past the end of the file) I know NOTHING about stripping, but it looks like it's having a problem stripping datatime.so. (or is the problem with whatever is next?) I'd try a little app with nothing much but datetime, and see if that works. Also, you might try python2.5, just for the heck of it. Bob or Ronald, any ideas? Also, can you turn off stripping with py2app? -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 janssen at parc.com Tue Oct 23 19:49:47 2007 From: janssen at parc.com (Bill Janssen) Date: Tue, 23 Oct 2007 10:49:47 PDT Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> References: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> Message-ID: <07Oct23.104955pdt."57996"@synergy1.parc.xerox.com> > However, it seems that I'll have to unearth and write > ctypes definitions for a number of Core Foundation C++ types, in order > to do that. Has anyone already done this? Created ctypes definitions > for the standard CF types, and made them available somewhere? OK, I've build and run Thomas Heller's tool, and you can for the moment get the generated ctypes CoreFoundation.py file from http://www.parc.com/janssen/transient/CoreFoundation.py. Bill From gary at zope.com Tue Oct 23 20:05:03 2007 From: gary at zope.com (Gary Poster) Date: Tue, 23 Oct 2007 14:05:03 -0400 Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <07Oct23.104955pdt."57996"@synergy1.parc.xerox.com> References: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> <07Oct23.104955pdt."57996"@synergy1.parc.xerox.com> Message-ID: <0659593A-B2FF-4DC8-A782-345E722D9216@zope.com> On Oct 23, 2007, at 1:49 PM, Bill Janssen wrote: >> However, it seems that I'll have to unearth and write >> ctypes definitions for a number of Core Foundation C++ types, in >> order >> to do that. Has anyone already done this? Created ctypes >> definitions >> for the standard CF types, and made them available somewhere? > > OK, I've build and run Thomas Heller's tool, and you can for the > moment get the generated ctypes CoreFoundation.py file from > http://www.parc.com/janssen/transient/CoreFoundation.py. I just wanted to compare the output with my experience of this tool for another bit of C, but I get a Forbidden: Forbidden You don't have permission to access /isl/members/janssen/transient/ CoreFoundation.py on this server. Apache/1.3.26 Server at www2.parc.com Port 80 Gary From janssen at parc.com Tue Oct 23 21:32:33 2007 From: janssen at parc.com (Bill Janssen) Date: Tue, 23 Oct 2007 12:32:33 PDT Subject: [Pythonmac-SIG] ctypes and OS X CF types? In-Reply-To: <0659593A-B2FF-4DC8-A782-345E722D9216@zope.com> References: <07Oct22.082637pdt."57996"@synergy1.parc.xerox.com> <07Oct23.104955pdt."57996"@synergy1.parc.xerox.com> <0659593A-B2FF-4DC8-A782-345E722D9216@zope.com> Message-ID: <07Oct23.123236pdt."57996"@synergy1.parc.xerox.com> I don't know what's going on there. I'll track it down. Meanwhile, http://wiki.python.org/moin/MacPython/ctypes/CoreFoundation Bill From richardbronosky at gmail.com Mon Oct 22 22:30:05 2007 From: richardbronosky at gmail.com (Richard Bronosky) Date: Mon, 22 Oct 2007 16:30:05 -0400 Subject: [Pythonmac-SIG] Anyone having luck py2app on wxPython (wxGlade)? In-Reply-To: <471CDE9E.10806@noaa.gov> References: <471CDE9E.10806@noaa.gov> Message-ID: A few things: ##1## Here is me easy_install 'ing py2app ~$ sudo easy_install py2app Searching for py2app Reading http://pypi.python.org/simple/py2app/ Reading http://undefined.org/python/#py2app Best match: py2app 0.3.6 Downloading http://pypi.python.org/packages/2.4/p/py2app/py2app-0.3.6-py2.4.egg#md5=47f572eae3f1062d87a6ea83c83d67e9 Processing py2app-0.3.6-py2.4.egg creating /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app-0.3.6-py2.4.egg Extracting py2app-0.3.6-py2.4.egg to /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages Adding py2app 0.3.6 to easy-install.pth file Installing py2applet script to /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin Installed /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app-0.3.6-py2.4.egg Processing dependencies for py2app Finished processing dependencies for py2app ##2## Here is me trying py2app: ~/Code/src/wxGlade-0.6$ /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/py2applet --make-setup wxglade.pyWrote setup.py ~/Code/src/wxGlade-0.6$ cat setup.py """ This is a setup.py script generated by py2appletUsage: python setup.py py2app """ from setuptools import setup APP = ['wxglade.py'] DATA_FILES = [] OPTIONS = {'argv_emulation': True} setup( app=APP, data_files=DATA_FILES, options={'py2app': OPTIONS}, setup_requires=['py2app'], ) ~/Code/src/wxGlade-0.6$ python setup.py py2app running py2app creating /PersonalStorage/Code/src/wxGlade-0.6/build creating ... *** filtering dependencies *** 401 total 30 filtered 4 orphaned 371 remaining*** create binaries *** creating ... *** byte compile python files *** byte-compiling ... *** creating application bundle: wxglade *** copying ... creating ... copying ... creating ... ... stripping ... /usr/bin/strip: object: /PersonalStorage/Code/src/wxGlade-0.6/dist/wxglade.app/Contents/MacOS/python truncated or malformed object (linked_modules.offset field of LC_PREBIND_DYLIB command 10 extends past the end of the file) stripping saved 28091904 bytes (23179300 / 51271204) If you need more detail on the error, see: http://rafb.net/p/m9brIu37.html ##3## Here are the vers you asked for: /PersonalStorage/Code/src/wxGlade-0.6$ python -V Python 2.4.4 /PersonalStorage/Code/src/wxGlade-0.6$ python -c 'import wx;print wx' -- .!# RichardBronosky #!. From ronaldoussoren at mac.com Wed Oct 24 12:44:41 2007 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed, 24 Oct 2007 12:44:41 +0200 Subject: [Pythonmac-SIG] Anyone having luck py2app on wxPython (wxGlade)? In-Reply-To: <471E224F.4010807@noaa.gov> References: <471CDE9E.10806@noaa.gov> <471E224F.4010807@noaa.gov> Message-ID: <8867B1E6-4D61-420D-9808-0D178C0D813B@mac.com> On 23 Oct, 2007, at 18:33, Christopher Barker wrote: > > > Richard Bronosky wrote: >> A few things: > > That all looks good. > >> stripping ... >> /usr/bin/strip: object: > > Here's that error: > > stripping datetime.so > /usr/bin/strip: object: > /PersonalStorage/Code/src/wxGlade-0.6/dist/wxglade.app/Contents/ > MacOS/python > truncated or malformed object (linked_modules.offset field of > LC_PREBIND_DYLIB command 10 extends past the end of the file) > > > I know NOTHING about stripping, but it looks like it's having a > problem > stripping datatime.so. (or is the problem with whatever is next?) > > I'd try a little app with nothing much but datetime, and see if that > works. Also, you might try python2.5, just for the heck of it. > > Bob or Ronald, any ideas? this looks like a problem with the version of python that Richard is using. I haven't followed this discussion so far, but what version is being used? Is the the macports one, if so which version? Which OS are you running on? > > > Also, can you turn off stripping with py2app? python setup.py py2app --no-strip You might also try 'python setup.py py2app -A'. This will build an alias bundle which depends on the source tree and the local python installation, but is a convenient way of building during development. It does make it a lot easier to quickly check if you have packaged all resources (icons, xml files, ...) that the application needs. Ronald > > > -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 > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2224 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071024/7e1c934d/attachment.bin From leknarf at pacbell.net Wed Oct 24 17:15:29 2007 From: leknarf at pacbell.net (Scott Frankel) Date: Wed, 24 Oct 2007 08:15:29 -0700 Subject: [Pythonmac-SIG] _imagingft for PIL Message-ID: Pardon the cross-post. Would anyone on this list happen to know the appropriate way to build and install _imagingft for use with PIL? My Google searches have found references to it, source code, complaints, and disclaimers; but I have not found the info I need to build & install it. I would like to render fonts. Thanks in advance! Scott MacOSX v10.4.9 Python v2.4.1 PIL v1.1.6 From BrunosJunk at Bronosky.com Wed Oct 24 17:33:20 2007 From: BrunosJunk at Bronosky.com (Richard Bronosky) Date: Wed, 24 Oct 2007 11:33:20 -0400 Subject: [Pythonmac-SIG] Anyone having luck py2app on wxPython (wxGlade)? In-Reply-To: <8867B1E6-4D61-420D-9808-0D178C0D813B@mac.com> References: <471CDE9E.10806@noaa.gov> <471E224F.4010807@noaa.gov> <8867B1E6-4D61-420D-9808-0D178C0D813B@mac.com> Message-ID: After looking more deeply into this, I believe that there are some lower level issues that need to be resolved. Doing so may bubble up to fix the py2app+wxGlade issue. Please give me an opinion on my system described below. I have tried so may things to get py2app to work that I may have left my system in an inconsistent state. On 10/24/07, Ronald Oussoren wrote: > I haven't followed this discussion so far, but what version is > being used? Is the the macports one, if so which version? Yes, I have the Macports python2.4 and python2.5 installed. Quite honestly I'm always very confused as to which gets used, and what the module path is. Here are the pythons I have on my system: /System/Library/Frameworks/Python.framework/Versions/2.3/bin/python2.3 /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4 /opt/local/bin/python -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/python /opt/local/bin/python2.5 /opt/local/var/macports/software/python24/2.4.4_1+darwin_8/opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin/python2.4 /opt/local/var/macports/software/python25/2.5.1_1+darwin_8/opt/local/bin/python2.5 my env has: PYTHONPATH=/Users/rbronosky/Code/python/site-packages and finally there is: python -c 'import sys;print sys.path' [ '', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/geopy-0.93-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/UNKNOWN-0.0.0-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/configobj-4.4.0-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app-0.3.6-py2.4.egg', '/Users/rbronosky/Code/python/site-packages', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python24.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac/lib-scriptpackages', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-dynload', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages', '/opt/local/lib/python2.4/site-packages', '/opt/local/lib/python2.4/site-packages/Numeric', '/opt/local/lib/python2.4/site-packages/PyObjC', '/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode' ] > > Which OS are you running on? 10.4.10 > > > > > > > Also, can you turn off stripping with py2app? > > python setup.py py2app --no-strip > > You might also try 'python setup.py py2app -A'. This will build an > alias bundle which depends on the source tree and the local python > installation, but is a convenient way of building during development. > It does make it a lot easier to quickly check if you have packaged all > resources (icons, xml files, ...) that the application needs. I tried the aliased build on a simple py that I generated with wxGlade. The resulting app, when launched, gives me this error: ImportError: No module named wx -- .!# RichardBronosky #!. From BrunosJunk at Bronosky.com Wed Oct 24 18:09:51 2007 From: BrunosJunk at Bronosky.com (Richard Bronosky) Date: Wed, 24 Oct 2007 12:09:51 -0400 Subject: [Pythonmac-SIG] How does py2app decide what to use as a sys.path? Message-ID: I can't figure out how to get py2app to include the site-package dir where my wx is located. Here is a transcript of a simple test I ran. Please advise. /tmp$ cat py2app-test.py #!/usr/bin/env python import sys; print "Python Version:", sys.version print "Python Path:", sys.path import wx /tmp$ ./py2app-test.py Python Version: 2.4.4 (#1, Aug 18 2007, 11:05:26) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] Python Path: ['/private/tmp', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/geopy-0.93-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/UNKNOWN-0.0.0-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/configobj-4.4.0-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app-0.3.6-py2.4.egg', '/Users/rbronosky/Code/python/site-packages', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python24.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac/lib-scriptpackages', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-dynload', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages', '/opt/local/lib/python2.4/site-packages', '/opt/local/lib/python2.4/site-packages/Numeric', '/opt/local/lib/python2.4/site-packages/PyObjC', '/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode'] /tmp$ py2applet -A ./py2app-test.py running py2app creating /private/tmp/tmp0GHZAP/build creating /private/tmp/tmp0GHZAP/build/bdist.macosx-10.3-i386 creating /private/tmp/tmp0GHZAP/build/bdist.macosx-10.3-i386/python2.4-standalone creating /private/tmp/tmp0GHZAP/build/bdist.macosx-10.3-i386/python2.4-standalone/app creating /private/tmp/tmp0GHZAP/build/bdist.macosx-10.3-i386/python2.4-standalone/app/collect creating /private/tmp/tmp0GHZAP/build/bdist.macosx-10.3-i386/python2.4-standalone/app/temp creating /private/tmp/tmp0GHZAP/dist creating build/bdist.macosx-10.3-i386/python2.4-standalone/app/lib-dynload creating build/bdist.macosx-10.3-i386/python2.4-standalone/app/Frameworks *** creating application bundle: py2app-test *** creating /private/tmp/py2app-test.app creating /private/tmp/py2app-test.app/Contents copying /private/tmp/tmp0GHZAP/dist/py2app-test.app/Contents/Info.plist -> /private/tmp/py2app-test.app/Contents creating /private/tmp/py2app-test.app/Contents/MacOS copying /private/tmp/tmp0GHZAP/dist/py2app-test.app/Contents/MacOS/py2app-test -> /private/tmp/py2app-test.app/Contents/MacOS linking /private/tmp/py2app-test.app/Contents/MacOS/python -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python copying /private/tmp/tmp0GHZAP/dist/py2app-test.app/Contents/PkgInfo -> /private/tmp/py2app-test.app/Contents creating /private/tmp/py2app-test.app/Contents/Resources copying /private/tmp/tmp0GHZAP/dist/py2app-test.app/Contents/Resources/__boot__.py -> /private/tmp/py2app-test.app/Contents/Resources copying /private/tmp/tmp0GHZAP/dist/py2app-test.app/Contents/Resources/__error__.sh -> /private/tmp/py2app-test.app/Contents/Resources creating /private/tmp/py2app-test.app/Contents/Resources/lib creating /private/tmp/py2app-test.app/Contents/Resources/lib/python2.4 linking /private/tmp/py2app-test.app/Contents/Resources/lib/python2.4/config -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/config linking /private/tmp/py2app-test.app/Contents/Resources/lib/python2.4/site.py -> ../../site.py linking /private/tmp/py2app-test.app/Contents/Resources/PythonApplet.icns -> /opt/local/Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/Resources/PythonApplet.icns copying /private/tmp/tmp0GHZAP/dist/py2app-test.app/Contents/Resources/site.py -> /private/tmp/py2app-test.app/Contents/Resources copying /private/tmp/tmp0GHZAP/dist/py2app-test.app/Contents/Resources/site.pyc -> /private/tmp/py2app-test.app/Contents/Resources /tmp$ tail -n 0 -f /Library/Logs/Console/$(id -u)/console.log & open py2app-test.app [1] 14464 /tmp$ Python Version: 2.4.4 (#1, Aug 18 2007, 11:05:26) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] Python Path: ['/private/tmp', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/geopy-0.93-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/UNKNOWN-0.0.0-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/configobj-4.4.0-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app-0.3.6-py2.4.egg', '/private/tmp/py2app-test.app/Contents/Resources', '/tmp/py2app-test.app/Contents/Resources', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python24.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-darwin', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac/lib-scriptpackages', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-dynload', '/tmp/py2app-test.app/Contents/Resources/lib/python2.4/site-packages.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages', '/Users/rbronosky/Library/Python/2.4/site-packages', '/private/tmp'] Traceback (most recent call last): File "/tmp/py2app-test.app/Contents/Resources/__boot__.py", line 157, in ? _run(('\x00\x00\x00\x00\x01\x16\x00\x02\x00\x00\x0cMacintosh HD\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc2\xca\xa1qH+\x00\x00\x00(\xfc\xef\x0epy2app-test.py\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00)v\x89\xc3D\xd9M\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00I \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x08\x00\x00\xc2\xca\xd9\xb1\x00\x00\x00\x11\x00\x08\x00\x00\xc3E\x11\x8d\x00\x00\x00\x0e\x00\x1e\x00\x0e\x00p\x00y\x002\x00a\x00p\x00p\x00-\x00t\x00e\x00s\x00t\x00.\x00p\x00y\x00\x0f\x00\x1a\x00\x0c\x00M\x00a\x00c\x00i\x00n\x00t\x00o\x00s\x00h\x00 \x00H\x00D\x00\x12\x00\x1aprivate/tmp/py2app-test.py\x00\x13\x00\x01/\x00\xff\xff\x00\x00', '/private/tmp/py2app-test.py')) File "/tmp/py2app-test.app/Contents/Resources/__boot__.py", line 153, in _run execfile(path, globals(), globals()) File "/private/tmp/py2app-test.py", line 7, in ? import wx ImportError: No module named wx 2007-10-24 11:23:57.724 py2app-test[14467] py2app-test Error 2007-10-24 11:23:57.725 py2app-test[14467] py2app-test Error An unexpected error has occurred during execution of the main script ImportError: No module named wx /tmp$ kill %1 [1]+ Terminated tail -n 0 -f /Library/Logs/Console/$(id -u)/console.log /tmp$ And for the sake of clarity: --- dot_py_sys_path 2007-10-24 11:51:41.000000000 -0400 +++ dot_app_sys_path 2007-10-24 11:51:57.000000000 -0400 @@ -4,7 +4,8 @@ '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/UNKNOWN-0.0.0-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/configobj-4.4.0-py2.4.egg', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/py2app-0.3.6-py2.4.egg', - '/Users/rbronosky/Code/python/site-packages', + '/private/tmp/py2app-test.app/Contents/Resources', + '/tmp/py2app-test.app/Contents/Resources', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python24.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-darwin', @@ -12,9 +13,8 @@ '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/plat-mac/lib-scriptpackages', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-tk', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/lib-dynload', + '/tmp/py2app-test.app/Contents/Resources/lib/python2.4/site-packages.zip', '/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages', - '/opt/local/lib/python2.4/site-packages', - '/opt/local/lib/python2.4/site-packages/Numeric', - '/opt/local/lib/python2.4/site-packages/PyObjC', - '/opt/local/lib/python2.4/site-packages/wx-2.8-mac-unicode' + '/Users/rbronosky/Library/Python/2.4/site-packages', + '/private/tmp' ] From Chris.Barker at noaa.gov Wed Oct 24 21:07:47 2007 From: Chris.Barker at noaa.gov (Christopher Barker) Date: Wed, 24 Oct 2007 12:07:47 -0700 Subject: [Pythonmac-SIG] How does py2app decide what to use as a sys.path? In-Reply-To: References: Message-ID: <471F9803.6000706@noaa.gov> Richard, If I were you, I'd give this all a try with the "official" Framework build you can find here: http://pythonmac.org/packages/ I'd go with 2.5 unless you have a compelling reason to stick with 2.4 -- wither should work. Also, I'd use that as your source for any other packages you may need. We've tried very hard to try to create an aura of "officiality" around those builds (they are the same as the ones you get on python.org too). The whole deal with macports, fink, build-it yourself (differently) from the tarball, etc. just creates a nightmare of support. I don't know if py2app is tested against the macports build, but I do know it's tested against these builds. macport does a better job than fink of integrating with the system, but you still kind of have a unix-within-OS-X, rather than an integrated system. Does wxPython with macports use wxMac, or is it wxGTK??? -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 BrunosJunk at Bronosky.com Wed Oct 24 22:25:03 2007 From: BrunosJunk at Bronosky.com (Richard Bronosky) Date: Wed, 24 Oct 2007 16:25:03 -0400 Subject: [Pythonmac-SIG] How does py2app decide what to use as a sys.path? In-Reply-To: <471F9803.6000706@noaa.gov> References: <471F9803.6000706@noaa.gov> Message-ID: On 10/24/07, Christopher Barker wrote: > Does wxPython with macports use wxMac, or is it wxGTK??? > > -Chris The elements look like aqua to me. They sure don't look like any gnome I've used. -- .!# RichardBronosky #!. From darran at edmstudio.com Fri Oct 26 09:01:15 2007 From: darran at edmstudio.com (Darran Edmundson) Date: Fri, 26 Oct 2007 01:01:15 -0600 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? Message-ID: <472190BB.9070505@edmstudio.com> I have a couple of Cocoa/Quicktime developers working on a small custom application. These guys are very capable at OS X programming but don't have any python experience. I, on the other hand, have a lot of python experience but virtually no Mac development experience. I could really do with some advice from someone able to see "the big picture". A bit of background ... We are working on a museum exhibit where a large 65" 1920x1080 screen attached to a Mac Pro is electronically positioned on a 4m industrial slide-track via a physical interface device. Each millimeter of track corresponds to a different image in a 4000 frame photo-jpeg-encoded Quicktime. The user tweaks the interface device, the screen moves, the image changes appropriately - that's the basic plan. I have a python program on the Mac that determines, among other things, the screen location. The OS X developers are going to write a full-screen Cocoa application that handles the display side of things (along with some tricks like: change to a new movie; tweak the opacity; add a second layer movie; etc.) The question then: how to join these two codes? Options (that I can think of, probably more worthy of discussion): 1) Get the Mac guys to write their application as a library that can be wrapped in pyObjC and invoked by my python program. In this scenario, the result is only one process/program with no network issues. 2) Add networking code to both the python and cocoa apps in order to communicate (binary socket, XML over http, Bonjour, etc.). Easy in python via Twisted, no doubt less so in cocoa. As always, any advice is much appreciated. Cheers, Darran. -- Darran Edmundson [darran at edmstudio.com] http://www.edmstudio.com From Jack.Jansen at cwi.nl Fri Oct 26 09:39:05 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri, 26 Oct 2007 09:39:05 +0200 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? In-Reply-To: <472190BB.9070505@edmstudio.com> References: <472190BB.9070505@edmstudio.com> Message-ID: <437483D8-8CDB-4959-959F-CA394F3869E0@cwi.nl> If I understand the architecture correctly I would go with option 1. And get the Mac guys to write their code in a reusable way, i.e. have them export enough low-level functionality in their API. This should be easy enough in ObjC. It'll allow tweaking from the Python side, and if you're lucky during the project they'll see the advantage of Python and all jump on the bandwagon:-) BTW: there's a potential third architecture that I can see: write a Cocoa app with a Python module embedded. This is similar to option 1, but depending on which technologies you use it may be easier to structure things with ObjC "in charge" in stead of Python. But if you also structure your Python code well it shouldn't be much of a problem to switch from design 1 to design 3 later in the development process. On 26-okt-2007, at 9:01, Darran Edmundson wrote: > > I have a couple of Cocoa/Quicktime developers working on a small > custom > application. These guys are very capable at OS X programming but > don't > have any python experience. I, on the other hand, have a lot of > python > experience but virtually no Mac development experience. I could > really > do with some advice from someone able to see "the big picture". > > A bit of background ... We are working on a museum exhibit where a > large > 65" 1920x1080 screen attached to a Mac Pro is electronically > positioned > on a 4m industrial slide-track via a physical interface device. Each > millimeter of track corresponds to a different image in a 4000 frame > photo-jpeg-encoded Quicktime. The user tweaks the interface > device, the > screen moves, the image changes appropriately - that's the basic plan. > > I have a python program on the Mac that determines, among other > things, > the screen location. The OS X developers are going to write a > full-screen Cocoa application that handles the display side of things > (along with some tricks like: change to a new movie; tweak the > opacity; > add a second layer movie; etc.) The question then: how to join these > two codes? > > Options (that I can think of, probably more worthy of discussion): > > 1) Get the Mac guys to write their application as a library that > can be > wrapped in pyObjC and invoked by my python program. In this scenario, > the result is only one process/program with no network issues. > > 2) Add networking code to both the python and cocoa apps in order to > communicate (binary socket, XML over http, Bonjour, etc.). Easy in > python via Twisted, no doubt less so in cocoa. > > As always, any advice is much appreciated. > > Cheers, > Darran. > > -- > Darran Edmundson [darran at edmstudio.com] > http://www.edmstudio.com > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From hengist.podd at virgin.net Fri Oct 26 14:53:32 2007 From: hengist.podd at virgin.net (has) Date: Fri, 26 Oct 2007 13:53:32 +0100 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? In-Reply-To: References: Message-ID: Darran Edmundson wrote: > I have a python program on the Mac that determines, among other > things, the screen location. The OS X developers are going to > write a full-screen Cocoa application [...] The question then: how > to join these two codes? > 1) Get the Mac guys to write their application as a library that > can be wrapped in pyObjC and invoked by my python program. In this > scenario, the result is only one process/program with no network > issues. > > 2) Add networking code to both the python and cocoa apps in order > to communicate (binary socket, XML over http, Bonjour, etc.). Easy > in python via Twisted, no doubt less so in cocoa. Jack's already given advice on #1 and suggested embedding Python as a third option. As for the IPC option, you're pretty well covered there too. The two high-level approaches I'd recommend investigating are: 1. Apple events using appscript/aem on the client side and OS X's Cocoa Scripting framework on the server side (although there are other options available as well). 2. Cocoa's Distributed Objects system, using PyObjC on the client side. HTH has -- http://appscript.sourceforge.net http://rb-appscript.rubyforge.org From darran at edmstudio.com Sat Oct 27 02:55:15 2007 From: darran at edmstudio.com (Darran Edmundson) Date: Fri, 26 Oct 2007 18:55:15 -0600 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? In-Reply-To: References: Message-ID: <47228C73.3000903@edmstudio.com> Jack and Has, thanks very much for the valuable advice. This weekend one of the developers is going to have a first crack at implementing option 1, namely a library that we can invoke from python. I've recommended that Douglas join this mailing list and ask questions. My only concern is that most people coming to this list are probably python users (like myself) who want to write Mac apps. Douglas is coming from the opposite tack - he's a hardcore Cocoa developer who doesn't know python at all. With this in mind, do you have any pointers in designing a library that is easily called from python? I wondered, for example, if he wrote the Objective C library and a separate Objective C test application to exercise the code, if the test app could then simply be ported to pyObjC? This way Douglas wouldn't need to worry about python at all ... As always, any advice is much appreciated. Cheers, Darran. -- Darran Edmundson [darran at edmstudio.com] http://www.edmstudio.com From bwaters at nrao.edu Sat Oct 27 03:20:56 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Fri, 26 Oct 2007 19:20:56 -0600 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> Message-ID: <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> Oops, I spoke too soon when I said that readline support with Leopard's Python works for me with IPython. Many things DO work, but tab-completion does NOT. I am trying to get tab completion working. Forget IPython, just try this "unit test" of rlcompleter with the Python that ships with Leopard: See http://docs.python.org/lib/module-rlcompleter.html Launch python from a Terminal shell prompt. at the prompt, type the following commands: import rlcompleter import readline readline.parse_and_bind("tab: complete") Now, try it out: start some input, then hit the Tab key to get some possible completions: readline. The tab is passed as raw input, and the completer does not give any completions. Tried with both Terminal and xterm. Reported as Apple Bug # 5563035 I've also asked the IPython devs for help - and volunteered to get this resolved somehow for them -- but I don't think it's an IPython problem (since you can do this from "raw" interactive python). Here's hoping... - boyd Boyd Waters Mac Programmer National Radio Astronomy Observatory http://www.aoc.nrao.edu/~bwaters On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: > Edward, > > Thanks for the information. Do you know of a way to get IPython to > use edline instead? IPython is growing in popularity for Python > programmers, and it seems like getting a way forward that works with > edline makes sense, or maybe I am wrong and people will need to just > manually install readline themselves. > > Noah > > On 10/22/07, Edward Moy wrote: > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > >> I have been getting ready for the official leopard release in a few >> days, and have been a bit worried about readline support. I forgot >> what I did to get it to work for IPython, which I absolutely cannot >> live without anymore. Is there a plan for a Leopard binary that >> fixes readline, or can I help someone prepare some documentation on >> getting readline working properly. I don't have a lot of time >> during the next couple of weeks to get into compile hell, but if >> someone has any easy fix to get readline to work, I would greatly >> appreciate it. > > > The installed version of python on Leopard will actually have > readline support turned on by default, but it uses the EditLine > (libedit) library, not the GNU Readline (due to licensing reasons). > While functionally equivalent, the command syntax is different. > From the python(1) man page: > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > The Python inteterpreter supports editing of the current > input line and > history substitution, similar to facilities found in the Korn > shell and > the GNU Bash shell. However, rather than being implemented > using the > GNU Readline library, this Python interpreter uses the > BSD EditLine > library editline(3) with a GNU Readline emulation layer. > > > The readline module provides the access to the EditLine > library, but > there are a few major differences compared to a traditional > implementa- > tion using the Readline library. The command language > used in the > preference files is that of EditLine, as described in > editrc(5) and not > that used by the Readline library. This also means > that the > parse_and_bind() routines uses EditLine commands. And the > preference > file itself is ~/.editrc instead of ~/.inputrc. > > > For example, the rlcompleter module, which defines a > completion func- > tion for the readline modules, works correctly with > the EditLine > libraries, but needs to be initialized somewhat differently: > > > import rlcompleter > import readline > readline.parse_and_bind ("bind ^I rl_complete") > > > For vi mode, one needs: > > > readline.parse_and_bind("bind -v") > > > -------------------------------------------------------------------------- > Edward Moy > Apple Computer, Inc. > emoy at apple.com > > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From noah.gift at gmail.com Sat Oct 27 03:46:52 2007 From: noah.gift at gmail.com (Noah Gift) Date: Fri, 26 Oct 2007 21:46:52 -0400 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> Message-ID: I was just going to say the same thing. Getting this to work and then GVim, and I will be quite happy. On 10/26/07, Boyd Waters wrote: > > Oops, I spoke too soon when I said that readline support with > Leopard's Python works for me with IPython. > > Many things DO work, but tab-completion does NOT. > > I am trying to get tab completion working. > > Forget IPython, just try this "unit test" of rlcompleter with the > Python that ships with Leopard: > > See http://docs.python.org/lib/module-rlcompleter.html > > Launch python from a Terminal shell prompt. > at the prompt, type the following commands: > import rlcompleter > import readline > readline.parse_and_bind("tab: complete") > > Now, try it out: start some input, then hit the Tab key to get some > possible completions: > > readline. > > The tab is passed as raw input, and the completer does not give any > completions. > > Tried with both Terminal and xterm. > > > Reported as Apple Bug # 5563035 > > I've also asked the IPython devs for help - and volunteered to get > this resolved somehow for them -- but I don't think it's an IPython > problem (since you can do this from "raw" interactive python). > > Here's hoping... > > > - boyd > > > Boyd Waters > Mac Programmer > National Radio Astronomy Observatory > http://www.aoc.nrao.edu/~bwaters > > > On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: > > > Edward, > > > > Thanks for the information. Do you know of a way to get IPython to > > use edline instead? IPython is growing in popularity for Python > > programmers, and it seems like getting a way forward that works with > > edline makes sense, or maybe I am wrong and people will need to just > > manually install readline themselves. > > > > Noah > > > > On 10/22/07, Edward Moy wrote: > > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > > > >> I have been getting ready for the official leopard release in a few > >> days, and have been a bit worried about readline support. I forgot > >> what I did to get it to work for IPython, which I absolutely cannot > >> live without anymore. Is there a plan for a Leopard binary that > >> fixes readline, or can I help someone prepare some documentation on > >> getting readline working properly. I don't have a lot of time > >> during the next couple of weeks to get into compile hell, but if > >> someone has any easy fix to get readline to work, I would greatly > >> appreciate it. > > > > > > The installed version of python on Leopard will actually have > > readline support turned on by default, but it uses the EditLine > > (libedit) library, not the GNU Readline (due to licensing reasons). > > While functionally equivalent, the command syntax is different. > > From the python(1) man page: > > > > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > > The Python inteterpreter supports editing of the current > > input line and > > history substitution, similar to facilities found in the Korn > > shell and > > the GNU Bash shell. However, rather than being implemented > > using the > > GNU Readline library, this Python interpreter uses the > > BSD EditLine > > library editline(3) with a GNU Readline emulation layer. > > > > > > The readline module provides the access to the EditLine > > library, but > > there are a few major differences compared to a traditional > > implementa- > > tion using the Readline library. The command language > > used in the > > preference files is that of EditLine, as described in > > editrc(5) and not > > that used by the Readline library. This also means > > that the > > parse_and_bind() routines uses EditLine commands. And the > > preference > > file itself is ~/.editrc instead of ~/.inputrc. > > > > > > For example, the rlcompleter module, which defines a > > completion func- > > tion for the readline modules, works correctly with > > the EditLine > > libraries, but needs to be initialized somewhat differently: > > > > > > import rlcompleter > > import readline > > readline.parse_and_bind ("bind ^I rl_complete") > > > > > > For vi mode, one needs: > > > > > > readline.parse_and_bind("bind -v") > > > > > > > -------------------------------------------------------------------------- > > Edward Moy > > Apple Computer, Inc. > > emoy at apple.com > > > > > > > > > > _______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071026/a88059b2/attachment.htm From emoy at apple.com Sat Oct 27 03:50:32 2007 From: emoy at apple.com (emoy at apple.com) Date: Fri, 26 Oct 2007 18:50:32 -0700 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> Message-ID: <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> It right there in my original message (and in the python man page). You have to use EditLine syntax: readline.parse_and_bind ("bind ^I rl_complete") Ed On Oct 26, 2007, at 6:46 PM, Noah Gift wrote: > I was just going to say the same thing. Getting this to work and > then GVim, and I will be quite happy. > > On 10/26/07, Boyd Waters < bwaters at nrao.edu> wrote: > Oops, I spoke too soon when I said that readline support with > Leopard's Python works for me with IPython. > > Many things DO work, but tab-completion does NOT. > > I am trying to get tab completion working. > > Forget IPython, just try this "unit test" of rlcompleter with the > Python that ships with Leopard: > > See http://docs.python.org/lib/module-rlcompleter.html > > Launch python from a Terminal shell prompt. > at the prompt, type the following commands: > import rlcompleter > import readline > readline.parse_and_bind("tab: complete") > > Now, try it out: start some input, then hit the Tab key to get some > possible completions: > > readline. > > The tab is passed as raw input, and the completer does not give any > completions. > > Tried with both Terminal and xterm. > > > Reported as Apple Bug # 5563035 > > I've also asked the IPython devs for help - and volunteered to get > this resolved somehow for them -- but I don't think it's an IPython > problem (since you can do this from "raw" interactive python). > > Here's hoping... > > > - boyd > > > Boyd Waters > Mac Programmer > National Radio Astronomy Observatory > http://www.aoc.nrao.edu/~bwaters > > > On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: > > > Edward, > > > > Thanks for the information. Do you know of a way to get IPython to > > use edline instead? IPython is growing in popularity for Python > > programmers, and it seems like getting a way forward that works with > > edline makes sense, or maybe I am wrong and people will need to just > > manually install readline themselves. > > > > Noah > > > > On 10/22/07, Edward Moy < emoy at apple.com> wrote: > > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > > > >> I have been getting ready for the official leopard release in a few > >> days, and have been a bit worried about readline support. I forgot > >> what I did to get it to work for IPython, which I absolutely cannot > >> live without anymore. Is there a plan for a Leopard binary that > >> fixes readline, or can I help someone prepare some documentation on > >> getting readline working properly. I don't have a lot of time > >> during the next couple of weeks to get into compile hell, but if > >> someone has any easy fix to get readline to work, I would greatly > >> appreciate it. > > > > > > The installed version of python on Leopard will actually have > > readline support turned on by default, but it uses the EditLine > > (libedit) library, not the GNU Readline (due to licensing reasons). > > While functionally equivalent, the command syntax is different. > > From the python(1) man page: > > > > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > > The Python inteterpreter supports editing of the current > > input line and > > history substitution, similar to facilities found in the Korn > > shell and > > the GNU Bash shell. However, rather than being implemented > > using the > > GNU Readline library, this Python interpreter uses the > > BSD EditLine > > library editline(3) with a GNU Readline emulation layer. > > > > > > The readline module provides the access to the EditLine > > library, but > > there are a few major differences compared to a traditional > > implementa- > > tion using the Readline library. The command language > > used in the > > preference files is that of EditLine, as described in > > editrc(5) and not > > that used by the Readline library. This also means > > that the > > parse_and_bind() routines uses EditLine commands. And the > > preference > > file itself is ~/.editrc instead of ~/.inputrc. > > > > > > For example, the rlcompleter module, which defines a > > completion func- > > tion for the readline modules, works correctly with > > the EditLine > > libraries, but needs to be initialized somewhat differently: > > > > > > import rlcompleter > > import readline > > readline.parse_and_bind ("bind ^I rl_complete") > > > > > > For vi mode, one needs: > > > > > > readline.parse_and_bind ("bind -v") > > > > > > > -------------------------------------------------------------------------- > > Edward Moy > > Apple Computer, Inc. > > emoy at apple.com > > > > > > > > > > _______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071026/edc550f3/attachment-0001.htm From noah.gift at gmail.com Sat Oct 27 04:01:05 2007 From: noah.gift at gmail.com (Noah Gift) Date: Fri, 26 Oct 2007 22:01:05 -0400 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> Message-ID: Ed, You are a genius! Thanks, I totally forgot you told me that. So for the record when you launch IPython: import readline readline.parse_and_bind ("bind ^I rl_complete") Then do something like: import os and you will get In [5]: os. Display all 234 possibilities? (y or n) Ok, what is the easiest way to get IPython to automatically do this? This would be great to document. Also, (shamelessly off-topic), if anyone has GVim working...let me know, cough, it is for Python and it is on Mac :) On 10/26/07, emoy at apple.com wrote: > > It right there in my original message (and in the python man page). You > have to use EditLine syntax: > > readline.parse_and_bind ("bind ^I rl_complete") > > > Ed > > On Oct 26, 2007, at 6:46 PM, Noah Gift wrote: > > I was just going to say the same thing. Getting this to work and then > GVim, and I will be quite happy. > > On 10/26/07, Boyd Waters < bwaters at nrao.edu> wrote: > > > > Oops, I spoke too soon when I said that readline support with > > Leopard's Python works for me with IPython. > > > > Many things DO work, but tab-completion does NOT. > > > > I am trying to get tab completion working. > > > > Forget IPython, just try this "unit test" of rlcompleter with the > > Python that ships with Leopard: > > > > See http://docs.python.org/lib/module-rlcompleter.html > > > > Launch python from a Terminal shell prompt. > > at the prompt, type the following commands: > > import rlcompleter > > import readline > > readline.parse_and_bind("tab: complete") > > > > Now, try it out: start some input, then hit the Tab key to get some > > possible completions: > > > > readline. > > > > The tab is passed as raw input, and the completer does not give any > > completions. > > > > Tried with both Terminal and xterm. > > > > > > Reported as Apple Bug # 5563035 > > > > I've also asked the IPython devs for help - and volunteered to get > > this resolved somehow for them -- but I don't think it's an IPython > > problem (since you can do this from "raw" interactive python). > > > > Here's hoping... > > > > > > - boyd > > > > > > Boyd Waters > > Mac Programmer > > National Radio Astronomy Observatory > > http://www.aoc.nrao.edu/~bwaters > > > > > > On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: > > > > > Edward, > > > > > > Thanks for the information. Do you know of a way to get IPython to > > > use edline instead? IPython is growing in popularity for Python > > > programmers, and it seems like getting a way forward that works with > > > edline makes sense, or maybe I am wrong and people will need to just > > > manually install readline themselves. > > > > > > Noah > > > > > > On 10/22/07, Edward Moy < emoy at apple.com> wrote: > > > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > > > > > >> I have been getting ready for the official leopard release in a few > > >> days, and have been a bit worried about readline support. I forgot > > >> what I did to get it to work for IPython, which I absolutely cannot > > >> live without anymore. Is there a plan for a Leopard binary that > > >> fixes readline, or can I help someone prepare some documentation on > > >> getting readline working properly. I don't have a lot of time > > >> during the next couple of weeks to get into compile hell, but if > > >> someone has any easy fix to get readline to work, I would greatly > > >> appreciate it. > > > > > > > > > The installed version of python on Leopard will actually have > > > readline support turned on by default, but it uses the EditLine > > > (libedit) library, not the GNU Readline (due to licensing reasons). > > > While functionally equivalent, the command syntax is different. > > > From the python(1) man page: > > > > > > > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > > > The Python inteterpreter supports editing of the current > > > input line and > > > history substitution, similar to facilities found in the Korn > > > shell and > > > the GNU Bash shell. However, rather than being implemented > > > using the > > > GNU Readline library, this Python interpreter uses the > > > BSD EditLine > > > library editline(3) with a GNU Readline emulation layer. > > > > > > > > > The readline module provides the access to the EditLine > > > library, but > > > there are a few major differences compared to a traditional > > > implementa- > > > tion using the Readline library. The command language > > > used in the > > > preference files is that of EditLine, as described in > > > editrc(5) and not > > > that used by the Readline library. This also means > > > that the > > > parse_and_bind() routines uses EditLine commands. And the > > > preference > > > file itself is ~/.editrc instead of ~/.inputrc. > > > > > > > > > For example, the rlcompleter module, which defines a > > > completion func- > > > tion for the readline modules, works correctly with > > > the EditLine > > > libraries, but needs to be initialized somewhat differently: > > > > > > > > > import rlcompleter > > > import readline > > > readline.parse_and_bind ("bind ^I rl_complete") > > > > > > > > > For vi mode, one needs: > > > > > > > > > readline.parse_and_bind ("bind -v") > > > > > > > > > > > -------------------------------------------------------------------------- > > > Edward Moy > > > Apple Computer, Inc. > > > emoy at apple.com > > > > > > > > > > > > > > > _______________________________________________ > > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071026/0d388a23/attachment.htm From ellisonbg.net at gmail.com Sat Oct 27 04:19:50 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Fri, 26 Oct 2007 20:19:50 -0600 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> Message-ID: <6ce0ac130710261919ga748fc1v135522c38e2c8dc4@mail.gmail.com> The rlineimpl.py module is the place in python where readline gets imported. I would look there and also I would look to see where ipython is doing its equivalent of parse_and_bind. Brian On 10/26/07, Noah Gift wrote: > Ed, > > You are a genius! Thanks, I totally forgot you told me that. > > So for the record when you launch IPython: > > import readline > readline.parse_and_bind ("bind ^I rl_complete") > > Then do something like: > > import os > > and you will get > > > In [5]: os. > Display all 234 possibilities? (y or n) > > Ok, what is the easiest way to get IPython to automatically do this? This > would be great to document. > > > Also, (shamelessly off-topic), if anyone has GVim working...let me know, > cough, it is for Python and it is on Mac :) > > > On 10/26/07, emoy at apple.com wrote: > > > > It right there in my original message (and in the python man page). You > have to use EditLine syntax: > > > > > > readline.parse_and_bind ("bind ^I rl_complete") > > > > > > Ed > > > > > > > > > > On Oct 26, 2007, at 6:46 PM, Noah Gift wrote: > > > > I was just going to say the same thing. Getting this to work and then > GVim, and I will be quite happy. > > > > > > On 10/26/07, Boyd Waters < bwaters at nrao.edu > wrote: > > > Oops, I spoke too soon when I said that readline support with > > > Leopard's Python works for me with IPython. > > > > > > Many things DO work, but tab-completion does NOT. > > > > > > I am trying to get tab completion working. > > > > > > Forget IPython, just try this "unit test" of rlcompleter with the > > > Python that ships with Leopard: > > > > > > See http://docs.python.org/lib/module-rlcompleter.html > > > > > > Launch python from a Terminal shell prompt. > > > at the prompt, type the following commands: > > > import rlcompleter > > > import readline > > > readline.parse_and_bind("tab: complete") > > > > > > Now, try it out: start some input, then hit the Tab key to get some > > > possible completions: > > > > > > readline. > > > > > > The tab is passed as raw input, and the completer does not give any > > > completions. > > > > > > Tried with both Terminal and xterm. > > > > > > > > > Reported as Apple Bug # 5563035 > > > > > > I've also asked the IPython devs for help - and volunteered to get > > > this resolved somehow for them -- but I don't think it's an IPython > > > problem (since you can do this from "raw" interactive python). > > > > > > Here's hoping... > > > > > > > > > - boyd > > > > > > > > > Boyd Waters > > > Mac Programmer > > > National Radio Astronomy Observatory > > > http://www.aoc.nrao.edu/~bwaters > > > > > > > > > On Oct 22, 2007, at 12:35 PM, Noah Gift wrote: > > > > > > > Edward, > > > > > > > > Thanks for the information. Do you know of a way to get IPython to > > > > use edline instead? IPython is growing in popularity for Python > > > > programmers, and it seems like getting a way forward that works with > > > > edline makes sense, or maybe I am wrong and people will need to just > > > > manually install readline themselves. > > > > > > > > Noah > > > > > > > > On 10/22/07, Edward Moy < emoy at apple.com> wrote: > > > > On Oct 21, 2007, at 10:51 PM, Noah Gift wrote: > > > > > > > >> I have been getting ready for the official leopard release in a few > > > >> days, and have been a bit worried about readline support. I forgot > > > >> what I did to get it to work for IPython, which I absolutely cannot > > > >> live without anymore. Is there a plan for a Leopard binary that > > > >> fixes readline, or can I help someone prepare some documentation on > > > >> getting readline working properly. I don't have a lot of time > > > >> during the next couple of weeks to get into compile hell, but if > > > >> someone has any easy fix to get readline to work, I would greatly > > > >> appreciate it. > > > > > > > > > > > > The installed version of python on Leopard will actually have > > > > readline support turned on by default, but it uses the EditLine > > > > (libedit) library, not the GNU Readline (due to licensing reasons). > > > > While functionally equivalent, the command syntax is different. > > > > From the python(1) man page: > > > > > > > > > > > > INTERACTIVE INPUT EDITING AND HISTORY SUBSTITUTION > > > > The Python inteterpreter supports editing of the current > > > > input line and > > > > history substitution, similar to facilities found in the Korn > > > > shell and > > > > the GNU Bash shell. However, rather than being implemented > > > > using the > > > > GNU Readline library, this Python interpreter uses the > > > > BSD EditLine > > > > library editline(3) with a GNU Readline emulation layer. > > > > > > > > > > > > The readline module provides the access to > the EditLine > > > > library, but > > > > there are a few major differences compared to a traditional > > > > implementa- > > > > tion using the Readline library. The > command language > > > > used in the > > > > preference files is that of EditLine, as described in > > > > editrc(5) and not > > > > that used by the Readline library. > This also means > > > > that the > > > > parse_and_bind() routines uses EditLine commands. And the > > > > preference > > > > file itself is ~/.editrc instead of ~/.inputrc. > > > > > > > > > > > > For example, the rlcompleter module, which defines a > > > > completion func- > > > > tion for the readline modules, works > correctly with > > > > the EditLine > > > > libraries, but needs to be initialized somewhat differently: > > > > > > > > > > > > import rlcompleter > > > > import readline > > > > readline.parse_and_bind ("bind ^I rl_complete") > > > > > > > > > > > > For vi mode, one needs: > > > > > > > > > > > > readline.parse_and_bind ("bind -v") > > > > > > > > > > > > > -------------------------------------------------------------------------- > > > > Edward Moy > > > > Apple Computer, Inc. > > > > emoy at apple.com > > > > > > > > > > > > > > > > > > > > _______________________________________________ > > > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > > > > > > > > > > > > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > From bwaters at nrao.edu Sat Oct 27 06:08:46 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Fri, 26 Oct 2007 22:08:46 -0600 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> Message-ID: On Oct 26, 2007, at 7:50 PM, emoy at apple.com wrote: > It right there in my original message > You have to use EditLine syntax: > > readline.parse_and_bind ("bind ^I rl_complete") Oh good grief... I'm a *user*. You can't expect me to *read*... um.. what is the smiley-thing for hanging my head in shame? Very happy to have this sorted out! Leopard is great, folks! Stay tuned for a patch! something like if 'darwin' in os.platform: - boyd From delza at livingcode.org Sat Oct 27 08:18:05 2007 From: delza at livingcode.org (Dethe Elza) Date: Fri, 26 Oct 2007 23:18:05 -0700 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? In-Reply-To: <47228C73.3000903@edmstudio.com> References: <47228C73.3000903@edmstudio.com> Message-ID: <24d517dd0710262318q6891dd2fh76330a81ac7dcd09@mail.gmail.com> If you write an Objective-C framework, the python code to wrap it using PyObjC is very short. Here is an example I use to expose Tim Omernick's CocoaSequenceGrabber framework to capture images from the iSight camera: import objc, AppKit, Foundation, os if 'site-packages.zip' in __file__: base_path = os.path.join(os.path.dirname(os.getcwd()), 'Frameworks') else: base_path = '/Library/Frameworks' bundle_path = os.path.abspath(os.path.join(base_path, 'CocoaSequenceGrabber.fram ework')) objc.loadBundle('CocoaSequenceGrabber', globals(), bundle_path=bundle_path) del objc, AppKit, Foundation, os, base_path, bundle_path I have that saved as PySight/__init__.py so I can import * from PySight to get all the objects and methods from the framework. It would be shorter, but I have some path manipulation so that it works from the command line and from within an application bundle built with py2app. The bare minimum you need is: import objc objc.loadBundle('MyBundle', globals(), bundle_path='/my/bundle/path/MyBundle.framework') Writing a bundle in Python that can be imported by an Objective-C application is similarly easy. I have some blog posts on that topic if you ever decide to try that direction. The application just needs to take Objective-C bundles as plugins, it does not have to plan for, or even know about, Python in the bundle implementation. HTH --Dethe From bwaters at nrao.edu Sat Oct 27 19:43:10 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Sat, 27 Oct 2007 11:43:10 -0600 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: <46cb515a0710270137v4a7c951fq9c7267d81e70b24e@mail.gmail.com> References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> <46cb515a0710270137v4a7c951fq9c7267d81e70b24e@mail.gmail.com> Message-ID: <1B03D89D-BC1E-472E-AB43-89F86735BAF0@nrao.edu> OK, thanks... I'll try to put something in ipy_defaults.py I'm trying to come up to speed on the new style configuration. I'll try looking through Trac for more info as well. On Oct 27, 2007, at 2:37 AM, Ville M. Vainio wrote: > I suggest you put it in ipy_defaults.py, and we'll advise leopard > users to ignore the ipythonrc and move to the new style configuration > (ipy_user_conf.py). From riccardo.tediosi at ieee.org Sat Oct 27 20:56:55 2007 From: riccardo.tediosi at ieee.org (Riccardo Tediosi) Date: Sat, 27 Oct 2007 20:56:55 +0200 Subject: [Pythonmac-SIG] Welcome Leopard Message-ID: <558622E3-26F6-446B-84E6-DE5A83529246@ieee.org> Dear Memebers, Leopard is arrived and on my Mac everything is working really great. Now a question. I'm using python for my scientific research and I really need it. In particular I use pylab and scipy for their modules and for the graphical output. Now on Tiger the python version was older (2.4) than the one provided with MacPython 2.5 but on Leopard there is already the 2.5.1 version. For this reason I tried to install matlotlib without installing MacPython. Unfortunately while I was installing the packages required for matplotlib.dmg package (dateutils etc...) the installation stopped because it was impossible to find system version Python 2.5... what is wrong!? Do you think I should install anyway also MacPython before going on with dateutils and matplotlib!? I'm just trying to install the less software possible and since ver. 2.5.1. was aready there would be nice to use it and not to put an extra version. Any ideas!??! Best wishes. Rik From vivainio at gmail.com Sat Oct 27 10:37:24 2007 From: vivainio at gmail.com (Ville M. Vainio) Date: Sat, 27 Oct 2007 11:37:24 +0300 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> Message-ID: <46cb515a0710270137v4a7c951fq9c7267d81e70b24e@mail.gmail.com> On 10/27/07, Boyd Waters wrote: > Stay tuned for a patch! > > something like > if 'darwin' in os.platform: Where do you plan to put this? Configuring readline is done in config files (ipythonrc), which don't really allow conditional actions. I suggest you put it in ipy_defaults.py, and we'll advise leopard users to ignore the ipythonrc and move to the new style configuration (ipy_user_conf.py). -- Ville M. Vainio - vivainio.googlepages.com blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio' From fperez.net at gmail.com Sat Oct 27 20:25:11 2007 From: fperez.net at gmail.com (Fernando Perez) Date: Sat, 27 Oct 2007 12:25:11 -0600 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: <1B03D89D-BC1E-472E-AB43-89F86735BAF0@nrao.edu> References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> <46cb515a0710270137v4a7c951fq9c7267d81e70b24e@mail.gmail.com> <1B03D89D-BC1E-472E-AB43-89F86735BAF0@nrao.edu> Message-ID: On 10/27/07, Boyd Waters wrote: > OK, thanks... I'll try to put something in ipy_defaults.py > > I'm trying to come up to speed on the new style configuration. I'll > try looking through Trac for more info as well. Honestly, this is so important that I'd rather have it in the core so it works for any user, without bugging them about updating their config setup or having to think at all. If they have requested readline support, then it should just work. We already have platform-specific code to work around a things in Windows, having a little bit of Leopard support doesn't bother me one bit. Have a look at the attached patch, and if something like that works well, we can easily just drop it in. Cheers, f -------------- next part -------------- A non-text attachment was scrubbed... Name: ip_leopard.diff Type: text/x-patch Size: 875 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20071027/93598494/attachment.bin From bwaters at nrao.edu Sat Oct 27 22:47:45 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Sat, 27 Oct 2007 14:47:45 -0600 Subject: [Pythonmac-SIG] Welcome Leopard In-Reply-To: <558622E3-26F6-446B-84E6-DE5A83529246@ieee.org> References: <558622E3-26F6-446B-84E6-DE5A83529246@ieee.org> Message-ID: <8256CB9E-2364-4CDD-A7E4-A58EAADBDC75@nrao.edu> If you can hold out for a few more days, I'm working on MatPlotLib integration with Leopard's Python 2.5.1 We use it for our data analysis software; one of my jobs is maintaining our Mac Intel implementation. I had had a pre-release of Leopard for quite some time, but alas we shipped an important internal milestone for our software just two weeks ago. It's been non-stop for me, and I haven't made much time to really look carefully at Python/MatPlotLib/SciPy and Leopard. But I've been working on it for about a week now. I could make an installer package of the matplotlib bits that will work with Leopard Python. I expect next Wednesday for matplotlib. Unless someone beats me to it. Anyone? - boyd Boyd Waters National Radio Astronomy Observatory http://www.aoc.nrao.edu/~bwaters On Oct 27, 2007, at 12:56 PM, Riccardo Tediosi wrote: > Dear Memebers, > > Leopard is arrived and on my Mac everything is working really great. > Now a question. I'm using python for my scientific research and I > really need it. In particular I use pylab and scipy for their modules > and for the graphical output. > > Now on Tiger the python version was older (2.4) than the one provided > with MacPython 2.5 but on Leopard there is already the 2.5.1 version. > For this reason I tried to install matlotlib without installing > MacPython. Unfortunately while I was installing the packages required > for matplotlib.dmg package (dateutils etc...) the installation stopped > because it was impossible to find system version Python 2.5... what is > wrong!? > > Do you think I should install anyway also MacPython before going on > with dateutils and matplotlib!? > > I'm just trying to install the less software possible and since ver. > 2.5.1. was aready there would be nice to use it and not to put an > extra version. > > Any ideas!??! > > Best wishes. Rik > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From Jack.Jansen at cwi.nl Sat Oct 27 23:27:09 2007 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat, 27 Oct 2007 23:27:09 +0200 Subject: [Pythonmac-SIG] Python control/integration of a Cocoa/Quicktime application? In-Reply-To: <47228C73.3000903@edmstudio.com> References: <47228C73.3000903@edmstudio.com> Message-ID: On 27-Oct-2007, at 02:55 , Darran Edmundson wrote: > I've recommended that Douglas join this mailing list and ask > questions. > My only concern is that most people coming to this list are probably > python users (like myself) who want to write Mac apps. Douglas is > coming from the opposite tack - he's a hardcore Cocoa developer who > doesn't know python at all. With this in mind, do you have any > pointers > in designing a library that is easily called from python? There are some things you can do in ObjC that are difficult to expose to Python, but as they're so unusual I've never come across them I've also conveniently forgotten what they are:-) Oh yes, I think if you pass a C structure you have to do some massaging (excpe tif PyObjC already knows about that structure, such as for NSPoint and such, then the work has already been done for you). > I wondered, for example, if he wrote the Objective C library and a > separate Objective C test application to exercise the code, if the > test > app could then simply be ported to pyObjC? This way Douglas wouldn't > need to worry about python at all ... If you do this very early during development, i.e. when the library API has only a couple of calls you have the ObjC programmer write a minimal test script which you then port to Python, you could give this back to the ObjC developer. There's a very good chance this'll teach them enough Python to continue the testing directly in Python. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071027/1652b23b/attachment.htm From m.vanland at gmail.com Mon Oct 29 22:44:22 2007 From: m.vanland at gmail.com (Michael Vanlandingham) Date: Mon, 29 Oct 2007 14:44:22 -0700 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> <46cb515a0710270137v4a7c951fq9c7267d81e70b24e@mail.gmail.com> <1B03D89D-BC1E-472E-AB43-89F86735BAF0@nrao.edu> Message-ID: <0005A287-B10B-4F28-8F91-B6B23796BA90@gmail.com> FWIW, this patch works for me. I'm on IPython 0.8.2.svn.r2841. This was driving me nuts for some time -- after all, the _Ruby_ shell (irb) had tab-completion in Leopard, so why shouldn't Python/ iPython? I hadn't found the time to figure out a solution, so hooray for user communities. I say commit the change. Thanks -- you guys made my day! Michael On Oct 27, 2007, at 11:25 AM, Fernando Perez wrote: > On 10/27/07, Boyd Waters wrote: >> OK, thanks... I'll try to put something in ipy_defaults.py >> >> I'm trying to come up to speed on the new style configuration. I'll >> try looking through Trac for more info as well. > > Honestly, this is so important that I'd rather have it in the core so > it works for any user, without bugging them about updating their > config setup or having to think at all. If they have requested > readline support, then it should just work. We already have > platform-specific code to work around a things in Windows, having a > little bit of Leopard support doesn't bother me one bit. > > Have a look at the attached patch, and if something like that works > well, we can easily just drop it in. > > Cheers, > > f > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From alessandro_censoni at hotmail.it Tue Oct 30 16:40:15 2007 From: alessandro_censoni at hotmail.it (Alessandro Censoni) Date: Tue, 30 Oct 2007 16:40:15 +0100 Subject: [Pythonmac-SIG] Error installing mysql-python 1.2.2 on mac os x 10.4.9 Message-ID: Hi all, I trie to install mysql-python 1.2.2 but I have a lot of errors. I have install MySQL 5.0.45 and python 2.5.1. I use Mac OS X 10.4.9 and when I trie to build mysqldb i have the following and famous error: >sh: line 1: mysql_config: command not found >Traceback (most recent call last): >File "setup.py", line 16, in >metadata, options = get_config() >File "/Users/alessandrocensoni/Desktop/MySQL-python-1.2.2/setup_posix.py", line 43, in get_config >libs = mysql_config("libs_r") >File "/Users/alessandrocensoni/Desktop/MySQL-python-1.2.2/setup_posix.py", >line 24, in mysql_config >raise EnvironmentError, "%s not found" % mysql_config.path >EnvironmentError: mysql_config not found I trie to install the mysqldb but I have however errors. I don't know where I have to do the change suggested in various sites and posts relative to: return popen(?mysql_config --%s? % what) (1) to return popen(?/usr/local/mysql/bin/mysql_config --%s? % what) (2) In the python.py of the mysql-python-1.2.2 there isn't a line like (1). While, in the file site.cfg I don't know what I have to change like someone suggest to eliminate the problem of the installation. I also trie to install mysql-python-1.2.1_p2 and edit the setup.py by changing the line how suggest previously but I have the following error: >File "setup.py", line 26 > f = popen(?/usr/local/mysql/bin/mysql_config --%s? % what) > ^ >SyntaxError: invalid syntax Can someone help me please? Thanks a lot Alex _________________________________________________________________ Scarica GRATIS 30 emoticon per Messenger! http://www.emoticons-livemessenger.com/pages/msnit/index.htm -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071030/eadc3052/attachment.htm From lyndsey.ferguson at gmail.com Tue Oct 30 16:57:14 2007 From: lyndsey.ferguson at gmail.com (Lyndsey Ferguson) Date: Tue, 30 Oct 2007 11:57:14 -0400 Subject: [Pythonmac-SIG] Error installing mysql-python 1.2.2 on mac os x 10.4.9 In-Reply-To: References: Message-ID: On Oct 30, 2007, at 11:40 AM, Alessandro Censoni wrote: > return popen(?mysql_config --%s? % what) (1) > to > return popen(?/usr/local/mysql/bin/mysql_config --%s? % what) (2) > > > In the python.py of the mysql-python-1.2.2 there isn't a line like > (1). While, in the file site.cfg I don't know what I have to change > like someone suggest to eliminate the problem of the installation. > Can someone help me please? > I had many issues trying to do this. Here is what I did: Edit the file site.cfg so that the mysql_config path refers to /usr/ local/mysql/bin/mysql_config In the terminal, type cd path/to/MySQL-Python then python setup.py build followed by sudo python setup.py install. In the terminal, type ln -s /usr/local/mysql/lib /usr/local/mysql/lib/ mysql. Confirm installation by typing in the Python environment, import MySQLdb. I hope this helps, Lyndsey From luc at honk-honk.com Tue Oct 30 17:02:38 2007 From: luc at honk-honk.com (Luc Heinrich) Date: Tue, 30 Oct 2007 17:02:38 +0100 Subject: [Pythonmac-SIG] Default Leopard Python and bsddb Message-ID: <1B2D5676-B6C3-49A4-B9F9-5E711412FD05@honk-honk.com> Grettings, Anybody knows how to make the bsddb module of the default Leopard's Python work ? Right now, all I get is this: >>> import bsddb.db Traceback (most recent call last): File "", line 1, in File "/System/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/bsddb/__init__.py", line 51, in import _bsddb ImportError: No module named _bsddb (sigh...) Thanks for any help. -- Luc Heinrich From lyndsey.ferguson at gmail.com Tue Oct 30 18:36:17 2007 From: lyndsey.ferguson at gmail.com (Lyndsey Ferguson) Date: Tue, 30 Oct 2007 13:36:17 -0400 Subject: [Pythonmac-SIG] Error installing mysql-python 1.2.2 on mac os x 10.4.9 In-Reply-To: References: Message-ID: <63801C79-C11F-4947-9B00-B4F0119EE5B4@gmail.com> Hi Alex, I'm responding to your question on the list so that everyone can benefit from our experiences: On Oct 30, 2007, at 1:29 PM, Alessandro Censoni wrote: > >ImportError: dlopen(/Users/alessandrocensoni/.python-eggs/ > MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg-tmp/_mysql.so, 2): > Library not loaded: >/usr/local/mysql/lib/mysql/libmysqlclient_r. > 15.dylib > >Referenced from: /Users/alessandrocensoni/.python-eggs/ > MySQL_python-1.2.2-py2.5-macosx-10.3-fat.egg-tmp/_mysql.so > >Reason: image not found > > And I don't know what to do!!!Now I'm looking for other people who > had the same problem.I don't know you had it. The problem is that the build system is trying to build a Universal Binary version of the library and you need to install the Universal Binary version of MySQL along with the libraries: The line: "/Users/alessandrocensoni/.python-eggs/MySQL_python-1.2.2-py2.5- macosx-10.3-fat.egg-tmp/_mysql.so, 2): Library not loaded: >/usr/local/ mysql/lib/mysql/libmysqlclient_r.15.dylib" Is a hint, if you go to that directory, you'll see that running the command line tool "lipo" will tell you that the library libmysqlclient_r.15.dylib is not Universal. You need to get the Universal Binary version of the MySQL library from the www.mysql.org website. Get the UB version and install it -- removing the old version of MySQL. Sorry I neglected to mention that, there are quite a few steps involved, it really is a pain in the butt. Good luck! Lyndsey -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071030/3f978859/attachment.htm From ellisonbg.net at gmail.com Tue Oct 30 22:43:00 2007 From: ellisonbg.net at gmail.com (Brian Granger) Date: Tue, 30 Oct 2007 15:43:00 -0600 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: <0005A287-B10B-4F28-8F91-B6B23796BA90@gmail.com> References: <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> <46cb515a0710270137v4a7c951fq9c7267d81e70b24e@mail.gmail.com> <1B03D89D-BC1E-472E-AB43-89F86735BAF0@nrao.edu> <0005A287-B10B-4F28-8F91-B6B23796BA90@gmail.com> Message-ID: <6ce0ac130710301443y10f6ae09n5112768d55097f49@mail.gmail.com> I am afraid that this patch won't cut it. It does a simple test of the os type. The problem is that someone could install a version of python on OS X and want to use the other readline library (for example the OS X python binaries from the python.org website ship with this readline). Somehow, we need to do a test of exactly what readline is installed as well as an os test. But, I won't have Leopard running on my system for a few more weeks so I can't help with this. Can anyone play around to see if it is possible to detect which readline is installed? Thanks, Brian On 10/29/07, Michael Vanlandingham wrote: > FWIW, this patch works for me. I'm on IPython 0.8.2.svn.r2841. > > This was driving me nuts for some time -- after all, the _Ruby_ shell > (irb) had tab-completion in Leopard, so why shouldn't Python/ > iPython? I hadn't found the time to figure out a solution, so hooray > for user communities. I say commit the change. > > Thanks -- you guys made my day! > Michael > > > On Oct 27, 2007, at 11:25 AM, Fernando Perez wrote: > > > On 10/27/07, Boyd Waters wrote: > >> OK, thanks... I'll try to put something in ipy_defaults.py > >> > >> I'm trying to come up to speed on the new style configuration. I'll > >> try looking through Trac for more info as well. > > > > Honestly, this is so important that I'd rather have it in the core so > > it works for any user, without bugging them about updating their > > config setup or having to think at all. If they have requested > > readline support, then it should just work. We already have > > platform-specific code to work around a things in Windows, having a > > little bit of Leopard support doesn't bother me one bit. > > > > Have a look at the attached patch, and if something like that works > > well, we can easily just drop it in. > > > > Cheers, > > > > f > > _______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG at python.org > > http://mail.python.org/mailman/listinfo/pythonmac-sig > > _______________________________________________ > IPython-dev mailing list > IPython-dev at scipy.org > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev > From m.vanland at gmail.com Tue Oct 30 23:34:12 2007 From: m.vanland at gmail.com (Michael VanLandingham) Date: Tue, 30 Oct 2007 15:34:12 -0700 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: <6ce0ac130710301443y10f6ae09n5112768d55097f49@mail.gmail.com> References: <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> <46cb515a0710270137v4a7c951fq9c7267d81e70b24e@mail.gmail.com> <1B03D89D-BC1E-472E-AB43-89F86735BAF0@nrao.edu> <0005A287-B10B-4F28-8F91-B6B23796BA90@gmail.com> <6ce0ac130710301443y10f6ae09n5112768d55097f49@mail.gmail.com> Message-ID: Well one way to do this, although perhaps crude, would be to check to see if the libreadline is really a link to editline, since on a default Leopard install, it is: [mvl ~]$ ls -l /usr/lib/libreadline.dylib lrwxr-xr-x 1 root wheel 15 Oct 17 15:59 /usr/lib/libreadline.dylib@ -> libedit.2.dylib I suppose one could also check for a "real" readline in "/usr/local", in case someone installed it. -mvl On Oct 30, 2007, at 2:43 PM, Brian Granger wrote: > I am afraid that this patch won't cut it. It does a simple test of > the os type. The problem is that someone could install a version of > python on OS X and want to use the other readline library (for example > the OS X python binaries from the python.org website ship with this > readline). Somehow, we need to do a test of exactly what readline is > installed as well as an os test. But, I won't have Leopard running on > my system for a few more weeks so I can't help with this. > > Can anyone play around to see if it is possible to detect which > readline is installed? > > Thanks, > > Brian > > On 10/29/07, Michael Vanlandingham wrote: >> FWIW, this patch works for me. I'm on IPython 0.8.2.svn.r2841. >> >> This was driving me nuts for some time -- after all, the _Ruby_ shell >> (irb) had tab-completion in Leopard, so why shouldn't Python/ >> iPython? I hadn't found the time to figure out a solution, so >> hooray >> for user communities. I say commit the change. >> >> Thanks -- you guys made my day! >> Michael >> >> >> On Oct 27, 2007, at 11:25 AM, Fernando Perez wrote: >> >>> On 10/27/07, Boyd Waters wrote: >>>> OK, thanks... I'll try to put something in ipy_defaults.py >>>> >>>> I'm trying to come up to speed on the new style configuration. I'll >>>> try looking through Trac for more info as well. >>> >>> Honestly, this is so important that I'd rather have it in the core >>> so >>> it works for any user, without bugging them about updating their >>> config setup or having to think at all. If they have requested >>> readline support, then it should just work. We already have >>> platform-specific code to work around a things in Windows, having a >>> little bit of Leopard support doesn't bother me one bit. >>> >>> Have a look at the attached patch, and if something like that works >>> well, we can easily just drop it in. >>> >>> Cheers, >>> >>> f >>> _______________________________________________ >>> Pythonmac-SIG maillist - Pythonmac-SIG at python.org >>> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev >> -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20071030/824ff494/attachment-0001.htm From bwaters at nrao.edu Wed Oct 31 00:12:33 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Tue, 30 Oct 2007 17:12:33 -0600 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: <200710302341.59304.hans_meine@gmx.net> References: <6ce0ac130710301443y10f6ae09n5112768d55097f49@mail.gmail.com> <200710302341.59304.hans_meine@gmx.net> Message-ID: On Oct 30, 2007, at 4:41 PM, Hans Meine wrote: > What about multiple pythons/readlines? I happend to look over the > shoulder of > an OS X user yesterday, who had three versions of python installed > on his > system. (I would not suggest that this is a good idea, but AFAICS > it happens > all too easy..) Ouch! I represent that remark! OK, I've got my Leopard development system right here and I've got the Python 2.5.1/readline that we maintain for our science application. print os.system("otool -L %s" % readline.__file__) /System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ lib-dynload/readline.so: /usr/lib/libedit.2.dylib (compatibility version 2.0.0, current version 2.9.0) /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current version 5.4.0) /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 111.0.0) From bwaters at nrao.edu Wed Oct 31 01:08:14 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Tue, 30 Oct 2007 18:08:14 -0600 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> Message-ID: <343F48D9-6A49-46B6-BBFA-C6DFDB21486C@nrao.edu> On Oct 26, 2007, at 7:50 PM, emoy at apple.com wrote: > It right there in my original message (and in the python man page). > You have to use EditLine syntax: > > readline.parse_and_bind ("bind ^I rl_complete") Edward's example of using EditLine syntax works for my "raw python" test: $ python >>> import rlcompleter >>> import readline >>> readline.parse_and_bind ("bind ^I rl_complete") >>> readline.[TAB KEY PRESSED] readline.__class__ readline.__class__ readline.__class__ readline.__delattr__ readline.__delattr__ readline.__dict__ ... BUT If I change the IPython config file to use EditLine syntax, I get a segmentation fault when I start ipython. $ diff .ipython/ipythonrc.0 .ipython/ipythonrc 395c395 < readline_parse_and_bind tab: complete --- > readline_parse_and_bind bind ^I complete $ ipython Segmentation fault Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x000000006a000c6c Crashed Thread: 0 Thread 0 Crashed: 0 libSystem.B.dylib 0x91f22620 strcmp + 80 1 libedit.2.dylib 0x0044a906 map_bind + 1345 2 libedit.2.dylib 0x0044abec el_parse + 236 3 libedit.2.dylib 0x00457372 rl_parse_and_bind + 85 4 readline.so 0x00440e6a 0x440000 + 3690 5 org.python.python 0x0018d826 PyEval_EvalFrameEx + 17116 6 org.python.python 0x0018da08 PyEval_EvalFrameEx + 17598 7 org.python.python 0x0018da08 PyEval_EvalFrameEx + 17598 8 org.python.python 0x0018f47b PyEval_EvalCodeEx + 1638 9 org.python.python 0x0018daa5 PyEval_EvalFrameEx + 17755 10 org.python.python 0x0018f47b PyEval_EvalCodeEx + 1638 11 org.python.python 0x00139c47 PyFunction_SetClosure + 2646 12 org.python.python 0x0011fd5d PyObject_Call + 50 13 org.python.python 0x00128618 PyMethod_New + 2457 14 org.python.python 0x0011fd5d PyObject_Call + 50 15 org.python.python 0x00188b35 PyEval_CallObjectWithKeywords + 211 16 org.python.python 0x0012484d PyInstance_New + 305 17 org.python.python 0x0011fd5d PyObject_Call + 50 18 org.python.python 0x0018db3a PyEval_EvalFrameEx + 17904 19 org.python.python 0x0018f47b PyEval_EvalCodeEx + 1638 20 org.python.python 0x0018daa5 PyEval_EvalFrameEx + 17755 21 org.python.python 0x0018f47b PyEval_EvalCodeEx + 1638 22 org.python.python 0x0018f568 PyEval_EvalCode + 87 23 org.python.python 0x001a6a0c PyErr_Display + 1896 24 org.python.python 0x001a7036 PyRun_FileExFlags + 135 25 org.python.python 0x001a89a2 PyRun_SimpleFileExFlags + 421 26 org.python.python 0x001b3c23 Py_Main + 3095 27 org.python.pythonapp 0x00001fca 0x1000 + 4042 From robert.kern at gmail.com Wed Oct 31 01:16:12 2007 From: robert.kern at gmail.com (Robert Kern) Date: Tue, 30 Oct 2007 19:16:12 -0500 Subject: [Pythonmac-SIG] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> <343F48D9-6A49-46B6-BBFA-C6DFDB21486C@nrao.edu> Message-ID: Robert Kern wrote: > Boyd Waters wrote: >> On Oct 26, 2007, at 7:50 PM, emoy at apple.com wrote: >> >>> It right there in my original message (and in the python man page). >>> You have to use EditLine syntax: >>> >>> readline.parse_and_bind ("bind ^I rl_complete") >> Edward's example of using EditLine syntax works for my "raw python" >> test: >> >> $ python >> >>> import rlcompleter >> >>> import readline >> >>> readline.parse_and_bind ("bind ^I rl_complete") >> >> >>> readline.[TAB KEY PRESSED] >> readline.__class__ >> readline.__class__ readline.__class__ >> readline.__delattr__ >> readline.__delattr__ readline.__dict__ >> ... > > Try typing "b". Sorry, I misread your post. I meant that trying that with a readline module compiled against GNU readline interferes with typing "b". So, unfortunately, you can't just issue both commands hoping that the library will just ignore the wrong one. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco From bwaters at nrao.edu Wed Oct 31 01:25:47 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Tue, 30 Oct 2007 18:25:47 -0600 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: References: <8605F161-155A-49CD-840B-DE052514D406@apple.com> <53FF9C03-3C1F-4934-9886-B41D27111A7A@nrao.edu> <1775F102-678B-4EF5-A032-DB4A41AFBE97@apple.com> <343F48D9-6A49-46B6-BBFA-C6DFDB21486C@nrao.edu> Message-ID: On Oct 30, 2007, at 6:16 PM, Robert Kern wrote: > I meant that trying that with a readline module > compiled against GNU readline interferes with typing "b". So, > unfortunately, you > can't just issue both commands hoping that the library will just > ignore the > wrong one. I'm not sure I understand yet. I believe I have worked out the conditional logic to determine when we're linked against the libedit library versus GNU readline. But from inside the python on Leopard - that uses libedit for its readline module - I can get tab-completion to WORK when I'm running python by using the EditLine syntax that Edward Moy suggested. BUT from inside *ipython* I get a segmentation fault. I was all set to add the code to the IPython ipylib.py but I need to determine the cause of the segfault first. I'm using IPython from subversion trunk with {2007-10-28} as the SVN tag. Thanks! - boyd From bwaters at nrao.edu Wed Oct 31 16:47:05 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Wed, 31 Oct 2007 09:47:05 -0600 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: <6ce0ac130710310828p2b2216d5g6b2554d8328df681@mail.gmail.com> References: <200710311027.13581.hans_meine@gmx.net> <8FD85BB2-E80B-43D2-AED1-61F84C9D7C77@nrao.edu> <6ce0ac130710310828p2b2216d5g6b2554d8328df681@mail.gmail.com> Message-ID: This "which python" is an important point, but it is NOT causing my segfault. I'm using Apple's Python. I'm certain. For IPython. If you add this code to iplib.py then you are able to determine if you are bound to libedit. have_libedit - False if sys.platform == 'darwin' and have_readline: import commands (status, result) = commands.getstatusoutput( "otool -L %s | grep libedit" % _rl.__file__ ) if status == 0 and len(result) > 0: # we are bound to libedit - new in Leopard # _rl.parse_and_bind("bind ^I complete") print "Leopard libedit detected." have_libedit = True And that's what I see on the output when I start up ipython: $ ipython Leopard libedit detected. Python 2.5.1 (r251:54863, Oct 5 2007, 21:08:09) Type "copyright", "credits" or "license" for more information. IPython 0.8.2.svn.r2841 -- An enhanced Interactive Python. The problem is to pass the "complete" method correctly to libedit. In iplib.py, line 1342: # Configure readline according to user's prefs for rlcommand in self.rc.readline_parse_and_bind: if rlcommand.startswith("tab"): pass if readline.have_libedit: rlcommand = "bind ^I complete" print rlcommand readline.parse_and_bind(rlcommand) The FIRST time I launch IPython after making this change, I get an "Invalid command" error from readline: $ ipython Leopard libedit detected. bind ^I complete bind: Invalid command `complete'. "\C-l": possible-completions set show-all-if-ambiguous on "\C-o": tab-insert "\M-i": " " "\M-o": "\d\d\d\d" "\M-I": "\d\d\d\d" "\C-r": reverse-search-history "\C-s": forward-search-history "\C-p": history-search-backward "\C-n": history-search-forward "\e[A": history-search-backward "\e[B": history-search-forward "\C-k": kill-line "\C-u": unix-line-discard Python 2.5.1 (r251:54863, Oct 5 2007, 21:08:09) And the modules are compiled as a side-effect. AFTER the modules are compiled, I simply get a segfault: In [1]: ^D Do you really want to exit ([y]/n)? galatea:~ bwaters$ ipython Leopard libedit detected. bind ^I complete Segmentation fault SO: 1) How do I form the bind commands for libedit? "EditLine" syntax 2) The segfault is a bug, methinks. I posted it as such. On Oct 31, 2007, at 9:28 AM, Brian Granger wrote: > Can you do look at the output of: > > head `which ipython` > > This will tell you which python your ipython (the ipython that is > first in your path if there are multiple) is using. > > Brian > > > On 10/31/07, Boyd Waters wrote: >> >> >> >> >> On Oct 31, 2007, at 3:27 AM, Hans Meine wrote: >> >> BUT from inside *ipython* I get a segmentation fault. >> >> >> Again - are you sure that both use the same python version? >> >> Thanks, good suggestion, but in this case I'm pretty sure. >> >> I uninstalled all MacPorts pythons before running this test. >> This is basically a clean install of Leopard. >> >> >> $ python >> Python 2.5.1 (r251:54863, Oct 5 2007, 21:08:09) >> [GCC 4.0.1 (Apple Inc. build 5465)] on darwin >> Type "help", "copyright", "credits" or "license" for more >> information. >>>>> import os >>>>> import readline >>>>> import rlcompleter >>>>> print os.system("otool -L %s" % readline.__file__) >> /System/Library/Frameworks/Python.framework/Versions/2.5/lib/ >> python2.5/lib-dynload/readline.so: >> /usr/lib/libedit.2.dylib (compatibility version 2.0.0, current >> version >> 2.9.0) >> /usr/lib/libncurses.5.4.dylib (compatibility version 5.4.0, current >> version >> 5.4.0) >> /usr/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current >> version >> 1.0.0) >> /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current >> version >> 111.0.0) >> 0 >>>>> readline.parse_and_bind ("bind ^I rl_complete") >>>>> readline.[TAB KEY PRESSED]readline.__class__ >> readline.__class__ >> readline.__class__ >> readline.__delattr__ readline.__delattr__ >> readline.__dict__ >> ... >> >>>>> ^D >> >> >> >> $ ipython >> In [1]: import os >> >> In [2]: import readline >> >> In [3]: import rlcompleter >> >> In [4]: print os.system("otool -L %s" % readline.__file__) >> /Library/Python/2.5/site-packages/IPython/rlineimpl.pyc: >> is not an object file >> 0 >> >> >> Hmm. >> >> >> >> _______________________________________________ >> IPython-dev mailing list >> IPython-dev at scipy.org >> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev >> >> From bwaters at nrao.edu Wed Oct 31 18:10:16 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Wed, 31 Oct 2007 11:10:16 -0600 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: References: <200710311027.13581.hans_meine@gmx.net> <8FD85BB2-E80B-43D2-AED1-61F84C9D7C77@nrao.edu> <6ce0ac130710310828p2b2216d5g6b2554d8328df681@mail.gmail.com> Message-ID: The segfault was in binding to the "complete" command; it does not segfault (and seems to work) if I bind to "rl_complete" instead. *However*, I am not sure that this is what IPython wants. I am going to assume that rl_complete is the correct thing (at the moment) and that IPython maps the appropriate completer via readline.set_completer(). We have a couple of problems, though. A) The commands that are included in the default ipythonrc use readline syntax, and every one of them must be mapped to EditLine syntax B) Passing plausible values into Leopard's readline.parse_and_bind causes a segmentation fault. Sometimes. When it's compiled Python. Problem B is a bug report to Apple and I don't know for sure that I'll be able to fix. Problem A - what to do about EditLine syntax in general - may best be left to the new user prefs stuff. I don't know. What I am doing at the moment is hard-coding the mapping of the tab- completion as a special case in IPython's rilneimpl.py I don't like that, but it works. Also -- and a path to a Better World -- you can check IPython's rpimpl.py for a "uses_libedit" boolean value. We could add some logic in iplib.py that checks this value and reads an alternate ipythonrc in case we're running on Leopard. I get nauseous thinking about it. Anyway. Here are a couple of kludges for the specific case of tab-completion on Leopard-python: 1) Explicitly check for libedit on Darwin and bind the tab to rl_complete if so: --- IPython/rlineimpl.py 2007-10-30 17:34:13.000000000 -0600 +++ IPython/rlineimpl.py 2007-10-31 10:54:23.000000000 -0600 @@ -29,6 +29,16 @@ print "Failed GetOutputFile" have_readline = False +uses_libedit = False +if sys.platform == 'darwin' and have_readline: + import commands + (status, result) = commands.getstatusoutput( "otool -L %s | grep libedit" % _rl.__file__ ) + if status == 0 and len(result) > 0: + # we are bound to libedit - new in Leopard + _rl.parse_and_bind("bind ^I rl_complete") + print "Leopard libedit detected." + uses_libedit = True + # the clear_history() function was only introduced in Python 2.4 and is # actually optional in the readline API, so we must explicitly check for its # existence. Some known platforms actually don't have it. This thread: 2) Ignore any attempt to re-bind the tab key in the ipythonrc if we're using libedit: --- IPython/iplib.py 2007-10-30 18:32:36.000000000 -0600 +++ IPython/iplib.py 2007-10-31 10:59:03.000000000 -0600 @@ -1325,7 +1325,10 @@ if inputrc_name is None: home_dir = get_home_dir() if home_dir is not None: - inputrc_name = os.path.join(home_dir,'.inputrc') + inputrc_name = '.inputrc' + if readline.uses_libedit: + inputrc_name = '.editrc' + inputrc_name = os.path.join(home_dir, inputrc_name) if os.path.isfile(inputrc_name): try: readline.read_init_file(inputrc_name) @@ -1341,8 +1344,11 @@ # Configure readline according to user's prefs for rlcommand in self.rc.readline_parse_and_bind: - print rlcommand - readline.parse_and_bind(rlcommand) + if rlcommand.startswith("tab"): + pass + if not readline.uses_libedit: + print rlcommand + readline.parse_and_bind(rlcommand) # remove some chars from the delimiters list delims = readline.get_completer_delims() From bwaters at nrao.edu Wed Oct 31 18:43:03 2007 From: bwaters at nrao.edu (Boyd Waters) Date: Wed, 31 Oct 2007 11:43:03 -0600 Subject: [Pythonmac-SIG] [IPython-dev] readline support for OS X Leopard In-Reply-To: References: <200710311027.13581.hans_meine@gmx.net> <8FD85BB2-E80B-43D2-AED1-61F84C9D7C77@nrao.edu> <6ce0ac130710310828p2b2216d5g6b2554d8328df681@mail.gmail.com> Message-ID: <8CD42B96-B4A0-427E-8BAB-6D10223DF4E3@nrao.edu> The segfault was in binding to the "complete" command; it does not segfault (and seems to work) if I bind to "rl_complete" instead. *However*, I am not sure that this is what IPython wants. I am going to assume that rl_complete is the correct thing (at the moment) and that IPython maps the appropriate completer via readline.set_completer(). We have a couple of problems, though. A) The commands that are included in the default ipythonrc use readline syntax, and every one of them must be mapped to EditLine syntax B) Passing plausible values into Leopard's readline.parse_and_bind causes a segmentation fault. Sometimes. When it's compiled Python. Problem B is a bug report to Apple and I don't know for sure that I'll be able to fix. Problem A - what to do about EditLine syntax in general - may best be left to the new user prefs stuff. I don't know. What I am doing at the moment is hard-coding the mapping of the tab- completion as a special case in IPython's rilneimpl.py I don't like that, but it works. Also -- and a path to a Better World -- you can check IPython's rpimpl.py for a "uses_libedit" boolean value. We could add some logic in iplib.py that checks this value and reads an alternate ipythonrc in case we're running on Leopard. I get nauseous thinking about it. Anyway. Here are a couple of kludges for the specific case of tab-completion on Leopard-python: 1) Explicitly check for libedit on Darwin and bind the tab to rl_complete if so: --- IPython/rlineimpl.py 2007-10-30 17:34:13.000000000 -0600 +++ IPython/rlineimpl.py 2007-10-31 10:54:23.000000000 -0600 @@ -29,6 +29,16 @@ print "Failed GetOutputFile" have_readline = False +uses_libedit = False +if sys.platform == 'darwin' and have_readline: + import commands + (status, result) = commands.getstatusoutput( "otool -L %s | grep libedit" % _rl.__file__ ) + if status == 0 and len(result) > 0: + # we are bound to libedit - new in Leopard + _rl.parse_and_bind("bind ^I rl_complete") + print "Leopard libedit detected." + uses_libedit = True + # the clear_history() function was only introduced in Python 2.4 and is # actually optional in the readline API, so we must explicitly check for its # existence. Some known platforms actually don't have it. This thread: 2) Ignore any attempt to re-bind the tab key in the ipythonrc if we're using libedit: --- IPython/iplib.py 2007-10-30 18:32:36.000000000 -0600 +++ IPython/iplib.py 2007-10-31 10:59:03.000000000 -0600 @@ -1325,7 +1325,10 @@ if inputrc_name is None: home_dir = get_home_dir() if home_dir is not None: - inputrc_name = os.path.join(home_dir,'.inputrc') + inputrc_name = '.inputrc' + if readline.uses_libedit: + inputrc_name = '.editrc' + inputrc_name = os.path.join(home_dir, inputrc_name) if os.path.isfile(inputrc_name): try: readline.read_init_file(inputrc_name) @@ -1341,8 +1344,11 @@ # Configure readline according to user's prefs for rlcommand in self.rc.readline_parse_and_bind: - print rlcommand - readline.parse_and_bind(rlcommand) + if rlcommand.startswith("tab"): + pass + if not readline.uses_libedit: + print rlcommand + readline.parse_and_bind(rlcommand) # remove some chars from the delimiters list delims = readline.get_completer_delims()