From drewmccormack at mac.com Sat May 1 10:15:11 2004 From: drewmccormack at mac.com (Drew McCormack) Date: Sat May 1 10:15:21 2004 Subject: [Pythonmac-SIG] Building portable PIL Message-ID: I am writing an article for MacDevCenter in which I want to perform image processing via Xgrid. I started off trying to use imagemagick, but that became a nightmare. Then I remembered PIL, and so far things are going OK, but I'm not there yet. What I need is a copy of PIL which has no dependencies other than those in a standard Mac OS X system. I tried first installing libjpeg using fink, and then using MacPython for PIL, but the PIL formed depends on the libjpeg.dylib file. I then tried compiling PIL myself, changing the paths to /sw/lib and /sw/include, as stated in the instructions. This compile seems OK, until you try to read a jpeg file, and then it says the decoder is not available, or something like that. Checking the _imaging.so library with otool indicates that the jpeg dylib is not linked, which is good, but apparently neither is the static library. So I'm a bit stuck. Does anyone know how I can generate a version of PIL that can deal with jpeg, but does not depend on libjpeg.dylib? Drew McCormack Trade Strategist Stock market strategy design software http://www.trade-strategist.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1891 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040501/482ab2ff/attachment.bin From bob at redivi.com Sat May 1 10:24:10 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat May 1 10:24:16 2004 Subject: [Pythonmac-SIG] Building portable PIL In-Reply-To: References: Message-ID: <36652072-9B7B-11D8-94F6-000A95686CD8@redivi.com> On May 1, 2004, at 10:15 AM, Drew McCormack wrote: > I am writing an article for MacDevCenter in which I want to perform > image processing via Xgrid. I started off trying to use imagemagick, > but that became a nightmare. Then I remembered PIL, and so far things > are going OK, but I'm not there yet. > > What I need is a copy of PIL which has no dependencies other than > those in a standard Mac OS X system. I tried first installing libjpeg > using fink, and then using MacPython for PIL, but the PIL formed > depends on the libjpeg.dylib file. > > I then tried compiling PIL myself, changing the paths to /sw/lib and > /sw/include, as stated in the instructions. This compile seems OK, > until you try to read a jpeg file, and then it says the decoder is not > available, or something like that. Checking the _imaging.so library > with otool indicates that the jpeg dylib is not linked, which is good, > but apparently neither is the static library. > > So I'm a bit stuck. Does anyone know how I can generate a version of > PIL that can deal with jpeg, but does not depend on libjpeg.dylib? The libjpeg in my PackageManager repository doesn't have any external dependencies: http://undefined.org/python/pimp/ -bob From bob at redivi.com Sat May 1 10:36:06 2004 From: bob at redivi.com (Bob Ippolito) Date: Sat May 1 10:36:12 2004 Subject: [Pythonmac-SIG] Building portable PIL In-Reply-To: <36652072-9B7B-11D8-94F6-000A95686CD8@redivi.com> References: <36652072-9B7B-11D8-94F6-000A95686CD8@redivi.com> Message-ID: On May 1, 2004, at 10:24 AM, Bob Ippolito wrote: > On May 1, 2004, at 10:15 AM, Drew McCormack wrote: > >> I am writing an article for MacDevCenter in which I want to perform >> image processing via Xgrid. I started off trying to use imagemagick, >> but that became a nightmare. Then I remembered PIL, and so far things >> are going OK, but I'm not there yet. >> >> What I need is a copy of PIL which has no dependencies other than >> those in a standard Mac OS X system. I tried first installing libjpeg >> using fink, and then using MacPython for PIL, but the PIL formed >> depends on the libjpeg.dylib file. >> >> I then tried compiling PIL myself, changing the paths to /sw/lib and >> /sw/include, as stated in the instructions. This compile seems OK, >> until you try to read a jpeg file, and then it says the decoder is >> not available, or something like that. Checking the _imaging.so >> library with otool indicates that the jpeg dylib is not linked, which >> is good, but apparently neither is the static library. >> >> So I'm a bit stuck. Does anyone know how I can generate a version of >> PIL that can deal with jpeg, but does not depend on libjpeg.dylib? > > The libjpeg in my PackageManager repository doesn't have any external > dependencies: > http://undefined.org/python/pimp/ Err.. sorry, haven't had my coffee yet. The PIL in my PackageManager repository doesn't have any external dependencies. libjpeg and such are compiled into the .so statically. -bob From drewmccormack at mac.com Sat May 1 12:08:35 2004 From: drewmccormack at mac.com (Drew McCormack) Date: Sat May 1 12:08:46 2004 Subject: [Pythonmac-SIG] Building portable PIL In-Reply-To: References: <36652072-9B7B-11D8-94F6-000A95686CD8@redivi.com> Message-ID: >> The libjpeg in my PackageManager repository doesn't have any external >> dependencies: >> http://undefined.org/python/pimp/ > > Err.. sorry, haven't had my coffee yet. The PIL in my PackageManager > repository doesn't have any external dependencies. libjpeg and such > are compiled into the .so statically. > > -bob > > Thanks bob, you are a saviour. It works a treat. I'll make sure you and your web site get a big honorable mention in the article. Cheers, Drew Trade Strategist Stock market strategy design software http://www.trade-strategist.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1358 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040501/4c73ae21/attachment.bin From Jack.Jansen at cwi.nl Sat May 1 16:47:54 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat May 1 16:47:49 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 12, Issue 38 In-Reply-To: References: Message-ID: On 30 Apr 2004, at 23:11, Daniel Lord wrote: > Non-standard paths due to the framework install are most likely are > the reason I struggle with PIL. This is a pain and it may be what > Russell is alluding to when stating that an aqua/Mac install can cause > conflicts and trouble. It appears it does. What were your problems with PIL? I ran into one issue with the previous PIL distribution, it didn't get the link sequence for the PIL Tkinter stuff right, but I sent in a patch for that one, and I think I remember seeing it included in the last PIL. Anything that doesn't work should be fixed, really;-) -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Sat May 1 16:51:37 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat May 1 16:51:32 2004 Subject: [Pythonmac-SIG] Building portable PIL In-Reply-To: References: Message-ID: <570A3082-9BB1-11D8-82ED-000D934FF6B4@cwi.nl> On 1 May 2004, at 16:15, Drew McCormack wrote: > What I need is a copy of PIL which has no dependencies other than > those in a standard Mac OS X system. I tried first installing libjpeg > using fink, and then using MacPython for PIL, but the PIL formed > depends on the libjpeg.dylib file. To add to Bob's reply: what I did for the PIL in the main package manager database (which also doesn't depend on libjpeg.dylib) in the end was remove the libjpge.dylib and associated files before building PIL. I tried various other approaches trying to get it to use the static library in stead of the dynamic library but didn't succeed. Distutils really needs a feature whereby you can tell it to use specific paths to certain libraries in stead of -L and -l options, whereby you never know what you'll eventually link against... -- 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 daniel at brightfire.org Sun May 2 00:41:34 2004 From: daniel at brightfire.org (Daniel Lord) Date: Sun May 2 00:41:43 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 12, Issue 38 In-Reply-To: References: Message-ID: Maybe I downloaded the wrong version, but I couldn't get it to compile a few months ago and gave up. I'll take you question as a hint that I should try again . On May 1, 2004, at 13:47, Jack Jansen wrote: > > On 30 Apr 2004, at 23:11, Daniel Lord wrote: >> Non-standard paths due to the framework install are most likely are >> the reason I struggle with PIL. This is a pain and it may be what >> Russell is alluding to when stating that an aqua/Mac install can >> cause conflicts and trouble. It appears it does. > > What were your problems with PIL? I ran into one issue with the > previous PIL distribution, it didn't get the link sequence for the PIL > Tkinter stuff right, but I sent in a patch for that one, and I think I > remember seeing it included in the last PIL. > > Anything that doesn't work should be fixed, really;-) > -- > 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 skip at pobox.com Sun May 2 21:45:25 2004 From: skip at pobox.com (Skip Montanaro) Date: Sun May 2 21:45:08 2004 Subject: [Pythonmac-SIG] Installing PyGame? Message-ID: <16533.42037.178050.37264@montanaro.dyndns.org> Armin Rigo posted a reference to a Psyco description to python-dev the other day which requires PyGame to view. For the life of me I can't figure out how to install PyGame on my Mac. The PackageManager stuff just doesn't seem to work at all for me. (Double-clicking /Applications/MacPython-2.3/PackageManager does nothing and as far as I can tell there are no tea leaves left around to examine.) I tried installing the SDL and SDL-devel binary packages, but the SDL-devel 1.2.7 package doesn't install properly (installer complains about errors). I then backed up and installed SDL from source. That didn't work well either. SDL & PyGame both built and installed (in /Users/skip), but when I tried to import pygam in pythonw I got a run-time linker error: % pythonw Python 2.4a0 (#39, May 2 2004, 17:18:18) [GCC 3.3 20030304 (Apple Computer, Inc. build 1493)] on darwin Type "help", "copyright", "credits" or "license" for more information. import py>>> import pygame Traceback (most recent call last): File "", line 1, in ? File "/Users/skip/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pygame/__init__.py", line 64, in ? from pygame.base import * ImportError: Failure linking new module: : dyld: /Users/skip/Library/Frameworks/Python.framework/Versions/2.4/Resources/Python.app/Contents/MacOS/Python Undefined symbols: /Users/skip/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pygame/base.so undefined reference to _PyArg_ParseTuple expected to be defined in the executable /Users/skip/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/pygame/base.so undefined reference to _PyCObject_AsVoidPtr expected to be def I'm running OSX 10.2.8 on a PowerBook with a framework build of Python based on Python CVS. Any clues? Skip From bob at redivi.com Sun May 2 21:54:13 2004 From: bob at redivi.com (Bob Ippolito) Date: Sun May 2 21:54:23 2004 Subject: [Pythonmac-SIG] Installing PyGame? In-Reply-To: <16533.42037.178050.37264@montanaro.dyndns.org> References: <16533.42037.178050.37264@montanaro.dyndns.org> Message-ID: On May 2, 2004, at 9:45 PM, Skip Montanaro wrote: > > Armin Rigo posted a reference to a Psyco description to python-dev the > other > day which requires PyGame to view. > > For the life of me I can't figure out how to install PyGame on my Mac. > The > PackageManager stuff just doesn't seem to work at all for me. > (Double-clicking /Applications/MacPython-2.3/PackageManager does > nothing and > as far as I can tell there are no tea leaves left around to examine.) Something is not right with your environment.. The tea leaves are in your system log, check the Console application in /Applications/Utilities. > I tried installing the SDL and SDL-devel binary packages, but the > SDL-devel > 1.2.7 package doesn't install properly (installer complains about > errors). > I then backed up and installed SDL from source. That didn't work well > either. SDL & PyGame both built and installed (in /Users/skip), but > when I > tried to import pygam in pythonw I got a run-time linker error: > > % pythonw > Python 2.4a0 (#39, May 2 2004, 17:18:18) > [GCC 3.3 20030304 (Apple Computer, Inc. build 1493)] on darwin > Type "help", "copyright", "credits" or "license" for more > information. > import py>>> import pygame > Traceback (most recent call last): > File "", line 1, in ? > File > "/Users/skip/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/pygame/__init__.py", line 64, in ? > from pygame.base import * > ImportError: Failure linking new module: : dyld: > /Users/skip/Library/Frameworks/Python.framework/Versions/2.4/ > Resources/Python.app/Contents/MacOS/Python Undefined symbols: > > /Users/skip/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/pygame/base.so undefined reference to > _PyArg_ParseTuple expected to be defined in the executable > > /Users/skip/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/pygame/base.so undefined reference to > _PyCObject_AsVoidPtr expected to be def > > I'm running OSX 10.2.8 on a PowerBook with a framework build of Python > based > on Python CVS. > > Any clues? Holy cow. Please either use Python 2.3 or upgrade to OS X 10.3. I can't really reproduce your current situation. -bob From dyoo at hkn.eecs.berkeley.edu Sun May 2 18:20:05 2004 From: dyoo at hkn.eecs.berkeley.edu (Danny Yoo) Date: Mon May 3 05:38:05 2004 Subject: [Pythonmac-SIG] Re: [Python-Help] _tkinter [getting Tkinter working on MacOS X 10.3] In-Reply-To: Message-ID: On Sun, 2 May 2004 jf@ai.univ-paris8.fr wrote: > >You need to use the Python PackageManager (which comes with MacPython) > >to install tkinter. > > That's what I did. Hence, my puzzle... Can you help ? Hi Jf, [I am CCing this reply to the MacPython list, just in case it helps anyone there] It sounds like you installed the add-on 'PackageManager' at: http://homepages.cwi.nl/~jack/macpython/download.html Your next step is to use the PackageManager to pull in the Tkinter extension. In your Applications directory, look for the MacPython-2.3 subdirectory, and execute the PackageManager application. You should see the PackageManager "Python Install Manager" window open up, with a list of packages displayed. One of the packages that you should see is '_tkinter-2.3-binary', and it should indicate that it's 'no', since it hasn't been installed by default. Click on the '_tkinter-2.3-binary' package, and press the Install button on the bottom of the PackageManager window. If you receive an error message that "Tck/Tk Aqua" has not been installed, then you also need that package first. Tck/Tk Aqua can be found here: http://www.maths.mq.edu.au/~steffen/tcltk/TclTkAqua/ Install the Tck/Tk Aqua package first, and then try the Python PackageManager again. If everything goes well, then the status of the '_tkinter-2.3-binary' page should switch from 'no' to 'yes'. There is still one messy issue to run Tkinter applications on MacOS 10.3: such programs must be executed by using the 'pythonw' windows-aware interpreter. Otherwise, you will see strange errors of the form: SetFrontProcess failed,-606 See: http://mail.python.org/pipermail/pythonmac-sig/2002-August/006040.html for details on this. Yes, this is not so cleanly implemented; there needs to be some work done to make this nicer. Anyway, I hope this helps! From Jack.Jansen at cwi.nl Mon May 3 06:58:53 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon May 3 07:01:17 2004 Subject: [Pythonmac-SIG] Installing PyGame? In-Reply-To: <16533.42037.178050.37264@montanaro.dyndns.org> References: <16533.42037.178050.37264@montanaro.dyndns.org> Message-ID: On 3-mei-04, at 3:45, Skip Montanaro wrote: > ImportError: Failure linking new module: : dyld: > /Users/skip/Library/Frameworks/Python.framework/Versions/2.4/ > Resources/Python.app/Contents/MacOS/Python Undefined symbols: > > /Users/skip/Library/Frameworks/Python.framework/Versions/2.4/lib/ > python2.4/site-packages/pygame/base.so undefined reference to > _PyArg_ParseTuple expected to be defined in the executable Very strange. The only thing I can imagine is that you built the pygame extensions with a different Python than the one you're using to run them, could that be happening somehow? -- 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 Mon May 3 13:58:06 2004 From: hengist.podd at virgin.net (has) Date: Mon May 3 13:58:21 2004 Subject: [Pythonmac-SIG] [ann] appscript 0.5.0 posted Message-ID: Hi all, Just posted appscript 0.5.0, though haven't made it public yet. Here's the link: http://freespace.virgin.net/hamish.sanderson/appscript-0.5.0.tar.gz Could somebody please try installing and using the custom terminology stuff and let me know if they could figure it out and get it working okay or not? Assuming that goes ok, I'll make it public and then we can pick up where we left off discussing how best to deal with the Crappy Terminology problem (e.g. see the 'Appscript and Excel' thread). Thanks, has -- http://freespace.virgin.net/hamish.sanderson/ From marmille at adobe.com Mon May 3 19:41:37 2004 From: marmille at adobe.com (marmille) Date: Mon May 3 19:41:45 2004 Subject: [Pythonmac-SIG] Change application menu from Python based on locale? Message-ID: <4096D8B1.2030807@adobe.com> I'm working on a Tkinter based muli-lingual Python utility and would like to know if there is some way from within Python to change the name of the application menu that appears to the right of the Apple menu in the upper left of the screen. Normally this text is set in the program's associated info.plist file. But doing things that way requires that I have a different one for each language supported. Seems like it would be easier to do it at runtime from within the application based on the current Locale. Thanks for any help, -Martin From Martina at Oefelein.de Tue May 4 01:27:34 2004 From: Martina at Oefelein.de (Martina Oefelein) Date: Tue May 4 01:27:40 2004 Subject: [Pythonmac-SIG] Change application menu from Python based on locale? In-Reply-To: <4096D8B1.2030807@adobe.com> References: <4096D8B1.2030807@adobe.com> Message-ID: Hi Martin: > I'm working on a Tkinter based muli-lingual Python utility and would > like to know if there is some way from within Python to change the > name of the application menu that appears to the right of the Apple > menu in the upper left of the screen. You can localize Info.plist entries via the InfoPlist.strings file in the appropriate .lproj directory. See the Apple documentation for details. ciao Martina From marmille at adobe.com Tue May 4 14:59:23 2004 From: marmille at adobe.com (marmille) Date: Tue May 4 15:00:48 2004 Subject: [Pythonmac-SIG] Re: Search Pythonmac-SIG? In-Reply-To: <16529.32606.799957.15450@montanaro.dyndns.org> References: <40915DFD.10603@adobe.com> <16529.32606.799957.15450@montanaro.dyndns.org> Message-ID: <4097E80B.2030409@adobe.com> Skip Montanaro wrote: > Martin> Is there any way to search through the Pythonmac-SIG archives -- > Martin> short of downloading them all and doing it manually inside of > Martin> each one? > > Martin> I am looking for information on a specific subject and the > Martin> messages from the list don't seem to show up in my Google web > Martin> searches. > > This might help you search Google more effectively for Python-related info: > > http://www.python.org/cgi-bin/moinmoin/GoogleTips > > Skip > The GoogleTips helped a lot, thank you. Here's another archive of the sig list I just discovered that has the search capabilities built right into it: > http://aspn.activestate.com/ASPN/Mail/Browse/Threaded/pythonmac-sig -Martin From daniel at brightfire.org Tue May 4 22:43:24 2004 From: daniel at brightfire.org (Daniel Lord) Date: Tue May 4 22:43:36 2004 Subject: [Pythonmac-SIG] Re: appscript 0.5.0 test In-Reply-To: References: Message-ID: > Just posted appscript 0.5.0, though haven't made it public yet. Here's > the link: > > http://freespace.virgin.net/hamish.sanderson/appscript-0.5.0.tar.gz > > Could somebody please try installing and using the custom terminology > stuff and let me know if they could figure it out and get it working > okay or not? Assuming that goes ok, I'll make it public and then we > can pick up where we left off discussing how best to deal with the > Crappy Terminology problem (e.g. see the 'Appscript and Excel' > thread). > > Thanks, > > has > Created a custom Excel appTerminology with an added 'set' command in it using your tools and named it 'Microsoft_Excel_TEST'. Everything worked as expected: Nice work HAS. I added a lowercase' 'set': # # DML added set and get for standard suite # ['set', "Set an object's data.", 'core', 'setd', ['null', '', ['optional']], ['obj ', '', []], [['to', 'data', '****', 'The value to set object data.', []]]], ['get', 'Get the data for an object.', 'core', 'getd', ['****', '', []], ['obj ', '', []], []], ### and commented out the brain-dead set from M$: # # Original Set (neutered DML) # # ['Set', # 'Set some data to the object', # 'XCEL', # 'setd', # ['null', 'foo', ['optional']], # ['obj ', 'the object to set the data to', []], # [['To', 'TO ', '****', 'the data', ['list']]]], ### SCRIPT: from appscript import * from customterminology import Microsoft_Excel_TEST ws = app('Microsoft Excel', terms=Microsoft_Excel_TEST.appTerminology).Workbooks[1].Worksheets[1] print "Read..." print ws.Range['R1C1'].Value.get() print "Write..." ws.Range['R1C1'].Formula.set('Test_From_Python_Appscript',) print "Read again..." print ws.Range['R1C1'].Value.get() OUTPUT: (start with an open workbook and a worksheet with 'Change Me' in R1C1) $ sudo pythonw simplerw.py Read... Change me Write... Read again... Test_From_Python_Appscript nota bene: I have to run everything with root privileges now that I used 'DiskUtility' to 'repair permissions' (bulls*t cough bullsh*t /repair/ my a*s). Sometimes I really really hate OS X, but it is a love hate relationship, passionate one moment and vexing the next . From hengist.podd at virgin.net Wed May 5 10:39:34 2004 From: hengist.podd at virgin.net (has) Date: Wed May 5 10:53:51 2004 Subject: [Pythonmac-SIG] [ann] PyMod 0.3.0 released (still seeking feedback) Message-ID: Hi all, Just posted a new version of PyMod for y'all to beat on. I've tweaked the UI a bit and added a 'Register with PyPI' convenience option for package authors, but the main addition is a first draft of the documentation. (See Help>PyMod Help.) I'll submit it as a MacPython 2.4 feature enhancement request sometime next week, so the next few days would be a good time to get your initial 2c in. Things it definitely needs are a better name and better icon, and the docs could certainly use a good editing, plus anything else anyone can think of. (Folk wanting to refresh their memories as to why I've written PyMod should check out the February-March thread titled 'PackMan engine version 0.4'.) Thanks, has -- http://freespace.virgin.net/hamish.sanderson/ From hengist.podd at virgin.net Wed May 5 10:28:50 2004 From: hengist.podd at virgin.net (has) Date: Wed May 5 10:53:55 2004 Subject: [Pythonmac-SIG] [ann] appscript 0.5.0 posted Message-ID: Daniel Lord wrote: > > Just posted appscript 0.5.0, though haven't made it public yet. Here's > > the link: > >Created a custom Excel appTerminology with an added 'set' command in it >using your tools and named it 'Microsoft_Excel_TEST'. Everything worked >as expected: >Nice work HAS. Please bear in mind that this custom terminology mechanism is a KLUDGE. And a highly experimental one at that - so don't get too attached because it's likely as not to go away again before 1.0.0, and even if it does stay it will certainly change. It was quietly bodged together a couple releases ago while working with a Mail 1.3.3 user to find a way to get round its buggy aete resource. We first tried hacking its .scriptSuite/.scriptTerminology files [as used by Cocoa Scripting], only to discover it had an aete as well [as returned by OSAGetAppTerminology()] that masked these changes from appscript. Hacking aetes is a bit harder on users than hacking .scriptSuite/.scriptTerminology files, so I added the custom terminology mechanism to see how that'd compare. It's certainly not up to shippable standards in its current form: the requirement for custom terminology modules to be passed explicitly by the user's script is tedious on the user and makes those scripts horrendously non-portable, and the code itself is poorly factored and untested. My preference is still to fix the problem as close to source as possible, which means figuring out some sort of system for hacking fixes into .scriptSuite/.scriptTerminology files and aete resources (both data and resource fork-based), and producing distributable patches based on those fixes. This would make for the best medium-to-long-term solution, requires no tinkering with appscript to support and has the additional advantage that it's language-agnostic (remember, my interest is in seeing appscript-style bridges eventually appear for other languages as well as Python). The downside is that it'd be more complex to set up such a "close-to-the-bone" system, and somebody else would need to come up with a working system as it's somewhat outside my own areas of expertise (and I've too much other stuff to do in getting appscript ready in time for MacPython 2.4 to get up to speed right now). Anyway, at least we now have something physical to discuss around, which is a start. I'll go see if there's anything still to pick up on from the old Excel scripting thread and deal with it shortly. Meantime, if folks'd like to put heads together and work out roughly what resources the alternative "hack the app, not the bridge" solution is likely to require to implement, we can then compare the likely pros and cons of each before making a decision which way to go. ... Thanks for checking it out and letting me know. I've put the link up on my site now and updated its PyPI entry, and I'll punt some announcements out the the AppleScript folks for their info. I've also updated the existing example scripts and added some new ones for anyone that's interested. has -- http://freespace.virgin.net/hamish.sanderson/ From rowen at cesmail.net Wed May 5 12:57:17 2004 From: rowen at cesmail.net (Russell E. Owen) Date: Wed May 5 12:57:26 2004 Subject: [Pythonmac-SIG] urllib and ftplib hang in bundle but not when run directly Message-ID: (I posted a similar message to comp.lang.python, but I'm hoping the fact that this fails as a bundled app but not when run from the command line might offer a clue to Mac mavens). I am having trouble with some ftp code. On some platforms it works fine and on others it reliably hangs. The code uses urllib to retrieve a file in a background thread, which runs the following code. The diagnostic message before urllib.urlopen is printed, but the one after urllib.urlopen is not: def _getTask(self): try: self._toFile = file(self.toPath, 'wb') print "opening URL" self._fromFile = urllib.urlopen(self.fromURL) print "URL opened" # when hung this does not print self._totBytes = self._fromFile.info().getheader("Content-Length") if self._totBytes: self._totBytes = int(self._totBytes) self._state = Running while True: nextData = self._fromFile.read(8192) if not nextData: break elif self._state == Aborting: self._cleanup(Aborted) return self._readBytes += len(nextData) self._toFile.write(nextData) self._cleanup(Done) except Exception, e: self._cleanup(Failed, exception = e) What is really weird, I can only make it hang when run as part of a fairly large Tkinter application. The same code runs fine standalone or as part of a minimal Tkinter test application. Also, the large Tkinter app runs perfectly on my MacOS X 10.3.3 box. However, I FTP hangs when I build that same code into a double-clickable app via bundlebuilder (though in all other respects the bundle works fine). FTP hangs also when I run the same code on a RedHat box (python 2.3.3). The same code also used to run fine, suggesting a change at the server end or in the network. But I can't see how that could make it my code in some circumstances and fail in others unless I'm also doing something wrong. Anyway, despite the weird inconsistency as to when it works or fails, I also tried digging deeper into where it was hanging. I converted the code to running with ftplib (which hangs in the same way, no surprise since urllib uses ftplib for ftp) and adding diagnostic print statements. Using ftpObj.ntransfercmd(cmd) to make the transfer I find it hangs on "makepasv" if a passive transfer (which is what I'd always used) and on sock.accept if not a passive transfer. The large application has one other thread for communicating via one TCP socket. In all other respects the large app runs fine; the ftp hangs while everything else keeps cooking along. Closing the TCP connection (which stop the one extra thread) has no effect on the stalled ftp transfer. Any suggestions would be most appreciated. -- Russell From mdepristo at cryst.bioc.cam.ac.uk Tue May 4 11:35:36 2004 From: mdepristo at cryst.bioc.cam.ac.uk (Mark DePristo) Date: Wed May 5 16:34:41 2004 Subject: [Pythonmac-SIG] bundlebuilder and pyopengl Message-ID: Hi everyone, I'm having a tough time getting bundlebuilder to work with PyOpenGL. I keep getting the following message in my console.log box: ===== Tue May 04 2004 ===== 16:23:07 Europe/London ===== Traceback (most recent call last): File "/Users/mdepristo/research/chemotaxis/glutSoloXcode/pybct/build/ pyBCT.app/Contents/Resources/test.py", line 1, in ? import OpenGL File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/OpenGL/__init__.py", line 18, in ? File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/OpenGL/__init__.py", line 14, in __set_attributes IOError: [Errno 20] Not a directory: '/Users/mdepristo/research/chemotaxis/glutSoloXcode/pybct/build/ pyBCT.app/Contents/Resources/Modules.zip/OpenGL/version' I've been using a very simple build script: ### makeapplication.py from bundlebuilder import buildapp buildapp( name='pyBCT', # what to build mainprogram='test.py', # your app's main() argv_emulation=0, # drag&dropped filenames show up in sys.argv standalone=True, # make this app self contained. includeModules=['OpenGL'], # list of additional Modules to force in includePackages=['OpenGL'], # list of additional Packages to force in # list of shared libs or Frameworks to include libs=[], ) ### end of makeapplication.py And test.py is the incredibly simple: # START test.py import OpenGL if __name__ == "__main__": print 'HELLO WORLD FROM PYBCT' # END test.py Clearly, the problem is the way pyopengl is included in the bundle. First, the 'version' file is missing from the Modules.zip package. Is there any way to automatically include this file in the Modules.zip directory? I've experimented with the --file option, but it isn't clear what I need to do. Has anyone successfully included PyOpenGL into a standalone program built with bundlebuilder? If so, how did you do it? Thanks in advance, Mark Mark DePristo Ph.D. Candidate Dept. of Biochemistry Cambridge University mdepristo@cryst.bioc.cam.ac.uk http://www-cryst.bioc.cam.ac.uk/~mdepristo/ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2420 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040504/25977135/attachment.bin From bob at redivi.com Wed May 5 17:00:20 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed May 5 17:00:43 2004 Subject: [Pythonmac-SIG] bundlebuilder and pyopengl In-Reply-To: References: Message-ID: <382F48C8-9ED7-11D8-8DE9-000A95686CD8@redivi.com> On May 4, 2004, at 11:35 AM, Mark DePristo wrote: > Hi everyone, > > I'm having a tough time getting bundlebuilder to work with PyOpenGL. > I keep getting the following message in my console.log box: > > ===== Tue May 04 2004 ===== 16:23:07 Europe/London ===== > Traceback (most recent call last): > File > "/Users/mdepristo/research/chemotaxis/glutSoloXcode/pybct/build/ > pyBCT.app/Contents/Resources/test.py", line 1, in ? > import OpenGL > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/OpenGL/__init__.py", line 18, in ? > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/OpenGL/__init__.py", line 14, in > __set_attributes > IOError: [Errno 20] Not a directory: > '/Users/mdepristo/research/chemotaxis/glutSoloXcode/pybct/build/ > pyBCT.app/Contents/Resources/Modules.zip/OpenGL/version' PyOpenGL "depends" on a stupid little file so that it knows its own version, I suggest that you just change __init__.py so that it doesn't try and read that file. Change this: filename = os.path.join(os.path.dirname(__file__), 'version') __version__ = string.strip(open(filename).read()) To this: __version__ = '2.0.1.07' There are other ways to do it, but none of them are great and all of them are more of a pain in the ass than this. -bob From bob at redivi.com Wed May 5 19:36:56 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed May 5 19:37:25 2004 Subject: [Pythonmac-SIG] bundlebuilder and pyopengl In-Reply-To: References: Message-ID: <189BBA3C-9EED-11D8-8DE9-000A95686CD8@redivi.com> On May 4, 2004, at 11:35 AM, Mark DePristo wrote: > Hi everyone, > > I'm having a tough time getting bundlebuilder to work with PyOpenGL. > I keep getting the following message in my console.log box: > > ===== Tue May 04 2004 ===== 16:23:07 Europe/London ===== > Traceback (most recent call last): > File > "/Users/mdepristo/research/chemotaxis/glutSoloXcode/pybct/build/ > pyBCT.app/Contents/Resources/test.py", line 1, in ? > import OpenGL > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/OpenGL/__init__.py", line 18, in ? > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/OpenGL/__init__.py", line 14, in > __set_attributes > IOError: [Errno 20] Not a directory: > '/Users/mdepristo/research/chemotaxis/glutSoloXcode/pybct/build/ > pyBCT.app/Contents/Resources/Modules.zip/OpenGL/version' PyOpenGL "depends" on a stupid little file so that it knows its own version, I suggest that you just change __init__.py so that it doesn't try and read that file. Change this: filename = os.path.join(os.path.dirname(__file__), 'version') __version__ = string.strip(open(filename).read()) To this: __version__ = '2.0.1.07' There are other ways to do it, but none of them are great and all of them are more of a pain in the ass than this. -bob From daniel at brightfire.org Wed May 5 20:49:05 2004 From: daniel at brightfire.org (Daniel Lord) Date: Wed May 5 20:49:14 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 13, Issue 5 In-Reply-To: References: Message-ID: <2D132716-9EF7-11D8-9C69-000A95ACE052@brightfire.org> HAS wrote: > Thanks for checking it out and letting me know. I've put the link up > on my site now and updated its PyPI entry, and I'll punt some > announcements out the the AppleScript folks for their info. I've also > updated the existing example scripts and added some new ones for > anyone that's interested. One interesting quirk I have noted. I must run any custom terminology as root otherwise Launch.py fails to find the _Launch module. I cannot figure out what is wrong. I suspected permissions to be the culprit, obviously, but changing them on the entire appscript directory tree did not fix the problem. Any ideas? (FYI Excel.py runs a function that simply fills up a worksheet with a value, in the case below starting at 1,1 for 4 cols and 4 rows and fills with 'test') ~/Documents/Development/Python/Python-Applescript/Excel $ pythonw Excel.py 1 1 4 4 test Traceback (most recent call last): File "Excel.py", line 3, in ? from appscript import * File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/__init__.py", line 6, in ? from Main import app File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/Main.py", line 9, in ? import LaunchServices File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/LaunchServices/__init__.py", line 3, in ? from Launch import * File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/LaunchServices/Launch.py", line 3, in ? from _Launch import * ImportError: No module named _Launch From hengist.podd at virgin.net Thu May 6 10:24:45 2004 From: hengist.podd at virgin.net (has) Date: Thu May 6 10:25:19 2004 Subject: [Pythonmac-SIG] Re: custom terminology Message-ID: Daniel Lord wrote: > > Thanks for checking it out and letting me know. I've put the link up > > on my site now and updated its PyPI entry, and I'll punt some > > announcements out the the AppleScript folks for their info. I've also > > updated the existing example scripts and added some new ones for > > anyone that's interested. > >One interesting quirk I have noted. I must run any custom terminology >as root [...] You mean running a custom terminology module directly? If yes, why would you want to do that? Currently custom terminology modules should be imported into your script so you can pass the value of its appTerminology to appscript's app() function in addition to the usual application path. If no, can you clarify? Ta, has -- http://freespace.virgin.net/hamish.sanderson/ From daniel at brightfire.org Thu May 6 13:53:12 2004 From: daniel at brightfire.org (Daniel Lord) Date: Thu May 6 13:53:20 2004 Subject: [Pythonmac-SIG] Re: custom terminology In-Reply-To: References: Message-ID: <3E29050D-9F86-11D8-8F49-000A95ACE052@brightfire.org> On May 6, 2004, at 09:01, pythonmac-sig-request@python.org wrote: > Daniel Lord wrote: > >> > Thanks for checking it out and letting me know. I've put the link >> up >> > on my site now and updated its PyPI entry, and I'll punt some >> > announcements out the the AppleScript folks for their info. I've >> also >> > updated the existing example scripts and added some new ones for >> > anyone that's interested. >> >> One interesting quirk I have noted. I must run any custom terminology >> as root [...] > > You mean running a custom terminology module directly? If yes, why > would you want to do that? Currently custom terminology modules should > be imported into your script so you can pass the value of its > appTerminology to appscript's app() function in addition to the usual > application path. If no, can you clarify? > > Ta, > > has > -- > http://freespace.virgin.net/hamish.sanderson/ > HAS, I apologize for being unclear. That's what i meant: importing the terminology file seems to invoke Launch.py and it cannot find _Launch in my environment unless I invoke 'pythonw' as root or using 'sudo'. As I said it must be a permissions problem but I cannot figure it out. SCRIPT: #!/usr/local/bin/pythonw from appscript import * import string, sys from customterminology import Microsoft_Excel_TEST ws = app('Microsoft Excel', terms=Microsoft_Excel_TEST.appTerminology).Workbooks[1].Worksheets[1] if (len(sys.argv) != 5): print "usage: pythonw ReadRange.py startRow startColumn rows columns" sys.exit() row = int(sys.argv[1]) col = int(sys.argv[2]) nr = int(sys.argv[3]) nc = int(sys.argv[4]) print '=== Read Excel Range ===' for i in range(row, row + nr): for j in range(col, col + nc): rc = 'R%sC%s' %( i ,j) print '%s = %s' % (rc, ws.Range[rc].Value.get()) RUN1 (as user): $ pythonw ReadRange.py 1 1 2 2 Traceback (most recent call last): File "ReadRange.py", line 3, in ? from appscript import * File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/__init__.py", line 6, in ? from Main import app File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/Main.py", line 9, in ? import LaunchServices File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/LaunchServices/__init__.py", line 3, in ? from Launch import * File "/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/site- packages/appscript/LaunchServices/Launch.py", line 3, in ? from _Launch import * ImportError: No module named _Launch RUN2 (as root): $ sudo pythonw ReadRange.py 1 1 2 2 === Read Excel Range === R1C1 = 123.0 R1C2 = 246.0 R2C1 = 246.0 R2C2 = 492.0 Daniel From altis at semi-retired.com Fri May 7 12:08:01 2004 From: altis at semi-retired.com (Kevin Altis) Date: Fri May 7 12:08:05 2004 Subject: [Pythonmac-SIG] Mac OS X conference call for participation Message-ID: The O'Reilly Mac OS X Conference will be held October 25 - 28, 2004 at the Westin in Santa Clara, California. http://conferences.oreillynet.com/macosx2004/ Call for participation: http://conferences.oreillynet.com/cs/macosx2004/create/e_sess I'm not involved in the organization of this conference, but I think this is a great opportunity to show off Python-based projects and solutions for Mac OS X. See the call for participation above for tutorial and session topic ideas. Proposals are due June 11th. ka --- Kevin Altis altis@semi-retired.com http://altis.pycs.net/ From Chris.Barker at noaa.gov Fri May 7 14:44:49 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Fri May 7 14:45:21 2004 Subject: [Fwd: Re: [Pythonmac-SIG] Mac OS X conference call for participation] Message-ID: <409BD921.4050305@noaa.gov> Kevin Altis wrote: > The O'Reilly Mac OS X Conference will be held October 25 - 28, 2004 at > the Westin in Santa Clara, California. > http://conferences.oreillynet.com/cs/macosx2004/create/e_sess From the above: """ All session presenters whose talks are accepted will receive free admission to the conference. For each half-day tutorial, the presenter receives: * One night's hotel accommodation * Travel allowance: o Up to $300 from the west coast o Up to $500 from the east coast o Up to $800 international * Free admission to the conference, including admittance to other tutorials """ So that means that one (or many) of the MacPython developers could get the trip paid for! I am totally unqualified to give a talk at this conference, but I would love to see Jack, Bob, Kevin O, Has, Robin Dunn, (and probably a couple others I'm missing at the moment) give a talk and increase the visibility of Python on the Mac. Please consider submitting a proposal. Here are some general topics they'd like to see that are particularly relevant to MacPython: """ For developers, programmers, and scripters: * GUI scripting. * Building applications with Unix scripting languages: Perl, PYTHON, Ruby, and PHP. * Integrating AppleScript and Unix scripting. * Designing UIs with Interface Builder. * Alternative development tools. """ -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From tim.jarman at lineone.net Fri May 7 15:03:44 2004 From: tim.jarman at lineone.net (Tim Jarman) Date: Fri May 7 15:05:50 2004 Subject: [Pythonmac-SIG] kinterbasd 3.1. pre 7 on Panther Message-ID: <200405072003.44341.tim.jarman@lineone.net> Anyone had any joy getting this to build? Running setup.py gives me a dark warning that "The kinterbasd setup code was not specifically written to support your platform (darwin) and may not work properly" and true to its word it doesn't - I get a ton of errors. While I have done C in a previous life I have no C experience on OS X and would like some indication that it is at least feasible to build this thing... or ideally (pointers to) an idiot's guide. TIA Tim Jarman From hengist.podd at virgin.net Fri May 7 17:40:44 2004 From: hengist.podd at virgin.net (has) Date: Fri May 7 17:41:09 2004 Subject: [Pythonmac-SIG] Re: custom terminology In-Reply-To: <3E29050D-9F86-11D8-8F49-000A95ACE052@brightfire.org> References: <3E29050D-9F86-11D8-8F49-000A95ACE052@brightfire.org> Message-ID: Daniel Lord wrote: >I apologize for being unclear. That's what i meant: importing the >terminology file seems to invoke Launch.py and it cannot find >_Launch in my environment unless I invoke 'pythonw' as root or >using 'sudo'. As I said it must be a permissions problem but I >cannot figure it out. No problem. Not really a good person to ask about Unixy stuff - maybe someone else could suggest something there? You could always try putting a copy of the LaunchServices module into site-packages and hack the custom terminology module to use it there, see if that makes any difference. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From jay at heynow.com Sat May 8 00:29:31 2004 From: jay at heynow.com (Jay Koutavas) Date: Sat May 8 00:29:38 2004 Subject: [Pythonmac-SIG] Debugging a MacPython Carbon module from CW9? Message-ID: Hi folks. The product I'm developing for requires I do some implementation using MacPython 2.2.3 running on Carbon (it's got the GUSI2-for-Carbon package). (Not on 2.3 because the customer's extensive crossplatform python code base is 2.2 dependent) (and not native OS X Python cuz it has to run on Mac OS 9 too.) The client's application embeds python via PythonCoreCarbon and through various .py files imports a few dozen modules of their devising, some are C++-based shared libraries. There's a bug in one of these shared libraries, and for the life of me, I'm not getting my breakpoint to stick in the shared library so I can have a look. I've added the shared library to 'Other Executables' in the main app's settings, which works great for debugging the PythonCoreCarbon shared library, but doesn't do much of anything for debugging module shared libs. Of course I have the module's shared library project file open at launch/debug time. But alas, no joy. Anyone dealing with such a scene out there and are willing to throw this old dog a bone on the finer points of setting up a debug environment for Python module shared libs? :) I'm using CodeWarrior 9.2(?) -- not sure if its 9.1 or 9.2, but the IDE's About Box says build #1429. Thanks in advance, /jay -- ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Jay Koutavas mailto:jay@heynow.com Heynow Software http://www.heynow.com Windham, New Hampshire, USA ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' From piet at cs.uu.nl Sat May 8 06:06:15 2004 From: piet at cs.uu.nl (Piet van Oostrum) Date: Sat May 8 06:04:29 2004 Subject: [Pythonmac-SIG] kinterbasd 3.1. pre 7 on Panther In-Reply-To: <200405072003.44341.tim.jarman@lineone.net> Message-ID: >>>>> Tim Jarman (TJ) wrote: TJ> Anyone had any joy getting this to build? Running setup.py gives me a TJ> dark warning that "The kinterbasd setup code was not specifically TJ> written to support your platform (darwin) and may not work properly" TJ> and true to its word it doesn't - I get a ton of errors. While I have TJ> done C in a previous life I have no C experience on OS X and would like TJ> some indication that it is at least feasible to build this thing... or TJ> ideally (pointers to) an idiot's guide. Yes, I have it running on MacOSX 10.3 (Panther). The patch was really simple and I have submitted it to the maintainer. It supposes that you have a Framework build of Firebird. I tested it against 1.5. diff -c /Users/piet/Projects/kinterbasdb-3.1_pre7/setup.py.\~1\~ /Users/piet/Projects/kinterbasdb-3.1_pre7/setup.py *** /Users/piet/Projects/kinterbasdb-3.1_pre7/setup.py.~1~ Tue Nov 11 06:17:34 2003 --- /Users/piet/Projects/kinterbasdb-3.1_pre7/setup.py Thu Mar 4 16:56:03 2004 *************** *** 734,739 **** --- 734,743 ---- assert os.path.isfile(libUltimateDest) print ' *** CYGWIN LIBRARY GENERATION : end ***\n' + elif sys.platform == 'darwin': + PLATFORM_SPECIFIC_EXTRA_LINKER_ARGS = ['-framework', 'Firebird'] + DATABASE_INCLUDE_DIR = '/Library/Frameworks/Firebird.framework/Headers' + else: # not win32 or cygwin # If the platform isn't Linux, issue a warning. if not sys.platform.lower().startswith('linux'): -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP] Private email: P.van.Oostrum@hccnet.nl From tim.jarman at lineone.net Sat May 8 07:41:16 2004 From: tim.jarman at lineone.net (Tim Jarman) Date: Sat May 8 07:49:20 2004 Subject: [Pythonmac-SIG] kinterbasd 3.1. pre 7 on Panther In-Reply-To: References: Message-ID: <200405081241.17173.tim.jarman@lineone.net> On Saturday 08 May 2004 11:06 am, you wrote: > >>>>> Tim Jarman (TJ) wrote: > > TJ> Anyone had any joy getting this to build? Running setup.py gives me a > TJ> dark warning that "The kinterbasd setup code was not specifically > TJ> written to support your platform (darwin) and may not work properly" > TJ> and true to its word it doesn't - I get a ton of errors. While I have > TJ> done C in a previous life I have no C experience on OS X and would like > TJ> some indication that it is at least feasible to build this thing... or > TJ> ideally (pointers to) an idiot's guide. > > Yes, I have it running on MacOSX 10.3 (Panther). The patch was really > simple and I have submitted it to the maintainer. It supposes that you > have a Framework build of Firebird. I tested it against 1.5. > Thank you!! Worked like a charm. Let's hope this makes it into the distro soon. Regards, Tim J From piet at cs.uu.nl Sat May 8 08:57:22 2004 From: piet at cs.uu.nl (Piet van Oostrum) Date: Sat May 8 08:55:35 2004 Subject: [Pythonmac-SIG] kinterbasd 3.1. pre 7 on Panther In-Reply-To: <200405081241.17173.tim.jarman@lineone.net> References: <200405081241.17173.tim.jarman@lineone.net> Message-ID: <16540.55602.731657.200726@ordesa.cs.uu.nl> >>>>> Tim Jarman (TJ) wrote: TJ> On Saturday 08 May 2004 11:06 am, you wrote: >> >>>>> Tim Jarman (TJ) wrote: >> TJ> Anyone had any joy getting this to build? Running setup.py gives me a TJ> dark warning that "The kinterbasd setup code was not specifically TJ> written to support your platform (darwin) and may not work properly" TJ> and true to its word it doesn't - I get a ton of errors. While I have TJ> done C in a previous life I have no C experience on OS X and would like TJ> some indication that it is at least feasible to build this thing... or TJ> ideally (pointers to) an idiot's guide. >> >> Yes, I have it running on MacOSX 10.3 (Panther). The patch was really >> simple and I have submitted it to the maintainer. It supposes that you >> have a Framework build of Firebird. I tested it against 1.5. >> TJ> TJ> Thank you!! Worked like a charm. Let's hope this makes it into the distro TJ> soon. The maintainer promised to put it in the next release. -- Piet van Oostrum URL: http://www.cs.uu.nl/~piet [PGP] Private email: P.van.Oostrum@hccnet.nl From hengist.podd at virgin.net Sat May 8 17:46:46 2004 From: hengist.podd at virgin.net (has) Date: Sun May 9 03:46:38 2004 Subject: [Fwd: Re: [Pythonmac-SIG] Mac OS X conference call for participation] In-Reply-To: <409BD921.4050305@noaa.gov> References: <409BD921.4050305@noaa.gov> Message-ID: Chris Barker wrote: >I would love to see Jack, Bob, Kevin O, Has, Robin Dunn, >(and probably a couple others I'm missing at the moment) give a talk I'll not be there, unfortunately, but if somebody else wants to give a presentation on application scripting I'd be very happy to help put it together. has -- http://freespace.virgin.net/hamish.sanderson/ From ronaldoussoren at mac.com Mon May 10 07:17:39 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon May 10 07:18:00 2004 Subject: [Pythonmac-SIG] Re: MacPython applet problem In-Reply-To: <32e55451.0405100202.508aa914@posting.google.com> References: <32e55451.0405100202.508aa914@posting.google.com> Message-ID: On 10-mei-04, at 12:02, boris m wrote: > I am running Python 2.3 on Mac OS 10.3. > > My problem is that applets don't seem to work. If I run a python > script in the terminal, everything is fine. If I run the same script > as an applet, nothing happens. The applet starts up, but dies after a > second or two. > > I used applets quite frequently unter OS9 and never had a problem with > them. Has anyone any idea why applets on OS X don't work the way they > did in OS 9? There's probably a traceback or other message in the console log (Console.app). That should point you in the right direction. Ronald From Jack.Jansen at cwi.nl Mon May 10 08:13:25 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon May 10 08:14:32 2004 Subject: [Pythonmac-SIG] Debugging a MacPython Carbon module from CW9? In-Reply-To: References: Message-ID: <700E8EB6-A27B-11D8-AC07-000A958D1666@cwi.nl> On 8-mei-04, at 6:29, Jay Koutavas wrote: > Hi folks. > > The product I'm developing for requires I do some implementation using > MacPython 2.2.3 running on Carbon (it's got the GUSI2-for-Carbon > package). (Not on 2.3 because the customer's extensive crossplatform > python code base is 2.2 dependent) (and not native OS X Python cuz it > has to run on Mac OS 9 too.) > > The client's application embeds python via PythonCoreCarbon and > through various .py files imports a few dozen modules of their > devising, some are C++-based shared libraries. There's a bug in one of > these shared libraries, and for the life of me, I'm not getting my > breakpoint to stick in the shared library so I can have a look. I've > added the shared library to 'Other Executables' in the main app's > settings, which works great for debugging the PythonCoreCarbon shared > library, but doesn't do much of anything for debugging module shared > libs. Of course I have the module's shared library project file open > at launch/debug time. But alas, no joy. What I used to do (but this was a couple of CodeWarriors ago) was setting the "hosting application" (or some such term, I don't have CW on this machine so can't check) for the dynamic module to Python. Then, when you press the run button (in the debugger for the dynamic module) it would start python and sit waiting for the module to be loaded. -- 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 sroy at mac.com Tue May 11 08:43:01 2004 From: sroy at mac.com (Steve Roy) Date: Tue May 11 08:43:08 2004 Subject: [Pythonmac-SIG] MacCVSX and Python Message-ID: Hi! I use MacCVSX and every time it launches it shows a Python error message: Error loading /Developer/Applications/MacCvsX-3.3a2/Macros/RecursiveAddTk.py: Traceback (most recent call last): File "/Developer/Applications/MacCvsX-3.3a2/PythonLib/cvsgui/ MacroRegistry.py", line 152, in LoadMacrosRecurs execfile(filename, self.m_globals) File "/Developer/Applications/MacCvsX-3.3a2/Macros/RecursiveAddTk.py", line 6, in ? from cvsgui.SafeTk import * File "/Developer/Applications/MacCvsX-3.3a2/PythonLib/cvsgui/SafeTk.py", line 1, in ? from Tkinter import * File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/lib-tk/Tkinter.py", line 38, in ? import _tkinter # If this fails your Python may not be configured for Tk ImportError: No module named _tkinter It seems that _tkinter can't be found. However I ran Package Manager and I installed _tkinter, yet MacCVSX still complains about it. Anyone know how to make this work? I thought it was just me, but then I talked to a friend who wrote an application in Python on Windows, and her applications gets the same error when she tries to run it on Mac OS X. I have _tkinter.so installed in /Library/Python/2.3/. I'm running Mac OS X 10.3.3. Steve -- Steve Roy Personal homepage: Projects homepage: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1536 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040511/2b377765/attachment.bin From gandreas at delver.com Tue May 11 10:35:36 2004 From: gandreas at delver.com (Glenn Andreas) Date: Tue May 11 10:35:54 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? Message-ID: From a newgroup post this morning, it appears that /usr/bin/python isn't installed by default on 10.3 unless the user installs the optional BSD layer. But as near as I can tell by using lsbom, Python.framework _is_ installed, but only the headers and shared library - none of the ".py" file (so none of the site files, nothing). Doesn't this limit the advantage of having Python.framework? After all, all you can do is link in the shared library - you can't really do much with it from your app, and you can't write any python scripts (or apps using PyObjC) without have the optional BSD layer installed, so I'm not sure what the point of having Python.framework installed. Any idea who we'll need to bribe at WWDC to get the rest of the stuff in the default layer? -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From berkowit at silcom.com Tue May 11 10:42:12 2004 From: berkowit at silcom.com (Paul Berkowitz) Date: Tue May 11 10:42:20 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: Message-ID: How many people do you know who don't install the BSD layer? And how many of those are non-geeks who couldn't easily go back and install it? You don't have to worry about geeks. I can't imagine there's any OP who does a Custom Install of OS X, chooses not to install BSD, and then needs Python. -- Paul Berkowitz > From: Glenn Andreas > Date: Tue, 11 May 2004 09:35:36 -0500 > To: > Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) > Python? > > From a newgroup post this morning, it appears that /usr/bin/python > isn't installed by default on 10.3 unless the user installs the > optional BSD layer. But as near as I can tell by using lsbom, > Python.framework _is_ installed, but only the headers and shared > library - none of the ".py" file (so none of the site files, nothing). > > Doesn't this limit the advantage of having Python.framework? After > all, all you can do is link in the shared library - you can't really > do much with it from your app, and you can't write any python scripts > (or apps using PyObjC) without have the optional BSD layer installed, > so I'm not sure what the point of having Python.framework installed. > > Any idea who we'll need to bribe at WWDC to get the rest of the stuff > in the default layer? > > -- > Glenn Andreas gandreas@gandreas.com > mondo blobbo, Cythera, Theldrow, oh my! > Mad, Bad, and Dangerous to Know > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@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: 2117 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040511/2945797e/smime.bin From bob at redivi.com Tue May 11 10:54:40 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 10:54:48 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: Message-ID: <2139C0DA-A35B-11D8-BCDD-000A95686CD8@redivi.com> I've seen it before, but it's pretty rare and easy to diagnose. On May 11, 2004, at 10:42 AM, Paul Berkowitz wrote: > How many people do you know who don't install the BSD layer? And how > many of > those are non-geeks who couldn't easily go back and install it? You > don't > have to worry about geeks. I can't imagine there's any OP who does a > Custom > Install of OS X, chooses not to install BSD, and then needs Python. > > -- > Paul Berkowitz > > >> From: Glenn Andreas >> Date: Tue, 11 May 2004 09:35:36 -0500 >> To: >> Subject: [Pythonmac-SIG] Optional BSD package is required for >> (useable) >> Python? >> >> From a newgroup post this morning, it appears that /usr/bin/python >> isn't installed by default on 10.3 unless the user installs the >> optional BSD layer. But as near as I can tell by using lsbom, >> Python.framework _is_ installed, but only the headers and shared >> library - none of the ".py" file (so none of the site files, nothing). >> >> Doesn't this limit the advantage of having Python.framework? After >> all, all you can do is link in the shared library - you can't really >> do much with it from your app, and you can't write any python scripts >> (or apps using PyObjC) without have the optional BSD layer installed, >> so I'm not sure what the point of having Python.framework installed. >> >> Any idea who we'll need to bribe at WWDC to get the rest of the stuff >> in the default layer? >> >> -- >> Glenn Andreas gandreas@gandreas.com >> mondo blobbo, Cythera, Theldrow, oh my! >> Mad, Bad, and Dangerous to Know >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From jwblist at olympus.net Tue May 11 14:21:03 2004 From: jwblist at olympus.net (John W. Baxter) Date: Tue May 11 14:24:11 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: Message-ID: On 5/11/2004 7:35, "Glenn Andreas" wrote: > From a newgroup post this morning, it appears that /usr/bin/python > isn't installed by default on 10.3 unless the user installs the > optional BSD layer. But as near as I can tell by using lsbom, > Python.framework _is_ installed, but only the headers and shared > library - none of the ".py" file (so none of the site files, nothing). A Mac OS X machine without the BSD subsystem installed is crippled beyond bothering with. (Nothing like expressing an opinion as if it were a fact...first time that ever happened in a mailing list. ;-) ) A machine upgraded (as opposed to archive and install) from Jaguar or before to Panther has a somewhat broken BSD subsystem and should be repaired (it's possible that some Panther update since 10.3.0 has fixed the broken ones...I don't know: I fixed mine by hand). I don't know why the BSD subsystem is an optional install. I've heard various ideas, including some sort of licensing issue. --John From gandreas at delver.com Tue May 11 14:47:25 2004 From: gandreas at delver.com (Glenn Andreas) Date: Tue May 11 14:47:36 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: Message-ID: > >How many people do you know who don't install the BSD layer? And how many of >those are non-geeks who couldn't easily go back and install it? You don't >have to worry about geeks. I can't imagine there's any OP who does a Custom >Install of OS X, chooses not to install BSD, and then needs Python. My point isn't so much "who here doesn't have BSD installed" so much as "if you try to produce commercial software using Python". After all, "we" all have it installed, but does everybody in a consumer base? No. If you embed python, you're half OK (the framework will be there, so everything can be linked when launched), but it will almost certainly fail in unexpected ways when you try to use it. If you try to write something using PyObjC (or pygame, or whatever), those are probably going to fail spectacularly (well, at least mysteriously to the end user). As far as I'm concerned, this puts a potentially serious limitation on using Python in a commerical project, since it requires adding in something in an installer to check for the presence of the "optional" install, and then bail out of the install if it doesn't find it, requiring the user to find their original OS X install disks to install an optional thing, which they many not have handy, and then potentially go through an re-install the security updates, and only then can they install your application. This seems to be a very high barrier for a (fortunately) small subset of your user base, but, depending on the application & target market, this may be a show-stopper (not to mention something that some reviewers may complain about). So any idea how we can get this out of the "optional" BSD layer install? (after all, /usr/bin/perl is in the base install) -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From bob at redivi.com Tue May 11 14:58:43 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 14:58:51 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: Message-ID: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> On May 11, 2004, at 2:47 PM, Glenn Andreas wrote: >> >> How many people do you know who don't install the BSD layer? And how >> many of >> those are non-geeks who couldn't easily go back and install it? You >> don't >> have to worry about geeks. I can't imagine there's any OP who does a >> Custom >> Install of OS X, chooses not to install BSD, and then needs Python. > > My point isn't so much "who here doesn't have BSD installed" so much > as "if you try to produce commercial software using Python". After > all, "we" all have it installed, but does everybody in a consumer > base? No. > > If you embed python, you're half OK (the framework will be there, so > everything can be linked when launched), but it will almost certainly > fail in unexpected ways when you try to use it. > > If you try to write something using PyObjC (or pygame, or whatever), > those are probably going to fail spectacularly (well, at least > mysteriously to the end user). > > As far as I'm concerned, this puts a potentially serious limitation on > using Python in a commerical project, since it requires adding in > something in an installer to check for the presence of the "optional" > install, and then bail out of the install if it doesn't find it, > requiring the user to find their original OS X install disks to > install an optional thing, which they many not have handy, and then > potentially go through an re-install the security updates, and only > then can they install your application. This seems to be a very high > barrier for a (fortunately) small subset of your user base, but, > depending on the application & target market, this may be a > show-stopper (not to mention something that some reviewers may > complain about). > > So any idea how we can get this out of the "optional" BSD layer > install? (after all, /usr/bin/perl is in the base install) Have you looked at my "PyMacApp" shim, or the (in CVS) PyObjC Xcode template? It is written EXACTLY for this reason. An application that uses it, or similar means, is NOT going to fail spectacularly without letting the user know how or why. You can handle this case rather easily, and tell the user exactly what is wrong (the BSD subsystem is missing) and how to install it. -bob From bob at redivi.com Tue May 11 15:23:40 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 15:23:50 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <40A1258E.5000801@noaa.gov> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> Message-ID: On May 11, 2004, at 3:12 PM, Chris Barker wrote: > >>> So any idea how we can get this out of the "optional" BSD layer >>> install? (after all, /usr/bin/perl is in the base install) > > Well, if perl is there, python should be. > > However, /usr//bin/python is a symlink to /usr/bin/python2.3, which is > a symlink to the executable in the Framework, which is always there, > as I understand it. So option > > A) don't explicitly use usr/bin/python anywhere (you should be using > /usr/bin/python2.3 at the very least anyway). Since some twisted > individual could have replace /usr/bin/python[2.3] with a custom > compiled version anyway, it's always dangerous. Isn't this what > BundleBuilder2 is for? For an application actually embedding Python, you don't ever use the executable, just the framework. Bundlebuilder2, as-is, does not embed Python, because it does not have an executable stub (just scripts). PyMacApp and the PyObjC Xcode template (they are indistinguishable) does. > B) your installer could install a /usr/bin/python2.3 symlink. That's probably a bad idea. There are two problems you can have. You can't link to the framework properly (boom! link error), or the Python code doesn't work. My executable stub handles both of these situations elegantly and anyone who cares should take a look at it. If your software is not Python based but uses Python (I believe Glenn is in this camp), then you can just as easily rip code out of my executable stub and use it in your own program. I don't care, and the license permits. -bob From Chris.Barker at noaa.gov Tue May 11 16:00:26 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Tue May 11 16:01:02 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> Message-ID: <40A130DA.5030204@noaa.gov> Bob, thanks, you're a wealth of knowledge, as usual. Bob Ippolito wrote: > For an application actually embedding Python, you don't ever use the > executable, just the framework. Bundlebuilder2, as-is, does not embed > Python, because it does not have an executable stub (just scripts). But it doesn't require /usr/bin/python either, does it? > PyMacApp and the PyObjC Xcode template (they are indistinguishable) does. > >> B) your installer could install a /usr/bin/python2.3 symlink. > That's probably a bad idea. > > There are two problems you can have. You can't link to the framework > properly (boom! link error), or the Python code doesn't work. Macs are just weird. By the way, what's the status of BundleBuilder2? Should I be using it? -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From gandreas at mac.com Tue May 11 15:48:19 2004 From: gandreas at mac.com (Glenn Andreas) Date: Tue May 11 16:09:14 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> Message-ID: At 3:23 PM -0400 5/11/04, Bob Ippolito wrote: >On May 11, 2004, at 3:12 PM, Chris Barker wrote: > >> >>>>So any idea how we can get this out of the "optional" BSD layer >>>>install? (after all, /usr/bin/perl is in the base install) >> >>Well, if perl is there, python should be. I certainly will agree with that. >>However, /usr//bin/python is a symlink to /usr/bin/python2.3, which >>is a symlink to the executable in the Framework, which is always >>there, as I understand it. So option As near as I can tell from lsbom, it isn't. Only the headers & (shared macho) library are installed. All the ".py" file and the executable aren't. So trying to fake or create a /usr/bin/python on the fly won't work. You could probaby make your own version of /usr/bin/python in your own bundle (something that links Python.framework, grabs stdio and used the standard embedding support) but without the python standard library you're still going to be extremely limited. >There are two problems you can have. You can't link to the >framework properly (boom! link error), or the Python code doesn't >work. My executable stub handles both of these situations elegantly >and anyone who cares should take a look at it. If your software is >not Python based but uses Python (I believe Glenn is in this camp), >then you can just as easily rip code out of my executable stub and >use it in your own program. I don't care, and the license permits. The other case is wanting to write python scripts, in, say, an installer. Since /usr/bin/python may not be there (nor any other form of executable nor the python libraries you'd use) it pretty much rules out using it (reliably & safely) as a post-installation script. This also means that the PDF workflow that they demoed at last years WWDC potentially won't work either - not sure what good claiming Quartz bindings for Python (listed on http://www.apple.com/macosx/newfeatures/creativeprofessionals.html) does if you can't run python scripts without the "optional" BSD layer. Perhaps a bunch of radar bugs might help to resolve this (and attending the scripting feedback forum at WWDC). -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From njriley at uiuc.edu Tue May 11 16:11:32 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Tue May 11 16:11:46 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> Message-ID: <20040511201132.GA2524@uiuc.edu> On Tue, May 11, 2004 at 02:48:19PM -0500, Glenn Andreas wrote: > This also means that the PDF workflow that they demoed at last years > WWDC potentially won't work either - not sure what good claiming > Quartz bindings for Python (listed on > http://www.apple.com/macosx/newfeatures/creativeprofessionals.html) > does if you can't run python scripts without the "optional" BSD layer. Also, Python is used to generate fax cover sheets in Panther. Does the built-in fax service not work without the BSD layer installed, either? -- =Nicholas Riley | From bob at redivi.com Tue May 11 16:13:44 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 16:13:53 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <40A130DA.5030204@noaa.gov> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <40A130DA.5030204@noaa.gov> Message-ID: On May 11, 2004, at 4:00 PM, Chris Barker wrote: > Bob, thanks, you're a wealth of knowledge, as usual. > > Bob Ippolito wrote: >> For an application actually embedding Python, you don't ever use the >> executable, just the framework. Bundlebuilder2, as-is, does not >> embed Python, because it does not have an executable stub (just >> scripts). > > But it doesn't require /usr/bin/python either, does it? Actually it does, you need *some* /usr/bin/python to exist in order to run the bootstrap script that exeve's the proper python. >> PyMacApp and the PyObjC Xcode template (they are indistinguishable) >> does. >>> B) your installer could install a /usr/bin/python2.3 symlink. >> That's probably a bad idea. >> There are two problems you can have. You can't link to the framework >> properly (boom! link error), or the Python code doesn't work. > > Macs are just weird. It's not the Mac's fault that the user screwed up their configuration. You could just as easily bork a linux configuration by installing your own python over a system python, replacing symlinks, etc. > By the way, what's the status of BundleBuilder2? Should I be using it? It more or less does everything the original bundlebuilder does, but more correctly, so I would say yes. Personally I've been using my Xcode template recently and just managing dependencies manually. I haven't had the time or desire to futz around with bundlebuilder2 lately. I might just decide to shred it into orthogonal pieces and build something else with a different interface next time I work on it, because the more I use bundlebuilder the less I like how it works. -bob From bob at redivi.com Tue May 11 16:18:31 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 16:18:47 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <20040511201132.GA2524@uiuc.edu> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> Message-ID: <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> On May 11, 2004, at 4:11 PM, Nicholas Riley wrote: > On Tue, May 11, 2004 at 02:48:19PM -0500, Glenn Andreas wrote: >> This also means that the PDF workflow that they demoed at last years >> WWDC potentially won't work either - not sure what good claiming >> Quartz bindings for Python (listed on >> http://www.apple.com/macosx/newfeatures/creativeprofessionals.html) >> does if you can't run python scripts without the "optional" BSD layer. > > Also, Python is used to generate fax cover sheets in Panther. Does > the built-in fax service not work without the BSD layer installed, > either? Look at the script, IIRC it calls Python from inside the framework. I'm sure PDF workflows can be done the same way. I really don't think it's a big deal to simply tell the naive users who go out of their way to deselect the BSD layer that they screwed up and now they have to install it if they want to use your software. It's not that hard to determine the presence of the BSD layer. -bob From njriley at uiuc.edu Tue May 11 16:26:34 2004 From: njriley at uiuc.edu (Nicholas Riley) Date: Tue May 11 16:26:54 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> Message-ID: <20040511202634.GB2798@uiuc.edu> On Tue, May 11, 2004 at 04:18:31PM -0400, Bob Ippolito wrote: > > On May 11, 2004, at 4:11 PM, Nicholas Riley wrote: > > >On Tue, May 11, 2004 at 02:48:19PM -0500, Glenn Andreas wrote: > >>This also means that the PDF workflow that they demoed at last years > >>WWDC potentially won't work either - not sure what good claiming > >>Quartz bindings for Python (listed on > >>http://www.apple.com/macosx/newfeatures/creativeprofessionals.html) > >>does if you can't run python scripts without the "optional" BSD layer. > > > >Also, Python is used to generate fax cover sheets in Panther. Does > >the built-in fax service not work without the BSD layer installed, > >either? > > Look at the script, IIRC it calls Python from inside the framework. > I'm sure PDF workflows can be done the same way. I'm not on OS X now or I would have... > I really don't think it's a big deal to simply tell the naive users who > go out of their way to deselect the BSD layer that they screwed up and > now they have to install it if they want to use your software. It's > not that hard to determine the presence of the BSD layer. So why can't packaged apps use the bundle Python too? From some of the other emails I got the idea that Python was unusable without the BSD layer installed, -- =Nicholas Riley | From steph at cs.ualberta.ca Tue May 11 16:36:50 2004 From: steph at cs.ualberta.ca (Stephanie Schaeffer) Date: Tue May 11 16:36:56 2004 Subject: [Pythonmac-SIG] wxPython and IDE issues In-Reply-To: References: Message-ID: I'm just new to Python, having been a Lisp hacker for many years. I'm trying to convert an application I have in MCL Common Lisp to Python. I wonder if someone who has been through some of the following hurdles can help me out a bit. 1) What is a good IDE to use on the Mac (I have Panther) when you are using wx? The IDE that comes with MacPython doesn't work with wx. I am currently using Dr.Python, but would like a more helpful debugger. 2) In MCL lisp, I could create windows interactively and see things happen. I can't seem to do that with Python (and wx). It seems to want to create an application which is then only event driven, and my interactive window where I type in text is ignored until the application stops. Am I missing something here? I am doing this from DrPython. I'd like to be able to interactively create a window, and then call routines to add shapes to it, etc. Preferably without having to implement a separate "listener" of my own. Should I use a different GUI package? A different IDE? Or am I just asking too much of Python at this stage of its development (especially on a Mac). Any help would be more than welcome! Thanks so much, Steph Schaeffer University of Alberta steph@cs.ualberta.ca From gandreas at delver.com Tue May 11 16:37:25 2004 From: gandreas at delver.com (Glenn Andreas) Date: Tue May 11 16:38:21 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <20040511202634.GB2798@uiuc.edu> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> Message-ID: > > I really don't think it's a big deal to simply tell the naive users who >> go out of their way to deselect the BSD layer that they screwed up and >> now they have to install it if they want to use your software. It's >> not that hard to determine the presence of the BSD layer. > >So why can't packaged apps use the bundle Python too? From some of >the other emails I got the idea that Python was unusable without the >BSD layer installed, There is no "bundle Python" without the BSD layer (so I have no idea how the fax cover sheet or PDF workflow could work without it). lsbom MacOSX10.3.pkg/Contents/Archive.bom | grep python ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework 40775 0/80 ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Headers 120775 0/80 24 2473506787 Versions/Current/Headers ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Python 120775 0/80 23 914784009 Versions/Current/Python ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Versions 40775 0/80 ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Versions/2.3 40775 0/80 ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Versions/2.3/Headers 120775 0/80 17 385844800 include/python2.3 ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Versions/2.3/Python 100775 0/80 89832 1576120760 ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Versions/2.3/include 40775 0/80 ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3 40775 0/80 ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Versions/2.3/include/python2.3/Python.h 100664 0/80 3927 1440136318 [more header files] ./Developer/SDKs/MacOSX10.3.0.sdk/System/Library/Frameworks/Python.framework/Versions/Current 120775 0/80 3 541161345 2.3 All that is installed with the base 10.3 is the Python.Framework directory structure, and the "current" headers/shared library. lsbom BSD.pkg/Contents/Archive.bom | grep /bin/python ./System/Library/Frameworks/Python.framework/Versions/2.3/bin/python 100755 0/0 22100 1168592703 ./System/Library/Frameworks/Python.framework/Versions/2.3/bin/python2.3 100755 0/0 22100 1168592703 ./usr/bin/python 120755 0/0 9 674368981 python2.3 ./usr/bin/python2.3 120755 0/0 72 704285156 ../../System/Library/Frameworks/Python.framework/Versions/2.3/bin/python ./usr/bin/pythonw 120755 0/0 10 14599298 pythonw2.3 ./usr/bin/pythonw2.3 100755 0/0 122 3516629244 It's the BSD pkg that installs the python that lives inside the framework, and then links /usr/bin/python to /usr/bin/python2.3 (and then that to the one that lives in the framework). (The BSD.pkg also installs all the .py and .pyc files found in Python.framework/Versions/2.3/lib/python2.3, etc...) -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From bob at redivi.com Tue May 11 16:38:33 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 16:38:44 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <20040511202634.GB2798@uiuc.edu> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> Message-ID: <2B8C9B4A-A38B-11D8-BCDD-000A95686CD8@redivi.com> On May 11, 2004, at 4:26 PM, Nicholas Riley wrote: > On Tue, May 11, 2004 at 04:18:31PM -0400, Bob Ippolito wrote: >> >> On May 11, 2004, at 4:11 PM, Nicholas Riley wrote: >> >>> On Tue, May 11, 2004 at 02:48:19PM -0500, Glenn Andreas wrote: >>>> This also means that the PDF workflow that they demoed at last years >>>> WWDC potentially won't work either - not sure what good claiming >>>> Quartz bindings for Python (listed on >>>> http://www.apple.com/macosx/newfeatures/creativeprofessionals.html) >>>> does if you can't run python scripts without the "optional" BSD >>>> layer. >>> >>> Also, Python is used to generate fax cover sheets in Panther. Does >>> the built-in fax service not work without the BSD layer installed, >>> either? >> >> Look at the script, IIRC it calls Python from inside the framework. >> I'm sure PDF workflows can be done the same way. > > I'm not on OS X now or I would have... Actually, I don't remember correctly. It uses /usr/bin/python. I had remembered it used an explicit path to something (not the canonical /usr/bin/env), but the actual path I remembered wasn't correct :) >> I really don't think it's a big deal to simply tell the naive users >> who >> go out of their way to deselect the BSD layer that they screwed up and >> now they have to install it if they want to use your software. It's >> not that hard to determine the presence of the BSD layer. > > So why can't packaged apps use the bundle Python too? From some of > the other emails I got the idea that Python was unusable without the > BSD layer installed, They can, at least in theory, do I have to mention my stub again? bundlebuilder however requires it because of a technical detail that has no real workaround unless we make it depend on a compiler or give it a suitable precompiled stub. -bob From bob at redivi.com Tue May 11 17:04:57 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 17:05:09 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> Message-ID: On May 11, 2004, at 4:37 PM, Glenn Andreas wrote: >> > I really don't think it's a big deal to simply tell the naive >> users who >>> go out of their way to deselect the BSD layer that they screwed up >>> and >>> now they have to install it if they want to use your software. It's >>> not that hard to determine the presence of the BSD layer. >> >> So why can't packaged apps use the bundle Python too? From some of >> the other emails I got the idea that Python was unusable without the >> BSD layer installed, > > There is no "bundle Python" without the BSD layer (so I have no idea > how the fax cover sheet or PDF workflow could work without it). > > lsbom MacOSX10.3.pkg/Contents/Archive.bom | grep python That's not what you should be looking at.. you should be looking at the pkg files on the installation CD. You actually don't even get the shared library, and you definitely don't get the headers unless you install Xcode. Strangely enough, the ONLY thing you get is the CoreGraphics extension, but not Python. > All that is installed with the base 10.3 is the Python.Framework > directory structure, and the "current" headers/shared library. Which would be enough if it was actually there. If you include all Python code that you depend on (which is the case of bundlebuilder --semi-standalone, but it wouldn't work for other reasons). -bob From Chris.Barker at noaa.gov Tue May 11 17:11:05 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Tue May 11 17:11:47 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <2B8C9B4A-A38B-11D8-BCDD-000A95686CD8@redivi.com> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> <2B8C9B4A-A38B-11D8-BCDD-000A95686CD8@redivi.com> Message-ID: <40A14169.4050107@noaa.gov> Bob Ippolito wrote: > They can, at least in theory, do I have to mention my stub again? > bundlebuilder however requires it because of a technical detail that has > no real workaround unless we make it depend on a compiler or give it a > suitable precompiled stub. I thought you did that with BundleBuilder2. I'm just getting more confused here, not less! -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From bob at redivi.com Tue May 11 17:20:22 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 17:20:31 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <40A14169.4050107@noaa.gov> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> <2B8C9B4A-A38B-11D8-BCDD-000A95686CD8@redivi.com> <40A14169.4050107@noaa.gov> Message-ID: <031F6C5B-A391-11D8-BCDD-000A95686CD8@redivi.com> On May 11, 2004, at 5:11 PM, Chris Barker wrote: > Bob Ippolito wrote: > >> They can, at least in theory, do I have to mention my stub again? >> bundlebuilder however requires it because of a technical detail that >> has no real workaround unless we make it depend on a compiler or give >> it a suitable precompiled stub. > > I thought you did that with BundleBuilder2. I'm just getting more > confused here, not less! No, bundlebuilder2 finds dependencies in compiled code and rewrites the mach-o load commands in the copies in the correct way so that you can embed dynamic libraries and frameworks inside your executable and expect them to work. It includes no enhancements whatsoever to the executable stub. -bob From mlpollard at earthlink.net Tue May 11 16:51:33 2004 From: mlpollard at earthlink.net (Tom Pollard) Date: Tue May 11 17:34:23 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <20040511202634.GB2798@uiuc.edu> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> Message-ID: On Tue, May 11, 2004 at 04:18:31PM -0400, Bob Ippolito wrote: >> I really don't think it's a big deal to simply tell the naive users >> who >> go out of their way to deselect the BSD layer that they screwed up and >> now they have to install it if they want to use your software. It's >> not that hard to determine the presence of the BSD layer. I think this condescending language about users "screwing up" their MacOS X installation by leaving out the BSD subsystem is a little bit bizarre and unprofessional. If it's an optional install, then Apple clearly disagrees with that point of view (as do I). On May 11, 2004, at 4:26 PM, Nicholas Riley wrote: > So why can't packaged apps use the bundle Python too? From some of > the other emails I got the idea that Python was unusable without the > BSD layer installed, There's a python startup script in the package created by bundle-builder that sets a couple of environment variables and invokes python to run the bundled script. It is solely in order to run this script that the BSD environment needs to be installed. It could easily be replaced with a /bin/sh script if it was considered important to support users who didn't have /usr/bin/python installed already. That's the only change that would be required. The last time I brought this up, Bob Ippolito explained that this would make it impossible to use the bundled app as a "regular" app from both the Finder and the command line, but I never really appreciated that point. It sounded like bundle-builder2 would eliminate the problem in a more robust way, so it didn't seem worth pursuing. But, if I was going to ship an app based on the current bundle-builder, I would definitely hack it to use a shell startup script instead of the python script. Tom Pollard From bob at redivi.com Tue May 11 18:25:12 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 18:25:20 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> Message-ID: <11C9181D-A39A-11D8-BCDD-000A95686CD8@redivi.com> On May 11, 2004, at 4:51 PM, Tom Pollard wrote: > On Tue, May 11, 2004 at 04:18:31PM -0400, Bob Ippolito wrote: >>> I really don't think it's a big deal to simply tell the naive users >>> who >>> go out of their way to deselect the BSD layer that they screwed up >>> and >>> now they have to install it if they want to use your software. It's >>> not that hard to determine the presence of the BSD layer. > > I think this condescending language about users "screwing up" their > MacOS X installation by leaving out the BSD subsystem is a little bit > bizarre and unprofessional. If it's an optional install, then Apple > clearly disagrees with that point of view (as do I). There's a whole heck of a lot of software that'll fall on its face if it's not there, including some of their own (fax cover sheets, for example). I'm obviously not suggesting that you should tell the user that they "screwed up" in those words, but you would pop up a message in the installer check script or on app execution that says something along the lines of: FooApplication depends on the BSD subsystem of Mac OS X. Normally this is installed by default, but it does not appear to be present on your system. To install the BSD Subsystem, insert the Mac OS X Installation CD 1, or your hardware restore disc, and install BSD.pkg from /System/Installation/Packages. Please be sure to also run Software Update after this installation. This could easily be done from my executable stub by replacing the __error__.sh script with an implementation that prints this message. > On May 11, 2004, at 4:26 PM, Nicholas Riley wrote: >> So why can't packaged apps use the bundle Python too? From some of >> the other emails I got the idea that Python was unusable without the >> BSD layer installed, > > There's a python startup script in the package created by > bundle-builder that sets a couple of environment variables and invokes > python to run the bundled script. It is solely in order to run this > script that the BSD environment needs to be installed. It could > easily be replaced with a /bin/sh script if it was considered > important to support users who didn't have /usr/bin/python installed > already. That's the only change that would be required. No, /bin/sh doesn't provide the execve functionality required. Perl might, though, but it's not worth doing when your application is going to fall over silently anyway if the BSD subsystem is not there. > The last time I brought this up, Bob Ippolito explained that this > would make it impossible to use the bundled app as a "regular" app > from both the Finder and the command line, but I never really > appreciated that point. It sounded like bundle-builder2 would > eliminate the problem in a more robust way, so it didn't seem worth > pursuing. But, if I was going to ship an app based on the current > bundle-builder, I would definitely hack it to use a shell startup > script instead of the python script. No, you should use the executable stub I developed instead. Even if you could find another suitable surrogate scripting language to do the dance, it would silently pass errors to the console, where my stub allows GUI reporting and customized error handling with a lot of nice features that you'd want when shipping a python-dependent application. -bob From mlpollard at earthlink.net Tue May 11 19:08:56 2004 From: mlpollard at earthlink.net (Tom Pollard) Date: Tue May 11 19:07:00 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <11C9181D-A39A-11D8-BCDD-000A95686CD8@redivi.com> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> <11C9181D-A39A-11D8-BCDD-000A95686CD8@redivi.com> Message-ID: <2DBFE86C-A3A0-11D8-8586-000A959B24A6@earthlink.net> On May 11, 2004, at 6:25 PM, Bob Ippolito wrote: > On May 11, 2004, at 4:51 PM, Tom Pollard wrote: >> There's a python startup script in the package created by >> bundle-builder that sets a couple of environment variables and >> invokes python to run the bundled script. It is solely in order to >> run this script that the BSD environment needs to be installed. It >> could easily be replaced with a /bin/sh script if it was considered >> important to support users who didn't have /usr/bin/python installed >> already. That's the only change that would be required. > > No, /bin/sh doesn't provide the execve functionality required. Yes, I've heard you mention this execve issue, but I still don't appreciate what the issue is. My introduction to bundle-builder was through the BitPim project , which distributes a Mac executable built with bundle-builder. Replacing the python startup script with a /bin/sh script in the BitPim bundle seemed to work fine, that is, the app still starts up correctly when double-clicked in the Finder, and that's the only thing that needs to work in this case. > Perl might, though, but it's not worth doing when your application is > going to fall over silently anyway if the BSD subsystem is not there. My clear impression was that a standalone executable built by bundle-builder should no longer need anything from the BSD package, once started up. It's just to execute that first startup script that the BSD installation is required. Also, the BSD 'subsystem' is there whether you install the BSD package, or not. Things like bash, awk, sed, perl, etc., are all part of the core BaseSystem package. The optional BSD package just installs additional components (like /usr/bin/python) that are useful for working from the Terminal. So, why would you expect your app to fall over silently if the BSD package hadn't been installed? >> The last time I brought this up, Bob Ippolito explained that this >> would make it impossible to use the bundled app as a "regular" app >> from both the Finder and the command line, but I never really >> appreciated that point. It sounded like bundle-builder2 would >> eliminate the problem in a more robust way, so it didn't seem worth >> pursuing. But, if I was going to ship an app based on the current >> bundle-builder, I would definitely hack it to use a shell startup >> script instead of the python script. > > No, you should use the executable stub I developed instead. Even if > you could find another suitable surrogate scripting language to do the > dance, it would silently pass errors to the console, where my stub > allows GUI reporting and customized error handling with a lot of nice > features that you'd want when shipping a python-dependent application. Ok, it sounds like, if I actually did have a python app to distribute, I'd be stupid not to take advantage of this, then. Tom From bob at redivi.com Tue May 11 19:16:37 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 19:16:45 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <2DBFE86C-A3A0-11D8-8586-000A959B24A6@earthlink.net> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> <11C9181D-A39A-11D8-BCDD-000A95686CD8@redivi.com> <2DBFE86C-A3A0-11D8-8586-000A959B24A6@earthlink.net> Message-ID: <4056780A-A3A1-11D8-BCDD-000A95686CD8@redivi.com> On May 11, 2004, at 7:08 PM, Tom Pollard wrote: > > On May 11, 2004, at 6:25 PM, Bob Ippolito wrote: >> On May 11, 2004, at 4:51 PM, Tom Pollard wrote: >>> There's a python startup script in the package created by >>> bundle-builder that sets a couple of environment variables and >>> invokes python to run the bundled script. It is solely in order to >>> run this script that the BSD environment needs to be installed. It >>> could easily be replaced with a /bin/sh script if it was considered >>> important to support users who didn't have /usr/bin/python installed >>> already. That's the only change that would be required. >> >> No, /bin/sh doesn't provide the execve functionality required. > > Yes, I've heard you mention this execve issue, but I still don't > appreciate what the issue is. My introduction to bundle-builder was > through the BitPim project , which > distributes a Mac executable built with bundle-builder. Replacing the > python startup script with a /bin/sh script in the BitPim bundle > seemed to work fine, that is, the app still starts up correctly when > double-clicked in the Finder, and that's the only thing that needs to > work in this case. It's possible that it works for that app, but it doesn't do what it's supposed to be doing. When finder starts an app it assigns a process serial number to that pid, if you don't use execve then the pid changes. There's a lot of funny things that can happen if you don't obey all the rules. For example, maybe you can start more than one simultaneous instance of BitPim, or some obscure things fail. I try not to follow the "whatever works" philosophy when developing software if I can avoid it :) >> Perl might, though, but it's not worth doing when your application is >> going to fall over silently anyway if the BSD subsystem is not there. > > My clear impression was that a standalone executable built by > bundle-builder should no longer need anything from the BSD package, > once started up. It's just to execute that first startup script that > the BSD installation is required. --semi-standalone depends on an existing Python.framework, which is in the BSD package. --standalone is not dependent on the BSD subsystem (other than the startup script). > Also, the BSD 'subsystem' is there whether you install the BSD > package, or not. Things like bash, awk, sed, perl, etc., are all part > of the core BaseSystem package. The optional BSD package just > installs additional components (like /usr/bin/python) that are useful > for working from the Terminal. > > So, why would you expect your app to fall over silently if the BSD > package hadn't been installed? A completely standalone app that includes Python wouldn't (with a proper executable stub), but that's not really what we were talking about... or at least not what I was talking about. -bob From jay at heynow.com Tue May 11 21:06:24 2004 From: jay at heynow.com (Jay Koutavas) Date: Tue May 11 21:06:15 2004 Subject: [Pythonmac-SIG] Debugging a MacPython Carbon module from CW9? In-Reply-To: <700E8EB6-A27B-11D8-AC07-000A958D1666@cwi.nl> References: <700E8EB6-A27B-11D8-AC07-000A958D1666@cwi.nl> Message-ID: Thanks for the reply Jack. Oddly enough, the breakpoints would end up taking if I opened the MSL projects before trying to run the debug. It's kinda weird, but it worked. /Jay At 2:13 PM +0200 on 5/10/04, Jack Jansen wrote: >On 8-mei-04, at 6:29, Jay Koutavas wrote: > >>Hi folks. >> >>The product I'm developing for requires I do some implementation >>using MacPython 2.2.3 running on Carbon (it's got the >>GUSI2-for-Carbon package). (Not on 2.3 because the customer's >>extensive crossplatform python code base is 2.2 dependent) (and not >>native OS X Python cuz it has to run on Mac OS 9 too.) >> >>The client's application embeds python via PythonCoreCarbon and >>through various .py files imports a few dozen modules of their >>devising, some are C++-based shared libraries. There's a bug in one >>of these shared libraries, and for the life of me, I'm not getting >>my breakpoint to stick in the shared library so I can have a look. >>I've added the shared library to 'Other Executables' in the main >>app's settings, which works great for debugging the >>PythonCoreCarbon shared library, but doesn't do much of anything >>for debugging module shared libs. Of course I have the module's >>shared library project file open at launch/debug time. But alas, no >>joy. > >What I used to do (but this was a couple of CodeWarriors ago) was >setting the "hosting application" (or some such term, I don't have >CW on this machine so can't check) for the dynamic module to Python. >Then, when you press the run button (in the debugger for the dynamic >module) it would start python and sit waiting for the module to be >loaded. >-- >Jack Jansen, , http://www.cwi.nl/~jack >If I can't dance I don't want to be part of your revolution -- Emma Goldman > > >_______________________________________________ >Pythonmac-SIG maillist - Pythonmac-SIG@python.org >http://mail.python.org/mailman/listinfo/pythonmac-sig -- ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' Jay Koutavas mailto:jay@heynow.com Heynow Software http://www.heynow.com Windham, New Hampshire, USA ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' From mlpollard at earthlink.net Tue May 11 21:14:24 2004 From: mlpollard at earthlink.net (Tom Pollard) Date: Tue May 11 21:12:27 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: <4056780A-A3A1-11D8-BCDD-000A95686CD8@redivi.com> References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> <11C9181D-A39A-11D8-BCDD-000A95686CD8@redivi.com> <2DBFE86C-A3A0-11D8-8586-000A959B24A6@earthlink.net> <4056780A-A3A1-11D8-BCDD-000A95686CD8@redivi.com> Message-ID: On May 11, 2004, at 7:16 PM, Bob Ippolito wrote: >>> No, /bin/sh doesn't provide the execve functionality required. >> >> Yes, I've heard you mention this execve issue, but I still don't >> appreciate what the issue is. My introduction to bundle-builder was >> through the BitPim project , which >> distributes a Mac executable built with bundle-builder. Replacing >> the python startup script with a /bin/sh script in the BitPim bundle >> seemed to work fine, that is, the app still starts up correctly when >> double-clicked in the Finder, and that's the only thing that needs to >> work in this case. > > It's possible that it works for that app, but it doesn't do what it's > supposed to be doing. When finder starts an app it assigns a process > serial number to that pid, if you don't use execve then the pid > changes. You can use 'exec' from a Bourne-shell script, too, if preserving the PID of the startup script is the only issue. I thought the problem was something more than that. > There's a lot of funny things that can happen if you don't obey all > the rules. What rules are broken by using a shell script? > For example, maybe you can start more than one simultaneous instance > of BitPim, or some obscure things fail. "Maybe"? How? > I try not to follow the "whatever works" philosophy when developing > software if I can avoid it :) That's admirable, but it's still not clear to me that there are real problems here that demand the use of a python startup script. How is python's 'execve' different from the shell's 'exec'? Tom From bob at redivi.com Tue May 11 21:31:40 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 11 21:31:49 2004 Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? In-Reply-To: References: <397911E4-A37D-11D8-BCDD-000A95686CD8@redivi.com> <40A1258E.5000801@noaa.gov> <20040511201132.GA2524@uiuc.edu> <5F1B4332-A388-11D8-BCDD-000A95686CD8@redivi.com> <20040511202634.GB2798@uiuc.edu> <11C9181D-A39A-11D8-BCDD-000A95686CD8@redivi.com> <2DBFE86C-A3A0-11D8-8586-000A959B24A6@earthlink.net> <4056780A-A3A1-11D8-BCDD-000A95686CD8@redivi.com> Message-ID: <1E4B3CAC-A3B4-11D8-BCDD-000A95686CD8@redivi.com> On May 11, 2004, at 9:14 PM, Tom Pollard wrote: > > On May 11, 2004, at 7:16 PM, Bob Ippolito wrote: >>>> No, /bin/sh doesn't provide the execve functionality required. >>> >>> Yes, I've heard you mention this execve issue, but I still don't >>> appreciate what the issue is. My introduction to bundle-builder was >>> through the BitPim project , which >>> distributes a Mac executable built with bundle-builder. Replacing >>> the python startup script with a /bin/sh script in the BitPim bundle >>> seemed to work fine, that is, the app still starts up correctly when >>> double-clicked in the Finder, and that's the only thing that needs >>> to work in this case. >> >> It's possible that it works for that app, but it doesn't do what it's >> supposed to be doing. When finder starts an app it assigns a process >> serial number to that pid, if you don't use execve then the pid >> changes. > > You can use 'exec' from a Bourne-shell script, too, if preserving the > PID of the startup script is the only issue. I thought the problem > was something more than that. That should be enough, then. Not a Bourne-shell scripter. >> There's a lot of funny things that can happen if you don't obey all >> the rules. > > What rules are broken by using a shell script? > >> For example, maybe you can start more than one simultaneous instance >> of BitPim, or some obscure things fail. > > "Maybe"? How? Maybe as in, I haven't tried it. If you start a new pid and don't keep the PSN information along for the ride and/or don't use LaunchServices to start the application I've noticed things like this can happen. >> I try not to follow the "whatever works" philosophy when developing >> software if I can avoid it :) > > That's admirable, but it's still not clear to me that there are real > problems here that demand the use of a python startup script. How is > python's 'execve' different from the shell's 'exec'? I never said we should use a Python startup script, only that we one is used now and why it was done that way. Whoever wrote the original bundlebuilder must either be insensitive/unaware to the BSD subsystem dependency, and/or not a Bourne-shell scripter. In any case, using a bootstrap script (with any interpreter) should be deprecated entirely. It makes the application start slower, isn't compatible with OS X 10.1, and can't provide error reporting to the GUI. I've solved this problem, and my solution (or something very close to it) should be used in all cases. -bob From chris at fonnesbeck.org Tue May 11 22:18:58 2004 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Tue May 11 22:19:10 2004 Subject: [Pythonmac-SIG] Python editors on OSX Message-ID: Stephanie, Emacs has a good debugger that uses pdb, the built-in python debugging module, which is what I used on Linux, but I have had no luck getting it to work on OSX. In lieu of this, I use either BBEdit or Vim, with pdb for debugging. Of course, none of these are true IDEs, but I have not found any satisfactory ones for Mac. You might try PyOXIDE, which is probably the most polished of the IDEs. Chris -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia "I don't remember any kind of heaviness ruining my time at Yale." George W. Bush, on the civil rights movement -- Putting http://wecanstopspam.org in your email helps it pass through overzealous spam filters. From gandreas at delver.com Wed May 12 10:06:24 2004 From: gandreas at delver.com (Glenn Andreas) Date: Wed May 12 10:06:55 2004 Subject: [Pythonmac-SIG] Minimal Install Results Message-ID: So to see exactly what is available on a "minimal" install (no optional packages at all), I installed a minimal Jaguar install to a spare partition. Python.framework is installed, but it contains nothing useful: [Library/Frameworks/Python.framework] gandreas% ls -lR total 0 drwxr-xr-x 3 root wheel 102 13 Sep 2003 Versions/ ./Versions: total 0 drwxr-xr-x 3 root wheel 102 13 Sep 2003 2.3/ ./Versions/2.3: total 0 drwxr-xr-x 3 root wheel 102 13 Sep 2003 lib/ ./Versions/2.3/lib: total 0 drwxr-xr-x 4 root wheel 136 13 Sep 2003 python2.3/ ./Versions/2.3/lib/python2.3: total 0 drwxr-xr-x 3 root wheel 102 13 Sep 2003 lib-dynload/ drwxr-xr-x 5 root wheel 170 13 Sep 2003 plat-mac/ ./Versions/2.3/lib/python2.3/lib-dynload: total 392 -rwxr-xr-x 1 root wheel 197212 13 Sep 2003 _CoreGraphics.so* ./Versions/2.3/lib/python2.3/plat-mac: total 704 -rw-r--r-- 1 root wheel 46357 11 Sep 2003 CoreGraphics.py -rw-r--r-- 1 root wheel 154270 13 Sep 2003 CoreGraphics.pyc -rw-r--r-- 1 root wheel 154270 13 Sep 2003 CoreGraphics.pyo On the more annoying side, in /usr/bin we get: [OSX3/usr/bin] gandreas% ls -l py* -rwxr-xr-x 1 root wheel 44 13 Sep 2003 pydoc* lrwxr-xr-x 1 root wheel 9 5 Oct 2003 python@ -> python2.3 lrwxr-xr-x 1 root wheel 72 5 Oct 2003 python2.3@ -> ../../System/Library/Frameworks/Python.framework/Versions/2.3/bin/python lrwxr-xr-x 1 root wheel 10 5 Oct 2003 pythonw@ -> pythonw2.3 -rwxr-xr-x 1 root wheel 122 8 Jun 2003 pythonw2.3* So the net result is even worse than expected - there is /usr/bin/python installed, but it can't be run (since there is no interpreter in the framework), and the framework doesn't contain the shared library. So if you test for the existance of /usr/bin/python before running a script, that won't work. If you embed python using the shared framework, it probably won't even launch correctly since the shared binary isn't there. So Bob's careful safety net for PyObjC won't work either unless you make sure to weak-link the framework (I'm not sure how doable that is, since I though weak-linking was on a per-symbol basis, so all the symbols for Python would need to be weak-linked). -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From ronaldoussoren at mac.com Wed May 12 10:14:51 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Wed May 12 10:14:56 2004 Subject: [Pythonmac-SIG] Minimal Install Results In-Reply-To: References: Message-ID: On 12-mei-04, at 16:06, Glenn Andreas wrote: > > So if you test for the existance of /usr/bin/python before running a > script, that won't work. If you embed python using the shared > framework, it probably won't even launch correctly since the shared > binary isn't there. So Bob's careful safety net for PyObjC won't work > either unless you make sure to weak-link the framework (I'm not sure > how doable that is, since I though weak-linking was on a per-symbol > basis, so all the symbols for Python would need to be weak-linked). PyMacApp explicitely loads the python framework at runtime, you will get a niceish error message (in the console window). BTW. It is not a "careful safetynet for PyObjC", the solution is meant as a general bundle-runner for python-based .app's. Ronald From b.prior at ieee.org Wed May 12 10:26:49 2004 From: b.prior at ieee.org (Bruce Prior) Date: Wed May 12 10:25:31 2004 Subject: [Fwd: Re: [Pythonmac-SIG] Optional BSD package is required for (useable) Python?] Message-ID: <40A23429.20803@ieee.org> I read PythonMac-SIG regularly but certainly aren't an expert in these things. However, the recent discussion on the "optional BSD layer" has me unnerved. I thought Mac OS X was based on BSD, but probably I'm missing the point. What simple check can I do to establish if I have the BSD Layer? Bruce Prior -------- Original Message -------- Subject: Re: [Pythonmac-SIG] Optional BSD package is required for (useable) Python? Date: Tue, 11 May 2004 07:42:12 -0700 From: Paul Berkowitz To: PythonMac How many people do you know who don't install the BSD layer? And how many of those are non-geeks who couldn't easily go back and install it? You don't have to worry about geeks. I can't imagine there's any OP who does a Custom Install of OS X, chooses not to install BSD, and then needs Python. -- Paul Berkowitz > From: Glenn Andreas > Date: Tue, 11 May 2004 09:35:36 -0500 > To: > Subject: [Pythonmac-SIG] Optional BSD package is required for (useable) > Python? > > From a newgroup post this morning, it appears that /usr/bin/python > isn't installed by default on 10.3 unless the user installs the > optional BSD layer. But as near as I can tell by using lsbom, > Python.framework _is_ installed, but only the headers and shared > library - none of the ".py" file (so none of the site files, nothing). > > Doesn't this limit the advantage of having Python.framework? After > all, all you can do is link in the shared library - you can't really > do much with it from your app, and you can't write any python scripts > (or apps using PyObjC) without have the optional BSD layer installed, > so I'm not sure what the point of having Python.framework installed. > > Any idea who we'll need to bribe at WWDC to get the rest of the stuff > in the default layer? > > -- > Glenn Andreas gandreas@gandreas.com > mondo blobbo, Cythera, Theldrow, oh my! > Mad, Bad, and Dangerous to Know > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- -------------- next part -------------- _______________________________________________ Pythonmac-SIG maillist - Pythonmac-SIG@python.org http://mail.python.org/mailman/listinfo/pythonmac-sig From mlpollard at earthlink.net Wed May 12 11:17:36 2004 From: mlpollard at earthlink.net (Tom Pollard) Date: Wed May 12 11:15:40 2004 Subject: [Fwd: Re: [Pythonmac-SIG] Optional BSD package is required for (useable) Python?] In-Reply-To: <40A23429.20803@ieee.org> References: <40A23429.20803@ieee.org> Message-ID: <7FC5C16C-A427-11D8-8586-000A959B24A6@earthlink.net> On May 12, 2004, at 10:26 AM, Bruce Prior wrote: > I read PythonMac-SIG regularly but certainly aren't an expert in these > things. However, the recent discussion on the "optional BSD layer" has > me unnerved. I thought Mac OS X was based on BSD, but probably I'm > missing the point. The BSD layer is always there. Basic, portable unix shell scripts are always usable, even on a minimal-install machine. However, there's an optional BSD package that adds additional components not required for the functioning of the core OS. > What simple check can I do to establish if I have the BSD Layer? If someone has installed the BSD package, there'll be a BSD.pkg bundle in /Library/Receipts. The basic BSD layer comes from the BaseSystem package. If you want to see what files any of these packages install, you can use the 'lsbom' command to list the contents of the .bom file for the package, for instance, /usr/bin/lsbom /Library/Receipts/BSD.pkg/Contents/Archive.bom Maybe there's another file whose presence you could use as a sign that the components you need have been installed, but I couldn't say what it might be. Tom Pollard From pecora at anvil.nrl.navy.mil Wed May 12 12:21:14 2004 From: pecora at anvil.nrl.navy.mil (Louis M. Pecora) Date: Wed May 12 12:20:55 2004 Subject: [Pythonmac-SIG] Python editors on OSX In-Reply-To: <64860.69.55.173.180.1084373019.squirrel@mail.zettai.net> References: <64516.69.55.173.180.1084370197.s quirrel@mail.zettai.net> <64860.69.55.173.180.1084373019.squirrel@mail.zettai.net> Message-ID: >I must have mine misconfigured then, because my source code window has 2 >buttons: "run all" and "run selection" ... nothing else. > >I would love to use the IDE if it has these features. > >C. Strange. This feature has been in the MacPython IDE since I can remember (several years). I have it running in OS X 10.2.8 and the IDE is version 1.01 (hardly changed). I'm not sure why you don't see it. Oh, wait. You are talking about the "run all" and "run selection" buttons on top. I mean the little right-arrow near the upper-right-hand corner (did I mix up left and right in my previous message?). Click on that arrow, then you will see several selections including "Enable Debugger" Note, there is also a profiler and some other useful tools. -- Cheers, Lou Pecora From pecora at anvil.nrl.navy.mil Wed May 12 12:26:10 2004 From: pecora at anvil.nrl.navy.mil (Louis M. Pecora) Date: Wed May 12 12:25:51 2004 Subject: [Pythonmac-SIG] Python editors on OSX In-Reply-To: <64963.69.55.173.180.1084374367.squirrel@mail.zettai.net> References: <64516.69.55.173.180.1084370197.s quirrel@mail.zettai.net> <64963.69.55.173.180.1084374367.squirrel@mail.zettai.net> Message-ID: > >In Vim (which is just vi), I have a script that runs the current buffer. > >Another good choice, actually, is jEdit. It has nice IDE features like >syntax highlighting, folding and a debugger. See attached screen shot. > >C. Well, jEdit looks pretty spiffy. Will have to check it out. OT: I see you use SciPy. Do you like it. Bigger question: how hard was it to get up and running on your Mac? I think I looked at it once and it required a lot of other packages. Maybe I'm mis-remembering. Anyway, your take on SciPy is of interest. Thanks. -- Cheers, Lou Pecora From altis at semi-retired.com Wed May 12 12:53:23 2004 From: altis at semi-retired.com (Kevin Altis) Date: Wed May 12 12:53:27 2004 Subject: [Pythonmac-SIG] wxPython and IDE issues In-Reply-To: References: Message-ID: On May 11, 2004, at 1:36 PM, Stephanie Schaeffer wrote: > I'm just new to Python, having been a Lisp hacker for many years. > I'm trying to convert an application I have in MCL Common Lisp to > Python. I wonder if someone who has been through some of the following > hurdles can help me out a bit. > > 1) What is a good IDE to use on the Mac (I have Panther) when you > are using wx? The IDE that comes with MacPython doesn't work with wx. > I am currently using Dr.Python, but would like a more helpful > debugger. > 2) In MCL lisp, I could create windows interactively and see things > happen. I can't seem to do that with Python (and wx). It seems to want > to create an application which is then only event driven, and my > interactive window where I type in text is ignored until the > application stops. Am I missing something here? I am doing this from > DrPython. I'd like to be able to interactively create a window, and > then call routines to add shapes to it, etc. Preferably without having > to implement a separate "listener" of my own. > > Should I use a different GUI package? A different IDE? Or am I just > asking too much of Python at this stage of its development (especially > on a Mac). > > Any help would be more than welcome! > > Thanks so much, > Steph Schaeffer > University of Alberta > steph@cs.ualberta.ca > For the runtime aspects you're looking for, the closest you'll probably come is PythonCard; the framework uses wxPython. It has a variety of tools: Shell, Namespace Viewer, Message Watcher, and Property Editor. You can certainly create objects and manipulate them at runtime, though that isn't generally that useful except for experimentation since the objects you create at runtime won't automatically be persisted when you quit the app unless you write a little handler to do that for you. You can also bind events dynamically. Manipulating objects at runtime though is standard fare and one of the things PythonCard does pretty well. You can continue to use whatever editor environment you want or use the codeEditor that comes with PythonCard, just be aware that it doesn't have any debugger support right now. The runtime shell and other tools reduce the need for a debugger, so it keeps falling off the priority list http://pythoncard.sourceforge.net/ I don't know if PyObjC has a wrapper shell around the Python interpreter that can be included with any PyOjbC app. If not, then that would be a nice addition. ka From bob at redivi.com Wed May 12 13:00:32 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed May 12 13:00:44 2004 Subject: [Pythonmac-SIG] wxPython and IDE issues In-Reply-To: References: Message-ID: On May 12, 2004, at 12:53 PM, Kevin Altis wrote: > On May 11, 2004, at 1:36 PM, Stephanie Schaeffer wrote: > >> I'm just new to Python, having been a Lisp hacker for many years. >> I'm trying to convert an application I have in MCL Common Lisp to >> Python. I wonder if someone who has been through some of the >> following hurdles can help me out a bit. >> >> 1) What is a good IDE to use on the Mac (I have Panther) when you >> are using wx? The IDE that comes with MacPython doesn't work with wx. >> I am currently using Dr.Python, but would like a more helpful >> debugger. >> 2) In MCL lisp, I could create windows interactively and see things >> happen. I can't seem to do that with Python (and wx). It seems to >> want to create an application which is then only event driven, and my >> interactive window where I type in text is ignored until the >> application stops. Am I missing something here? I am doing this from >> DrPython. I'd like to be able to interactively create a window, and >> then call routines to add shapes to it, etc. Preferably without >> having to implement a separate "listener" of my own. >> >> Should I use a different GUI package? A different IDE? Or am I just >> asking too much of Python at this stage of its development >> (especially on a Mac). >> >> Any help would be more than welcome! >> >> Thanks so much, >> Steph Schaeffer >> University of Alberta >> steph@cs.ualberta.ca >> > For the runtime aspects you're looking for, the closest you'll > probably come is PythonCard; the framework uses wxPython. It has a > variety of tools: Shell, Namespace Viewer, Message Watcher, and > Property Editor. You can certainly create objects and manipulate them > at runtime, though that isn't generally that useful except for > experimentation since the objects you create at runtime won't > automatically be persisted when you quit the app unless you write a > little handler to do that for you. You can also bind events > dynamically. Manipulating objects at runtime though is standard fare > and one of the things PythonCard does pretty well. You can continue to > use whatever editor environment you want or use the codeEditor that > comes with PythonCard, just be aware that it doesn't have any debugger > support right now. The runtime shell and other tools reduce the need > for a debugger, so it keeps falling off the priority list > > http://pythoncard.sourceforge.net/ > > I don't know if PyObjC has a wrapper shell around the Python > interpreter that can be included with any PyOjbC app. If not, then > that would be a nice addition. It does, it's distributed as the PyInterpreter example. -bob From gandreas at delver.com Wed May 12 16:05:17 2004 From: gandreas at delver.com (Glenn Andreas) Date: Wed May 12 16:05:56 2004 Subject: [Pythonmac-SIG] ANN: PyOXIDE 0.6.1 - Cocoa based Python IDE Message-ID: PyOXIDE 0.6.1 is now available for abuse, with a bunch of minor (yet nice) features & bug fixes. There is now a usable auto-completion and call tips (which work best in the interactive window, since there is a "live context" for it to look through, but it will try to do it's best on editor windows as well), a simple but much nicer way to show syntax errors (move the selection to the error, bring up a floating tool-tip style with the error), and some fixes for debugging external processes (I've actually been able to debug a Tkinter app using it - in theory, it should work for things like wxPython and pygame apps as well - there's still a long ways to go, but it's one step closer). See the release notes for more details. PyOXIDE 0.6.1 has only been tested with 10.3, but should work with 10.2 (assuming it can find the python framework). The sources are built using XCode 1.1 on 10.3, but again, probably would compile on 10.2 with Project Builder (since they haven't been converted yet to XCode native projects). PyOXIDE 0.6.1 is now available on my idisk (as PyOXIDE_0.6.1.dmg): from the pather finder, "connect to other public folder" and type in "gandreas" or http://projects.gandreas.com/pyoxide/ If you want to build from source, you'll need to get PyOXIDE_Src_0.6.1.dmg, and IDEKit_0.2.1.dmg (also built XCode 1.1 on 10.3 but should build with ProjectBuilder on 10.2). IDEKit_0.2.1.dmg is found either on the idisk above or PyOXIDE source is covered under a BSD-style license. The IDEKit framework is covered under LGPL, so you can freely link it in other projects. At some point in the not-too-distant future, both with be converted to XCode native projects (and thus require 10.3 to build from source). Retaining compatibility for 10.2, however, is an important goal. If you have problems, questions, enhancment request, etc, please submit request at (hopefully it should work - you'll have to make a new account, but the PyOXIDE database is publically available), and feel free to post questions/comments/public discussion to -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From rowen at cesmail.net Thu May 13 19:29:13 2004 From: rowen at cesmail.net (Russell E. Owen) Date: Thu May 13 19:29:20 2004 Subject: [Pythonmac-SIG] Re: urllib and ftplib hang in bundle but not when run directly References: Message-ID: In article , "Russell E. Owen" wrote: >I am having trouble with some ftp code. On some platforms it works fine >and on others it reliably hangs....(including MacOS X command-line >it works, but a bundled app version of the identical code fails) After some experimentation, I found the hanging was occurring in ftplib. It delays importing re and compiling two regular expressions until they are needed, and the thread hangs both on the import and (if I modify ftplib to import re in advance) on the compilation. Modifying ftplib to do both jobs in advance (when first imported) fixes the problem. It seems strange to me that a thread could hang indefinitely trying to perform these two tasks when the rest of the app seems to be running fine. Perhaps the thread is simply being starved of cpu cycles, but then it seems odd that the thread has enough cycles to print diagnostics and do network communication. Anyway, I can work around the problem by using ftplib directly instead of using urllib, and importing my own patched ftplib. But I'm wondering if anyone has any better suggestions. -- Russell From jerry.levan at eku.edu Thu May 13 20:30:00 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Thu May 13 20:30:04 2004 Subject: [Pythonmac-SIG] PIL and jpeg on MacOS X Message-ID: I don't seem to know the proper magical incantation to get PIL to work with jpegs. Today I installed the MacOS X Additions to my Mac running 10.3.3. I have already installed and use the Batteries Included Aqua Tcl/Tk 8.4.5 I first tried some Tkinter examples ( after loading Tkinter from the Configure Manager. Tkinter seems to work ok. I tried adding PIL and noticed that jpegs did not work. I then realized that libjpeg was not installed. I installed libjpeg.dylib in /usr/local/bin tore out the old PIL and asked config manager to reinstall...( I have to do the actual install as root...) Everything seems there but any jpeg operation fails generally with an error traceback File "imageview.py", line 13, in ? main() File "imageview.py", line 8, in main img = PhotoImage(file=filename) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageTk.py", line 114, in __init__ self.paste(image) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageTk.py", line 164, in paste im.load() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageFile.py", line 165, in load d = Image._getdecoder(self.mode, d, a, self.decoderconfig) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/Image.py", line 309, in _getdecoder raise IOError("decoder %s not available" % decoder_name) IOError: decoder jpeg not available What am I doing wrong? Jerry From mozumder at dsmpro.com Thu May 13 23:21:47 2004 From: mozumder at dsmpro.com (Bobby Mozumder) Date: Thu May 13 23:21:49 2004 Subject: [Pythonmac-SIG] Embedded Interpreter not initilized? Version mismatch? Message-ID: I've built an app that contains an embedded Python interpreter. This is on MacOSX. The python interpreter I've embedded isn't the one that came with my installation of OSX 10.3.3, but is instead from the latest release 2.3.4rc1 that I've compiled and installed as a Framework in /Library/Frameworks/Python.framework/Versions/2.3. (I wish I could have used the default MacOSX version of Python, but I couldn't find a libPython2.3.a object file anywhere that I could link to?) So now I get this message: Fatal Python error: Interpreter not initialized (version mismatch?) Abort My guess is that this is caused by my embedded Python interpreter thinking it is still using the MacOSX install rather than the new one in /Library/Frameworks/Python.framework. (??) Is there a way to get the interpreter started? What is causing this message? Thanks, -bobby From mozumder at dsmpro.com Thu May 13 23:28:08 2004 From: mozumder at dsmpro.com (Bobby Mozumder) Date: Thu May 13 23:28:10 2004 Subject: [Pythonmac-SIG] Re: Embedded Interpreter not initilized? Version mismatch? In-Reply-To: References: Message-ID: OK Nevermind I found out how to remove the older python installation from the FAQ. -bobby On May 13, 2004, at 11:21 PM, Bobby Mozumder wrote: > I've built an app that contains an embedded Python interpreter. This > is on MacOSX. The python interpreter I've embedded isn't the one that > came with my installation of OSX 10.3.3, but is instead from the > latest release 2.3.4rc1 that I've compiled and installed as a > Framework in /Library/Frameworks/Python.framework/Versions/2.3. (I > wish I could have used the default MacOSX version of Python, but I > couldn't find a libPython2.3.a object file anywhere that I could link > to?) > > So now I get this message: > > Fatal Python error: Interpreter not initialized (version mismatch?) > Abort > > My guess is that this is caused by my embedded Python interpreter > thinking it is still using the MacOSX install rather than the new one > in /Library/Frameworks/Python.framework. (??) > > Is there a way to get the interpreter started? What is causing this > message? > > Thanks, > > -bobby > From mww at opendarwin.org Fri May 14 01:41:38 2004 From: mww at opendarwin.org (Markus W. Weissmann) Date: Fri May 14 01:41:52 2004 Subject: [Pythonmac-SIG] mod_python problems Message-ID: <5EAAEC7A-A569-11D8-BF28-000D93AE2252@opendarwin.org> Hi fellow pythonians, I've got some weird problems with mod_python on 10.3: When starting apache2, it crashes and I find the following in the error.log --- [notice] mod_python: Creating 32 session mutexes based on 150 max processes and 0 max threads. dyld: /opt/local/apache2/bin/httpd Undefined symbols: _CFStringConvertEncodingToIANACharSetName _CFStringGetCStringPtr _CFStringGetSystemEncoding _FSMakeFSSpec _FSRefMakePath _FSpMakeFSRef _GetResource _HLock _HUnlock _ReleaseResource --- my python lib and the mod_python.so seem to be linked against the right version of python: $ otool -L /opt/local/apache2/modules/mod_python.so /opt/local/apache2/modules/mod_python.so: /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 71.0.0) /opt/local/lib/libpython2.3.dylib (compatibility version 2.3.0, current version 2.3.0) $ otool -L /opt/local/lib/libpython2.3.dylib /opt/local/lib/libpython2.3.dylib: /opt/local/lib/libpython2.3.dylib (compatibility version 2.3.0, current version 2.3.0) /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 71.0.0) when using Apples python instead, it wont not crash. Is there a way to find out if my python23.dylib is working at all? Suggestions to solve this are welcome... thanks, Markus --- Markus W. Weissmann http://www.mweissmann.de/ http://www.opendarwin.org/~mww/ From drewmccormack at mac.com Fri May 14 02:26:13 2004 From: drewmccormack at mac.com (Drew McCormack) Date: Fri May 14 02:26:27 2004 Subject: [Pythonmac-SIG] PIL and jpeg on MacOS X In-Reply-To: References: Message-ID: <9952D8D6-A56F-11D8-BDC5-0003937B5C28@mac.com> If you install from Bob's repository, the jpeg library is not needed: http://undefined.org/python/pimp/ Drew McCormack On May 14, 2004, at 2:30 AM, Jerry LeVan wrote: > I don't seem to know the proper magical incantation to get > PIL to work with jpegs. > > Today I installed the MacOS X Additions to my Mac running > 10.3.3. I have already installed and use the Batteries Included > Aqua Tcl/Tk 8.4.5 > > I first tried some Tkinter examples ( after loading Tkinter from > the Configure Manager. Tkinter seems to work ok. > > I tried adding PIL and noticed that jpegs did not work. I then > realized that libjpeg was not installed. > > I installed libjpeg.dylib in /usr/local/bin tore out the old PIL > and asked config manager to reinstall...( I have to do the actual > install as root...) Everything seems there but any jpeg operation > fails generally with an error traceback > File "imageview.py", line 13, in ? > main() > File "imageview.py", line 8, in main > img = PhotoImage(file=filename) > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/PIL/ImageTk.py", line 114, in __init__ > self.paste(image) > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/PIL/ImageTk.py", line 164, in paste > im.load() > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/PIL/ImageFile.py", line 165, in load > d = Image._getdecoder(self.mode, d, a, self.decoderconfig) > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/site-packages/PIL/Image.py", line 309, in _getdecoder > raise IOError("decoder %s not available" % decoder_name) > IOError: decoder jpeg not available > > What am I doing wrong? > > Jerry > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > Trade Strategist Stock market strategy design software http://www.trade-strategist.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2799 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040514/dacf2c91/attachment.bin From mwh at python.net Fri May 14 06:56:24 2004 From: mwh at python.net (Michael Hudson) Date: Fri May 14 06:56:31 2004 Subject: [Pythonmac-SIG] Re: urllib and ftplib hang in bundle but not when run directly In-Reply-To: (Russell E. Owen's message of "Thu, 13 May 2004 16:29:13 -0700") References: Message-ID: <2mvfizjmzr.fsf@starship.python.net> "Russell E. Owen" writes: > In article , > "Russell E. Owen" wrote: > >>I am having trouble with some ftp code. On some platforms it works fine >>and on others it reliably hangs....(including MacOS X command-line >>it works, but a bundled app version of the identical code fails) > > After some experimentation, I found the hanging was occurring in ftplib. > It delays importing re and compiling two regular expressions until they > are needed, and the thread hangs both on the import and (if I modify > ftplib to import re in advance) on the compilation. Modifying ftplib to > do both jobs in advance (when first imported) fixes the problem. Um. Python has an 'import lock' so only one thread can be importing a module at the same time. Do you have code like this: def main(): .... main() i.e. that does things as a result of being imported? You should stop that :-) Cheers, mwh -- well, take it from an old hand: the only reason it would be easier to program in C is that you can't easily express complex problems in C, so you don't. -- Erik Naggum, comp.lang.lisp From whesse at clarkson.edu Fri May 14 01:20:30 2004 From: whesse at clarkson.edu (William Hesse) Date: Fri May 14 08:28:28 2004 Subject: [Pythonmac-SIG] Broken link at python.org breaks packman Message-ID: On May 14 2004 I installed the MacPython-Panther-2.3-2 addons to OS X 10.3 on my new laptop. When the package manager starts, it fails with a 404 not found message, for the URL http://www.python.org/packman/version-0.3/darwin-7.3.1-Power_Macintosh.plist When I look at the website, it has a http://www.python.org/packman/version-0.3/darwin-7.3.0-Power_Macintosh.plist , but not a 7.3.1. I'm going to try replacing 7.3.1 with 7.3.0 in the source, if I can find it. Does anyone have any suggestions? Bill Hesse Computer Science Department Clarkson University whesse@clarkson.edu From owen at astro.washington.edu Fri May 14 12:10:35 2004 From: owen at astro.washington.edu (Russell E Owen) Date: Fri May 14 12:33:49 2004 Subject: [Pythonmac-SIG] Re: urllib and ftplib hang in bundle but not when run directly In-Reply-To: <2mvfizjmzr.fsf@starship.python.net> References: <2mvfizjmzr.fsf@starship.python.net> Message-ID: At 11:56 AM +0100 5/14/04, Michael Hudson wrote: >"Russell E. Owen" writes: > >> In article , >> "Russell E. Owen" wrote: >> >>>I am having trouble with some ftp code. On some platforms it works fine >>>and on others it reliably hangs....(including MacOS X command-line >>>it works, but a bundled app version of the identical code fails) >> >> After some experimentation, I found the hanging was occurring in ftplib. >> It delays importing re and compiling two regular expressions until they >> are needed, and the thread hangs both on the import and (if I modify >> ftplib to import re in advance) on the compilation. Modifying ftplib to >> do both jobs in advance (when first imported) fixes the problem. > >Um. Python has an 'import lock' so only one thread can be importing a >module at the same time. > >Do you have code like this: > >def main(): > .... > >main() > >i.e. that does things as a result of being imported? You should stop >that :-) It's an interesting idea. I didn't know about any import lock (just the global interpreter lock, which I doubt is relevant). I do have code like this: def _createMyConst(): ... _MyConst = _creatMyConst() that runs as a result of being imported. I thought that was normal python -- initialization can safely be done when the module is imported. I don't understand why that is considered dangerous or how it could run afoul of an importer lock. Also, my own code has fully loaded and finished initializing well before I try any ftp transfers and run into the problem. The hang occurs inside ftplib itself. I use it to fetch a file in a separate (background) thread. If "too much other stuff" is going on, that thread hangs. With ftplib as written, it hangs while executing "import re" (which is only done once the ftp starts). If I modify ftplib to import re right away at the beginning, then the thread hangs in ftplib compiling a regular expression. Modifying ftplib to pre-compile the two regular expressions it uses makes it stop hanging and my code starts working again. It seems strange to me that a thread could either work fine or 100% totally hang like that. It always works fine when run on MacOS X (when run as a command-line app). It always hangs forever when the identical code is run as a macOS X bundled app or when run on RedHat linux. When the same code is run as part of a smaller app, it runs fine on linux. -- Russell From bob at redivi.com Fri May 14 09:09:45 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri May 14 12:48:49 2004 Subject: [Pythonmac-SIG] Broken link at python.org breaks packman In-Reply-To: References: Message-ID: On May 14, 2004, at 1:20 AM, William Hesse wrote: > On May 14 2004 I installed the MacPython-Panther-2.3-2 addons to > OS X 10.3 on my new laptop. When the package manager starts, it fails > with a 404 not found message, for the URL > http://www.python.org/packman/version-0.3/darwin-7.3.1- > Power_Macintosh.plist > > When I look at the website, it has a > http://www.python.org/packman/version-0.3/darwin-7.3.0- > Power_Macintosh.plist > , but not a 7.3.1. I'm going to try replacing 7.3.1 with 7.3.0 in the > source, if I can find it. Does anyone have any suggestions? That version number is pulled from sysctl, so don't bother changing it in the source. Just specify it manually with "Open URL" from packman until Jack updates the links. -bob From jerry.levan at eku.edu Fri May 14 15:18:59 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Fri May 14 15:19:03 2004 Subject: [Pythonmac-SIG] Jpeg still broken? Message-ID: <8D4AA3A0-A5DB-11D8-8F22-000393779D9C@eku.edu> Well I installed the PIL located at http://undefined.org/python/pimp/ and now when I run one of the demo scripts: # # The Python Imaging Library # $Id: //modules/pil/Scripts/viewer.py#2 $ # from Tkinter import * import Image, ImageTk # # an image viewer class UI(Label): def __init__(self, master, im): if im.mode == "1": # bitmap image self.image = ImageTk.BitmapImage(im, foreground="white") Label.__init__(self, master, image=self.image, bg="black", bd=0) else: # photo image self.image = ImageTk.PhotoImage(im) Label.__init__(self, master, image=self.image, bd=0) # # script interface if __name__ == "__main__": import sys if not sys.argv[1:]: print "Syntax: python viewer.py imagefile" sys.exit(1) filename = sys.argv[1] root = Tk() root.title(filename) im = Image.open(filename) UI(root, im).pack() ******** I get: [macjerry:~/python]$ python Viewer.py FixedColor.JPEG Traceback (most recent call last): File "Viewer.py", line 44, in ? UI(root, im).pack() File "Viewer.py", line 23, in __init__ self.image = ImageTk.PhotoImage(im) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageTk.py", line 114, in __init__ self.paste(image) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/site-packages/PIL/ImageTk.py", line 179, in paste import _imagingtk ImportError: No module named _imagingtk Any suggestions? Jerry From bob at redivi.com Fri May 14 15:33:49 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri May 14 15:34:05 2004 Subject: [Pythonmac-SIG] Jpeg still broken? In-Reply-To: <8D4AA3A0-A5DB-11D8-8F22-000393779D9C@eku.edu> References: <8D4AA3A0-A5DB-11D8-8F22-000393779D9C@eku.edu> Message-ID: <9FCD7C18-A5DD-11D8-B3EC-000A95686CD8@redivi.com> On May 14, 2004, at 3:18 PM, Jerry LeVan wrote: > Well I installed the PIL located at http://undefined.org/python/pimp/ > and now when I run one of the demo scripts: > # > # The Python Imaging Library > # $Id: //modules/pil/Scripts/viewer.py#2 $ > # ---- > ImportError: No module named _imagingtk > > Any suggestions? _imagingtk is not supported on OS X. At least not by me! :) -bob From jerry.levan at eku.edu Fri May 14 17:08:39 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Fri May 14 17:08:54 2004 Subject: [Pythonmac-SIG] Jpeg still broken? In-Reply-To: <9FCD7C18-A5DD-11D8-B3EC-000A95686CD8@redivi.com> References: <8D4AA3A0-A5DB-11D8-8F22-000393779D9C@eku.edu> <9FCD7C18-A5DD-11D8-B3EC-000A95686CD8@redivi.com> Message-ID: Hi Bob, I noticed that ImageTk.py was in your package... At this point I need ImageTk inorder to view jpgs, at least that is the only way I can think to view the rascals... How did you get the jpg stuff to work? I never could figure out how to build PIL ;( I have a static libjpeg.a and a libjpeg.dylib in usr/local. Jerry On May 14, 2004, at 3:33 PM, Bob Ippolito wrote: > > On May 14, 2004, at 3:18 PM, Jerry LeVan wrote: > >> Well I installed the PIL located at http://undefined.org/python/pimp/ >> and now when I run one of the demo scripts: >> # >> # The Python Imaging Library >> # $Id: //modules/pil/Scripts/viewer.py#2 $ >> # > ---- >> ImportError: No module named _imagingtk >> >> Any suggestions? > > _imagingtk is not supported on OS X. At least not by me! :) > > -bob > From bob at redivi.com Fri May 14 17:24:11 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri May 14 17:24:15 2004 Subject: [Pythonmac-SIG] Jpeg still broken? In-Reply-To: References: <8D4AA3A0-A5DB-11D8-8F22-000393779D9C@eku.edu> <9FCD7C18-A5DD-11D8-B3EC-000A95686CD8@redivi.com> Message-ID: <0ABBF680-A5ED-11D8-B3EC-000A95686CD8@redivi.com> You can use PyObjC (use Cocoa's NSImage directly, don't even need PIL) or you can use pygame. I didn't remove any code from PIL, but I just did not compile _imagingtk. If you compile it yourself, _imagingtk will also not compile.. but I compiled it in the way that PIL is documented, with one patch for enhanced TIFF support. -bob On May 14, 2004, at 5:08 PM, Jerry LeVan wrote: > Hi Bob, > > I noticed that ImageTk.py was in your package... > > At this point I need ImageTk inorder to view jpgs, > at least that is the only way I can think to view the > rascals... > > How did you get the jpg stuff to work? I never could > figure out how to build PIL ;( I have a static > libjpeg.a and a libjpeg.dylib in usr/local. > > Jerry > On May 14, 2004, at 3:33 PM, Bob Ippolito wrote: > >> >> On May 14, 2004, at 3:18 PM, Jerry LeVan wrote: >> >>> Well I installed the PIL located at http://undefined.org/python/pimp/ >>> and now when I run one of the demo scripts: >>> # >>> # The Python Imaging Library >>> # $Id: //modules/pil/Scripts/viewer.py#2 $ >>> # >> ---- >>> ImportError: No module named _imagingtk >>> >>> Any suggestions? >> >> _imagingtk is not supported on OS X. At least not by me! :) >> >> -bob >> > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig From Chris.Barker at noaa.gov Fri May 14 18:20:58 2004 From: Chris.Barker at noaa.gov (Chris Barker) Date: Fri May 14 18:21:50 2004 Subject: [Pythonmac-SIG] Jpeg still broken? In-Reply-To: <0ABBF680-A5ED-11D8-B3EC-000A95686CD8@redivi.com> References: <8D4AA3A0-A5DB-11D8-8F22-000393779D9C@eku.edu> <9FCD7C18-A5DD-11D8-B3EC-000A95686CD8@redivi.com> <0ABBF680-A5ED-11D8-B3EC-000A95686CD8@redivi.com> Message-ID: <40A5464A.7030401@noaa.gov> Bob Ippolito wrote: > You can use PyObjC (use Cocoa's NSImage directly, don't even need PIL) > or you can use pygame. or you can use wxPython. wxPython supports JPEG, and there is some stuff in the Wiki about mingling wxPython and PIL, if wx.Image doesn't do something you need. -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chris.Barker@noaa.gov From jerry.levan at eku.edu Fri May 14 18:28:17 2004 From: jerry.levan at eku.edu (Jerry LeVan) Date: Fri May 14 18:28:24 2004 Subject: [Pythonmac-SIG] Jpeg still broken? In-Reply-To: <0ABBF680-A5ED-11D8-B3EC-000A95686CD8@redivi.com> References: <8D4AA3A0-A5DB-11D8-8F22-000393779D9C@eku.edu> <9FCD7C18-A5DD-11D8-B3EC-000A95686CD8@redivi.com> <0ABBF680-A5ED-11D8-B3EC-000A95686CD8@redivi.com> Message-ID: Hmmm, May I did something ok late last night... After I tried and evidently failed on my last attempt to build PIL I went to bed... This morning when I download your thingy I noticed the _imaging.so in the PIL directory. I went back to the build directory and saw an _imagingtk.so in the PIL directory. I copied the file to the python installation directory and reran the View.py demo and it *worked*. I guess the install did not copy the rascal. Basically it appears that you can use the Tkinter module but you have to pass through the imageTk rascal first ( that is what Viewer.py does) I will have to try my _imaging.so later tonight and see if everything still works.... Jerry On May 14, 2004, at 5:24 PM, Bob Ippolito wrote: > You can use PyObjC (use Cocoa's NSImage directly, don't even need PIL) > or you can use pygame. > > I didn't remove any code from PIL, but I just did not compile > _imagingtk. > > If you compile it yourself, _imagingtk will also not compile.. but I > compiled it in the way that PIL is documented, with one patch for > enhanced TIFF support. > > -bob > > On May 14, 2004, at 5:08 PM, Jerry LeVan wrote: > >> Hi Bob, >> >> I noticed that ImageTk.py was in your package... >> >> At this point I need ImageTk inorder to view jpgs, >> at least that is the only way I can think to view the >> rascals... >> >> How did you get the jpg stuff to work? I never could >> figure out how to build PIL ;( I have a static >> libjpeg.a and a libjpeg.dylib in usr/local. >> >> Jerry >> On May 14, 2004, at 3:33 PM, Bob Ippolito wrote: >> >>> >>> On May 14, 2004, at 3:18 PM, Jerry LeVan wrote: >>> >>>> Well I installed the PIL located at >>>> http://undefined.org/python/pimp/ >>>> and now when I run one of the demo scripts: >>>> # >>>> # The Python Imaging Library >>>> # $Id: //modules/pil/Scripts/viewer.py#2 $ >>>> # >>> ---- >>>> ImportError: No module named _imagingtk >>>> >>>> Any suggestions? >>> >>> _imagingtk is not supported on OS X. At least not by me! :) >>> >>> -bob >>> >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig > From ronaldoussoren at mac.com Sat May 15 13:42:11 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat May 15 13:42:01 2004 Subject: [Pythonmac-SIG] Fwd: MacPython applet problem Message-ID: <322D8B86-A697-11D8-9E35-0003931CFE24@mac.com> This came up on c.l.py. Begin forwarded message: > From: bm007@gmx.de (boris m) > Date: 15 mei 2004 19:24:01 GMT+02:00 > To: python-list@python.org > Subject: Re: MacPython applet problem > > After some tinkering with AppleScript, I found a workaround for my > problem. I think it is worth sharing, so here we go... > > As Ronald pointed out, python applets currently do not support > input/output functions like 'input' or 'print'. Of course, I could run > the script from the command line, but then I would not have a nice > drag and drop feature. > > I wanted to have both drag/drop (via sys.argv) *and* input/output > functions. So I wrote an AppleScript droplet that allows me to do > this. The droplet is currently limited to accept just one item, but it > could easily be extended. > > This was one of my first explorations into AppleScript, so I am more > than open to suggestions and improvements. > > Boris > > --- > > --> save as application > on open dropItem > set itemPath to POSIX path of dropItem > set itemPathStr to (itemPath) as string > set itemPathCLI to textReplace(itemPathStr, " ", "\\ ") > > tell application "Finder" > set currentMacFolder to (container of (path to me)) as alias > set currentFolder to POSIX path of currentMacFolder > set folderPath to (currentFolder) as string > end tell > > set folderPathCLI to textReplace(folderPath, " ", "\\ ") > --> don't forget chmod +x myscript.py > --> myscript.py is in the same directory as the droplet > set scriptPath to folderPathCLI & "myscript.py" & " " & itemPathCLI > > activate application "Terminal" > tell application "Terminal" > do script scriptPath > end tell > end open > > > > on textReplace(theText, srchStrng, replStrng) > tell (a reference to AppleScript's text item delimiters) > set {od, contents} to {contents, {srchStrng}} > try > set {textList, contents} to {(text items of theText), {replStrng}} > set {newText, contents} to {(textList as text), od} > return item 1 of result > on error errMsg number errNbr > set contents to od > error errMsg number errNbr > end try > end tell > end textReplace > > > > >>> My problem is that I the script needs some user input (I want to > drag >>> some >>> text files to the applet and then specify some changes). For the > user >>> input >>> I am using: >>> >>> inputStr = raw_input("Enter a number: \n>>> ") >>> >>> This, however, seems to produce the error. >> >> That's right. I'm pretty sure applets on OSX do no (yet) support user >> input/output using the input function and print statement. >> >> IIRC this is on the TODO list for the next release of MacPython. >> >> B.T.W. with MacPython the default action for .py file is to execute >> them in a Terminal window, which gives you complete support for input >> and print. >> >> Ronald > -- > http://mail.python.org/mailman/listinfo/python-list > > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From Jack.Jansen at cwi.nl Sat May 15 17:14:27 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat May 15 17:14:25 2004 Subject: [Pythonmac-SIG] Re: urllib and ftplib hang in bundle but not when run directly In-Reply-To: References: Message-ID: On 14 May 2004, at 01:29, Russell E. Owen wrote: > In article , > "Russell E. Owen" wrote: > >> I am having trouble with some ftp code. On some platforms it works >> fine >> and on others it reliably hangs....(including MacOS X command-line >> it works, but a bundled app version of the identical code fails) > > After some experimentation, I found the hanging was occurring in > ftplib. > It delays importing re and compiling two regular expressions until they > are needed, and the thread hangs both on the import and (if I modify > ftplib to import re in advance) on the compilation. Modifying ftplib to > do both jobs in advance (when first imported) fixes the problem. My gut feeling is that it's not the import lock that is the problem: something as fundamental as the import lock being in a different state in a bundlebuilder application (as compared to a normal script run) would have show up much sooner. I did a quick test and it seems the import lock isn't held, indeed (in an application created with the stock 2.3 bundlebuilder). My next guess would be that the bundled application somehow holds a lock that is internal to re, but a quick look at re (and _sre) revealed no such lock, especially given your assertion that things go wrong at import time. Also, I can't imagine why a bundlebuilder app would hold such a lock while a normal script wouldn't. Still, I'd like to debug this, as errors such as this are really nasty. Could you try to attach gdb to the process as it is hanging, and see whether you can find out what lock (if any) you are hanging on? Also, there are now quite a few things called bundlebuilder or variations on it. Which one are you using? With what options? -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Sat May 15 17:18:02 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sat May 15 17:18:00 2004 Subject: [Pythonmac-SIG] Re: Broken link at python.org breaks packman In-Reply-To: References: Message-ID: <59468F2A-A6B5-11D8-8FD3-000D934FF6B4@cwi.nl> On 14 May 2004, at 07:20, William Hesse wrote: > On May 14 2004 I installed the MacPython-Panther-2.3-2 addons to > OS X 10.3 on my new laptop. When the package manager starts, it fails > with a 404 not found message, for the URL > http://www.python.org/packman/version-0.3/darwin-7.3.1- > Power_Macintosh.plist > > When I look at the website, it has a > http://www.python.org/packman/version-0.3/darwin-7.3.0- > Power_Macintosh.plist > , but not a 7.3.1. I'm going to try replacing 7.3.1 with 7.3.0 in the > source, if I can find it. Does anyone have any suggestions? What is the exact version of MacOSX you're running? I thought I was running the latest one (10.3.3, build 7F44; to see the build number select "About this Mac" and click on the "Version 10.3.3" string), and it reports as darwin 7.3.0.... -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From oshea at uleth.ca Sun May 16 01:13:09 2004 From: oshea at uleth.ca (Seamus O'Shea) Date: Sun May 16 01:17:18 2004 Subject: [Pythonmac-SIG] gcc error Message-ID: When running 10.3.3 and MacPython2.3, I get the following error when attempting to install numeric 23.1: .......... building '_numpy' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -IInclude -IPackages/FFT/Include -IPackages/RNG/Include -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ python2.3 -c Src/ufuncobject.c -o build/temp.darwin-7.3.0-Power_Macintosh-2.3/Src/ufuncobject.o gcc: unrecognized option `-no-cpp-precomp' gcc: installation problem, cannot exec `cc1': No such file or directory error: command 'gcc' failed with exit status 1 I believe I have the most recent gcc installed. What gives? Dr. S?amus F. O'Shea Professor of Chemistry University of Lethbridge (403) 329-2202 Dr. S?amus F. O'Shea Professor of Chemistry Vice President (Academic) & Provost University of Lethbridge (403) 329-2202 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 964 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040515/83a6960b/attachment.bin From rfinn at opnet.com Sun May 16 22:46:50 2004 From: rfinn at opnet.com (Russell Finn) Date: Sun May 16 22:47:03 2004 Subject: [Pythonmac-SIG] Re: Broken link at python.org breaks packman In-Reply-To: <59468F2A-A6B5-11D8-8FD3-000D934FF6B4@cwi.nl> References: <59468F2A-A6B5-11D8-8FD3-000D934FF6B4@cwi.nl> Message-ID: <729B604A-A7AC-11D8-BC58-000D93C109A8@opnet.com> On May 15, 2004, at 5:18 PM, Jack Jansen wrote: > > On 14 May 2004, at 07:20, William Hesse wrote: > >> On May 14 2004 I installed the MacPython-Panther-2.3-2 addons to >> OS X 10.3 on my new laptop. When the package manager starts, it fails >> with a 404 not found message, for the URL >> http://www.python.org/packman/version-0.3/darwin-7.3.1- >> Power_Macintosh.plist >> >> When I look at the website, it has a >> http://www.python.org/packman/version-0.3/darwin-7.3.0- >> Power_Macintosh.plist >> , but not a 7.3.1. I'm going to try replacing 7.3.1 with 7.3.0 in the >> source, if I can find it. Does anyone have any suggestions? > > What is the exact version of MacOSX you're running? I thought I was > running > the latest one (10.3.3, build 7F44; to see the build number select > "About this Mac" and > click on the "Version 10.3.3" string), and it reports as darwin > 7.3.0.... If William's new laptop is like my new laptop, it's running a newer build of 10.3.3. To be precise, my 12" PowerBook is running 7G33, but I understand other new PowerBooks are running 7G51. And it does report the darwin version as 7.3.1: [ludoviko:~] rsf% uname -a Darwin ludoviko.local 7.3.1 Darwin Kernel Version 7.3.1: Mon Mar 22 21:48:41 PST 2004; root:xnu/xnu-517.4.12.obj~2/RELEASE_PPC Power Macintosh powerpc (Now we know what that third-level version number is there for. :-) -- Russell Finn From Jack.Jansen at cwi.nl Mon May 17 04:17:41 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon May 17 04:18:13 2004 Subject: [Pythonmac-SIG] gcc error In-Reply-To: References: Message-ID: On 16-mei-04, at 7:13, Seamus O'Shea wrote: > When running 10.3.3 and MacPython2.3, I get the following error when > attempting to install numeric 23.1: > .......... > building '_numpy' extension > gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp > -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall > -Wstrict-prototypes -IInclude -IPackages/FFT/Include > -IPackages/RNG/Include > -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ > python2.3 -c Src/ufuncobject.c -o > build/temp.darwin-7.3.0-Power_Macintosh-2.3/Src/ufuncobject.o > gcc: unrecognized option `-no-cpp-precomp' > gcc: installation problem, cannot exec `cc1': No such file or directory > error: command 'gcc' failed with exit status 1 > > I believe I have the most recent gcc installed. What gives? Could it be that you have a *too* new gcc, i.e. did you install your own version of gcc (as opposed to the apple-installed gcc)? -- 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 mwh at python.net Mon May 17 04:33:44 2004 From: mwh at python.net (Michael Hudson) Date: Mon May 17 04:33:55 2004 Subject: [Pythonmac-SIG] Re: urllib and ftplib hang in bundle but not when run directly In-Reply-To: (Russell E. Owen's message of "Fri, 14 May 2004 09:10:35 -0700") References: <2mvfizjmzr.fsf@starship.python.net> Message-ID: <2mad07jvvb.fsf@starship.python.net> Russell E Owen writes: > At 11:56 AM +0100 5/14/04, Michael Hudson wrote: >>"Russell E. Owen" writes: >> >>> In article , >>> "Russell E. Owen" wrote: >>> >>>>I am having trouble with some ftp code. On some platforms it works fine >>>>and on others it reliably hangs....(including MacOS X command-line >>>>it works, but a bundled app version of the identical code fails) >>> >>> After some experimentation, I found the hanging was occurring in ftplib. >>> It delays importing re and compiling two regular expressions until they >>> are needed, and the thread hangs both on the import and (if I modify >>> ftplib to import re in advance) on the compilation. Modifying ftplib to >>> do both jobs in advance (when first imported) fixes the problem. >> >>Um. Python has an 'import lock' so only one thread can be importing a >>module at the same time. >> >>Do you have code like this: >> >>def main(): >> .... >> >>main() >> >>i.e. that does things as a result of being imported? You should stop >>that :-) > > > It's an interesting idea. I didn't know about any import lock (just > the global interpreter lock, which I doubt is relevant). > > I do have code like this: > def _createMyConst(): > ... > _MyConst = _creatMyConst() > > that runs as a result of being imported. I thought that was normal > python -- initialization can safely be done when the module is > imported. I don't understand why that is considered dangerous or how > it could run afoul of an importer lock. I think that so long as _creatMyConst() doesn't start any threads, you should be OK. > Also, my own code has fully loaded and finished initializing well > before I try any ftp transfers and run into the problem. Ah. Then it's not what I suspected. > The hang occurs inside ftplib itself. I use it to fetch a file in a > separate (background) thread. If "too much other stuff" is going on, > that thread hangs. With ftplib as written, it hangs while executing > "import re" (which is only done once the ftp starts). If I modify > ftplib to import re right away at the beginning, then the thread hangs > in ftplib compiling a regular expression. Modifying ftplib to > pre-compile the two regular expressions it uses makes it stop hanging > and my code starts working again. A deadlock! Have fun! It can hardly be a coincidence that the sre compiler is written in Python... > It seems strange to me that a thread could either work fine or 100% > totally hang like that. It always works fine when run on MacOS X (when > run as a command-line app). It always hangs forever when the identical > code is run as a macOS X bundled app or when run on RedHat linux. When > the same code is run as part of a smaller app, it runs fine on linux. Oddness. Cheers, mwh -- One of the great skills in using any language is knowing what not to use, what not to say. ... There's that simplicity thing again. -- Ron Jeffries From rowen at u.washington.edu Mon May 17 12:26:42 2004 From: rowen at u.washington.edu (Russell E Owen) Date: Mon May 17 12:26:56 2004 Subject: [Pythonmac-SIG] Re: urllib and ftplib hang in bundle but not when run directly In-Reply-To: References: Message-ID: At 11:14 PM +0200 2004-05-15, Jack Jansen wrote: >... >My gut feeling is that it's not the import lock that is the problem: something >as fundamental as the import lock being in a different state in a >bundlebuilder >application (as compared to a normal script run) would have show up much >sooner. I did a quick test and it seems the import lock isn't held, >indeed (in an >application created with the stock 2.3 bundlebuilder). I agree, especially as simply compiling the regular expression can cause the same problem. >My next guess would be that the bundled application somehow holds >a lock that is internal to re, but a quick look at re (and _sre) revealed no >such lock, especially given your assertion that things go wrong at import >time. Also, I can't imagine why a bundlebuilder app would hold such >a lock while a normal script wouldn't. > >Still, I'd like to debug this, as errors such as this are really nasty. >Could you try to attach gdb to the process as it is hanging, and see whether >you can find out what lock (if any) you are hanging on? I'll gladly have a go at that. not having used gdb before I'm wondering if anyone can suggest a tutorial or recipe. >Also, there are now quite a few things called bundlebuilder or variations >on it. Which one are you using? With what options? I am using the bundlebuilder that came with Panther's built-in Mac Python 2.3. Here's the basic call (the build script has additional code to handle the fact that I mix some data files, e.g. sounds and html help, in with my modules, but this just copies files into the bundle): inclPkgs = ["RO", "TUI"] libs = [ "/Library/Frameworks/Tcl.framework", "/Library/Frameworks/Tk.framework", ] resources = [tuiDir] bundlebuilder.buildapp( name = appName, # application name builddir = ".", # dir for application mainprogram = mainProg, # your app's main() argv_emulation = False, # drag&dropped filenames show up in sys.argv? iconfile = 'TUI.icns', # file containing your app's icons semi_standalone = True, # make this app self contained. includePackages = inclPkgs, # additional Packages to force in libs = libs, # extra libraries to force in resources = resources, # extra files or folders to copy to Resources ) Note that this same code also hangs under RedHat 9.2 linux with Python 2.3.3. Still, the fact that it runs fine as a pythonw command-line app (with GUI) and not as a bundled app is certainly suspicious and if gdb will show what's going on, that'll be great! I'd sure rather not hack my own version of ftplib. -- Russell From Jack.Jansen at cwi.nl Mon May 17 17:39:43 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon May 17 17:39:40 2004 Subject: [Pythonmac-SIG] Re: urllib and ftplib hang in bundle but not when run directly In-Reply-To: References: Message-ID: On 17 May 2004, at 18:26, Russell E Owen wrote: >> Still, I'd like to debug this, as errors such as this are really >> nasty. >> Could you try to attach gdb to the process as it is hanging, and see >> whether >> you can find out what lock (if any) you are hanging on? > > I'll gladly have a go at that. not having used gdb before I'm > wondering if anyone can suggest a tutorial or recipe. I quick google search turned up which looks reasonable. But it won't explain about multi-threaded debugging:-( What you want to do is start the app and let it run until it hangs. Then use "ps" to find the pid. Then run "gdb --pid=PID" to attach to the process. Type "^c" to gdb to interrupt the hung app and give gdb control. "info threads" will show you which threads there are. "thread 1" will switch to thread one, etc. "where" will print a stacktrace of the current thread. Most likely (hopefully) you'll see that two threads are somewhere in pthread_mutex_lock or a similar call for the same mutex. one or two frames up the stack you'll see where the call came from. > Note that this same code also hangs under RedHat 9.2 linux with Python > 2.3.3. Ah, then I misread your original post! This makes it a general problem, not a mac-specific one, which means there's a bigger chance someone else came across it. Try asking on comp.lang.python, and/or searching the bug database for "thread" and "ftplib" or "sre" something like that. -- 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 rowen at u.washington.edu Mon May 17 20:05:04 2004 From: rowen at u.washington.edu (Russell E Owen) Date: Mon May 17 20:05:14 2004 Subject: [Pythonmac-SIG] Re: urllib and ftplib hang in bundle but not when run directly In-Reply-To: References: Message-ID: At 11:39 PM +0200 2004-05-17, Jack Jansen wrote: ...(helpful info on debugging a multithreaded app with gdb deleted; I had found the basic tutorials but was having trouble getting the thread stuff working) >> Note that this same code also hangs under RedHat 9.2 linux with >>Python 2.3.3. > >Ah, then I misread your original post! This makes it a general >problem, not a mac-specific one... Yes. It turns out that Michael Hudson was exactly right. The problem was contention for the import lock. I originally wrote my app to be run as follows: % python /TUI/Main.py Unfortunately, I added a hack to simplify my bundlebuilder script: I added a file: runtui.py whose sole contents were (oops): import TUI.Main which is exactly what Michael warned me not to do (and I knew it was ugly at the time, but didn't realize it was actually dangerous). Worse, I forgot to convert my command-line system to use that new file, even though I converted other users (because since it simplified setup--no need to set PYTHONPATH). Thus I was running my app from the command line differently than everybody else. I'd forgotten all about the hack when I read Michael's message. Anyway, fixing TUI/Main.py to be run via a function call fixed the problem. Thank you very much for all your help. I'm very relieved it turned out to be something simple (despite such complex symptoms). Regards, -- Russell From kevin at wordtechcommunications.com Tue May 18 08:41:11 2004 From: kevin at wordtechcommunications.com (Kevin Walzer) Date: Tue May 18 08:41:25 2004 Subject: [Pythonmac-SIG] Bundlebuilder vs. save as applet In-Reply-To: <20040516222747.CFA6422A8B1@server.wordtechcommunications.com> References: <20040516222747.CFA6422A8B1@server.wordtechcommunications.com> Message-ID: I'm learning Python and am a bit confused by difference between bundlebuilder.py and save as applet from the PythonIDE. I've been able to save a few tools, such as wxGlade, as applets from the PythonIDE because I find clicking an application icon a bit easier to work with than finding the correct Python script all the time and launching that through PythonLauncher. I can even go into the applet app bundle, hack info.plist, and give it a custom icon. By contrast, whenever I try the bundlebuilder approach, I always seem to mess something up and the app won't launch. I know the problem is my own learning curve, as bundlebuilder seems more complex (and powerful) than save as applet. What I need to understand is what advantage bundlebuilder offers when save as applet seems to work very well for me (and very simply)? Thanks. Kevin Walzer, Ph.D. Editor WordTech Communications--A New Paradigm of Poetry http://www.wordtechcommunications.com http://www.smallbizmac.com http://www.kevin-walzer.com On May 16, 2004, at 6:27 PM, pythonmac-sig-request@python.org wrote: From oshea at uleth.ca Tue May 18 09:20:46 2004 From: oshea at uleth.ca (Seamus O'Shea) Date: Tue May 18 09:20:55 2004 Subject: [Pythonmac-SIG] gcc error In-Reply-To: References: Message-ID: <2BFDF4ED-A8CE-11D8-840D-000393D555FA@uleth.ca> Thanks for the response. In reply: I don't think so. I installed the recent developer tools, but I can get the error using the older compiler numarray-0.9 > sudo /usr/sbin/gcc_select 2 Default compiler has been set to: Apple Computer, Inc. version gcc-938, based on gcc version 2.95.2 19991024 (release) numarray-0.9 > python setup.py build Using EXTRA_COMPILE_ARGS = ['-Ddarwin'] running build running build_py copying Lib/numinclude.py -> build/lib.darwin-7.3.0-Power_Macintosh-2.3/numarray running build_ext building 'numarray._conv' extension gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -IInclude/numarray -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ python2.3 -c Src/_convmodule.c -o build/temp.darwin-7.3.0-Power_Macintosh-2.3/Src/_convmodule.o -Ddarwin gcc: unrecognized option `-no-cpp-precomp' gcc: installation problem, cannot exec `cc1': No such file or directory error: command 'gcc' failed with exit status 1 I find it difficult to figure out where it is setting the various options, etc. Can you suggest a useful source to read for a coherent overview of what's supposed to happen? Thanks On May 17, 2004, at 2:17 AM, Jack Jansen wrote: > > On 16-mei-04, at 7:13, Seamus O'Shea wrote: > >> When running 10.3.3 and MacPython2.3, I get the following error when >> attempting to install numeric 23.1: >> .......... >> building '_numpy' extension >> gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp >> -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall >> -Wstrict-prototypes -IInclude -IPackages/FFT/Include >> -IPackages/RNG/Include >> -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ >> python2.3 -c Src/ufuncobject.c -o >> build/temp.darwin-7.3.0-Power_Macintosh-2.3/Src/ufuncobject.o >> gcc: unrecognized option `-no-cpp-precomp' >> gcc: installation problem, cannot exec `cc1': No such file or >> directory >> error: command 'gcc' failed with exit status 1 >> >> I believe I have the most recent gcc installed. What gives? > > Could it be that you have a *too* new gcc, i.e. did you install your > own version of gcc (as opposed to the apple-installed gcc)? > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > > Dr. S?amus F. O'Shea Professor of Chemistry Vice President (Academic) & Provost University of Lethbridge (403) 329-2202 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2534 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040518/bb84bd5c/attachment.bin From drewmccormack at mac.com Wed May 19 01:33:30 2004 From: drewmccormack at mac.com (Drew McCormack) Date: Wed May 19 01:33:38 2004 Subject: [Pythonmac-SIG] [ANN] Cocoa and Xgrid part 2 Message-ID: <100EC264-A956-11D8-AEB5-0003937B5C28@mac.com> Please excuse this crosspost. It is just to let everyone know that part 2 of the MacDevCenter article about Xgrid is now up. http://www.macdevcenter.com/pub/a/mac/2004/05/18/xgrid_pt2.html?page=1 This final part shows you how you can create a standalone Cocoa batch image processing app with Xgrid (using NSTask to wrap the xgrid CLI tool). Source code and app are available for download. It also has a bit of python included (it uses the Python Image Processing library), and the source code makes use of drag-and-drop destinations and the controller layer. Drew McCormack Trade Strategist Stock market strategy design software http://www.trade-strategist.com -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1443 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040519/6be12e6d/attachment.bin From Jack.Jansen at cwi.nl Wed May 19 04:53:42 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed May 19 04:54:03 2004 Subject: [Pythonmac-SIG] Bundlebuilder vs. save as applet In-Reply-To: References: <20040516222747.CFA6422A8B1@server.wordtechcommunications.com> Message-ID: <07C88AAA-A972-11D8-8D04-000A958D1666@cwi.nl> On 18-mei-04, at 14:41, Kevin Walzer wrote: > I'm learning Python and am a bit confused by difference between > bundlebuilder.py and save as applet from the PythonIDE. I've been able > to save a few tools, such as wxGlade, as applets from the PythonIDE > because I find clicking an application icon a bit easier to work with > than finding the correct Python script all the time and launching that > through PythonLauncher. I can even go into the applet app bundle, hack > info.plist, and give it a custom icon. By contrast, whenever I try the > bundlebuilder approach, I always seem to mess something up and the app > won't launch. > > I know the problem is my own learning curve, as bundlebuilder seems > more complex (and powerful) than save as applet. What I need to > understand is what advantage bundlebuilder offers when save as applet > seems to work very well for me (and very simply)? Thanks. Under the hood "save as applet" uses the bundlebuilder module to do the actual work. If it works for you: by all means, continue using it. The only problem with the current setup is that it's an all-or-nothing situation: "save as applet" is very convenient but gives you absolutely no choices, even for really simple additions (an icon, whether the resulting app should be standalone, etc). bundlebuilder gives you full control, but very little convenience. In a future release I'd like to add a GUI interface to bundlebuilder, so you can gradually migrate from save as applet to bundlebuilder without the current steep learning curve. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Wed May 19 04:58:21 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed May 19 04:58:39 2004 Subject: [Pythonmac-SIG] gcc error In-Reply-To: <2BFDF4ED-A8CE-11D8-840D-000393D555FA@uleth.ca> References: <2BFDF4ED-A8CE-11D8-840D-000393D555FA@uleth.ca> Message-ID: On 18-mei-04, at 15:20, Seamus O'Shea wrote: > > Thanks for the response. In reply: > > I don't think so. I installed the recent developer tools, but I can > get the error using the older compiler > > numarray-0.9 > sudo /usr/sbin/gcc_select 2 > Default compiler has been set to: > Apple Computer, Inc. version gcc-938, based on gcc version 2.95.2 > 19991024 (release) > numarray-0.9 > python setup.py build > Using EXTRA_COMPILE_ARGS = ['-Ddarwin'] > running build > running build_py > copying Lib/numinclude.py -> > build/lib.darwin-7.3.0-Power_Macintosh-2.3/numarray > running build_ext > building 'numarray._conv' extension > gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp > -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall > -Wstrict-prototypes -IInclude/numarray > -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ > python2.3 -c Src/_convmodule.c -o > build/temp.darwin-7.3.0-Power_Macintosh-2.3/Src/_convmodule.o -Ddarwin > gcc: unrecognized option `-no-cpp-precomp' > gcc: installation problem, cannot exec `cc1': No such file or directory > error: command 'gcc' failed with exit status 1 > > I find it difficult to figure out where it is setting the various > options, etc. Can you suggest a useful source to read for a coherent > overview of what's supposed to happen? I still have the feeling that there's something else called "gcc" lurking on your $PATH. Could you try the following three commands, just to make sure? $ gcc --version gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1640) Copyright (C) 2002 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. $ gcc -no-cpp-precomp gcc: no input files $ gcc -no-cpp-precomp-blablabla gcc: unrecognized option `-no-cpp-precomp-blablabla' gcc: no input files -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2055 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040519/233cde95/attachment.bin From thor.thor.thor.thor at virgin.net Wed May 19 07:29:27 2004 From: thor.thor.thor.thor at virgin.net (thor) Date: Wed May 19 06:29:43 2004 Subject: [Pythonmac-SIG] another bundlebuilder question Message-ID: Hi list ! I am new to Python and so far I am really impressed, however a bit confused sometimes about where to search for information and API for the functionality and interfaces of classes. Anyway, I've built a little test application which uses pygame for the graphics and I want to make an app out of it. I modified this to control the buindlebuilder (from an example): ======================== ### makeapplication.py from bundlebuilder import buildapp buildapp( name='myApp.app', # what to build mainprogram='main.py', # your app's main() argv_emulation=1, # drag&dropped filenames show up in sys.argv iconfile='myIcon.icns', # file containing your app's icons standalone=1, # make this app self contained. includeModules= ['pygame', 'random', 'time', 'OpenGL', 'os'], includePackages=[], # list of additional Packages to force in libs=[], # list of shared libs or Frameworks to include ) ### end of makeapplication.py ==================== But the results I get are always these: mac$ python makeapplication.py --standalone --strip build Finding module dependencies Building 'build/myApp.app' Copying files Adding Python modules Stripping binaries Warning: couldn't find the following submodules: (Note that these could be false alarms -- it's not always possible to distinguish between "from package import submodule" and "from package import name") ? AppKit.NSApp ? AppKit.NSApplication ? AppKit.NSCriticalRequest ? AppKit.NSImage ? AppKit.NSMenu ? AppKit.NSMenuItem ? AppKit.NSTerminateLater ? Foundation.NSDictionary ? Foundation.NSLog ? Foundation.NSObject ? objc.selector ? objc.setClassExtender ? objc.setSignatureForSelector Warning: couldn't find the following modules: ? os.path ? protocols Done. So why does bundlebuilder not find the AppKit (it is there when you try this: "import AppKit" in the python window. And what is the issue with os? There is a file called os in my library, but not os.path (and I thought os.path would be part of that file, right?) Could somebody tell me what is happening here? Am I doing something wrong or is my system not updated enough to use the bundlebuilder? (I am using OS X 10.3, having installed MacPython, pygame, pyOpenGL, wxPython, etc. I just installed the system and haven't really modified anything, so it should be pretty clean). I hope that you can help me with this one, many thanks thor From bob at redivi.com Wed May 19 11:08:46 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed May 19 11:08:59 2004 Subject: [Pythonmac-SIG] another bundlebuilder question In-Reply-To: References: Message-ID: <6D4C9921-A9A6-11D8-A675-000A95686CD8@redivi.com> On May 19, 2004, at 7:29 AM, thor wrote: > I am new to Python and so far I am really impressed, however > a bit confused sometimes about where to search for information > and API for the functionality and interfaces of classes. > > Anyway, I've built a little test application which uses pygame for > the graphics and I want to make an app out of it. > > I modified this to control the buindlebuilder (from an example): > > ======================== > ### makeapplication.py > from bundlebuilder import buildapp > > buildapp( > name='myApp.app', # what to build > mainprogram='main.py', # your app's main() > argv_emulation=1, # drag&dropped filenames show up in > sys.argv > iconfile='myIcon.icns', # file containing your app's icons > standalone=1, # make this app self contained. > includeModules= ['pygame', 'random', 'time', 'OpenGL', 'os'], > includePackages=[], # list of additional Packages to force > in > libs=[], # list of shared libs or > Frameworks to include > ) > > ### end of makeapplication.py > ==================== > > > But the results I get are always these: > > > mac$ python makeapplication.py --standalone --strip build > > Finding module dependencies > Building 'build/myApp.app' > Copying files > Adding Python modules > Stripping binaries > Warning: couldn't find the following submodules: > (Note that these could be false alarms -- it's not always > possible to distinguish between "from package import submodule" > and "from package import name") > ? AppKit.NSApp > ? AppKit.NSApplication > ? AppKit.NSCriticalRequest > ? AppKit.NSImage > ? AppKit.NSMenu > ? AppKit.NSMenuItem > ? AppKit.NSTerminateLater > ? Foundation.NSDictionary > ? Foundation.NSLog > ? Foundation.NSObject > ? objc.selector > ? objc.setClassExtender > ? objc.setSignatureForSelector > Warning: couldn't find the following modules: > ? os.path > ? protocols > Done. > > > So why does bundlebuilder not find the AppKit (it is there when > you try this: "import AppKit" in the python window. > > And what is the issue with os? There is a file called os in my > library, but not os.path (and I thought os.path would be part of > that file, right?) > > Could somebody tell me what is happening here? > Am I doing something wrong or is my system not updated enough > to use the bundlebuilder? > > (I am using OS X 10.3, having installed MacPython, pygame, pyOpenGL, > wxPython, etc. I just installed the system and haven't really modified > anything, so it should be pretty clean). Those are completely spurious warnings that don't really mean anything. Modulefinder is stupid. There is an example in pygame CVS: pygame/examples/macosx/aliens_app_example that shows how to use bundlebuilder2 to make a standalone bundle. Your example isn't actually standalone. You can get bundlebuilder2 by installing: http://undefined.org/python/macholib-v2.0a0.tgz -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040519/d35fa362/smime.bin From hengist.podd at virgin.net Wed May 19 12:44:31 2004 From: hengist.podd at virgin.net (has) Date: Wed May 19 12:46:32 2004 Subject: [Pythonmac-SIG] Bundlebuilder vs. save as applet In-Reply-To: <07C88AAA-A972-11D8-8D04-000A958D1666@cwi.nl> References: <20040516222747.CFA6422A8B1@server.wordtechcommunications.com> <07C88AAA-A972-11D8-8D04-000A958D1666@cwi.nl> Message-ID: Jack Jansen wrote: >In a future release I'd like to add a GUI interface to >bundlebuilder, so you can gradually migrate from save as applet to >bundlebuilder without the current steep learning curve. Sounds good. Here's a few suggestions, for what they're worth: - Would it be possible/practical to construct this as, say, a plug-in component rather than a standalone executable? That way IDEs could incorporate it directly, bringing up the BB dialog when the user selects 'Save as Applet...'. - Arranging the window so that 'Advanced' options are initially hidden behind one of those disclosure triangle thingies would keep it easy to use when folk just want to spit out a generic applet. - Also, it'd be good to provide 'BBGUI' as a separate module to the original BB module so that scripts and applications wanting to use BB's programmatic interface aren't made to import unnecessary GUI toolkit modules. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From thor.thor.thor.thor at virgin.net Wed May 19 13:55:59 2004 From: thor.thor.thor.thor at virgin.net (thor) Date: Wed May 19 12:56:15 2004 Subject: [Pythonmac-SIG] another bundlebuilder question In-Reply-To: <6D4C9921-A9A6-11D8-A675-000A95686CD8@redivi.com> References: <6D4C9921-A9A6-11D8-A675-000A95686CD8@redivi.com> Message-ID: Hi Bob and rest of the list Thank's for your help. >> (I am using OS X 10.3, having installed MacPython, pygame, pyOpenGL, >> wxPython, etc. I just installed the system and haven't really modified >> anything, so it should be pretty clean). > > Those are completely spurious warnings that don't really mean > anything. Modulefinder is stupid. > > There is an example in pygame CVS: > pygame/examples/macosx/aliens_app_example that shows how to use > bundlebuilder2 to make a standalone bundle. Your example isn't > actually standalone. You can get bundlebuilder2 by installing: > http://undefined.org/python/macholib-v2.0a0.tgz I downloaded the macholib and put the bundlebuilder2 into the python2.3/plat-mac folder. (where the other bundlebuilder was). However I didn't know where to put the macholib files, so I put them there as well. Is that the right place? But now I get this error: mac$ python buildapp.py --standalone build Finding module dependencies Building 'build/myApp.app' Copying files Relocating libraries Traceback (most recent call last): File "buildapp.py", line 31, in ? plist = infoPlist, File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder2.py", line 974, in buildapp main(builder) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder2.py", line 962, in main builder.build() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder2.py", line 159, in build self._relocateHeaders() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder2.py", line 206, in _relocateHeaders fobj.copyToFolder(dst, copyfile=self.copyFile, copytree=self.copyTree) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/macholib/util.py", line 180, in copyToFolder fh = openfile(os.path.join(folder, toWrite), 'rb+') IOError: [Errno 2] No such file or directory: 'build/myApp.app/Contents/Frameworks/SDL.framework/Versions/A/SDL' Could somebody tell me what might be wrong? Or perhaps answer the general question: How does one build a standalone application in Python on OS X? Are there any tutorials? Any tips? thank you very much thor From bob at redivi.com Wed May 19 13:07:12 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed May 19 13:07:23 2004 Subject: [Pythonmac-SIG] another bundlebuilder question In-Reply-To: References: <6D4C9921-A9A6-11D8-A675-000A95686CD8@redivi.com> Message-ID: On May 19, 2004, at 1:55 PM, thor wrote: > Hi Bob and rest of the list > > Thank's for your help. > > >>> (I am using OS X 10.3, having installed MacPython, pygame, pyOpenGL, >>> wxPython, etc. I just installed the system and haven't really >>> modified >>> anything, so it should be pretty clean). >> >> Those are completely spurious warnings that don't really mean >> anything. Modulefinder is stupid. >> >> There is an example in pygame CVS: >> pygame/examples/macosx/aliens_app_example that shows how to use >> bundlebuilder2 to make a standalone bundle. Your example isn't >> actually standalone. You can get bundlebuilder2 by installing: >> http://undefined.org/python/macholib-v2.0a0.tgz > > I downloaded the macholib and put the bundlebuilder2 into the > python2.3/plat-mac > folder. (where the other bundlebuilder was). However I didn't know > where to put > the macholib files, so I put them there as well. Is that the right > place? The correct place would be your site-packages folder.. > But now I get this error: > > mac$ python buildapp.py --standalone build > > Finding module dependencies > Building 'build/myApp.app' > Copying files > Relocating libraries > Traceback (most recent call last): -- > IOError: [Errno 2] No such file or directory: > 'build/myApp.app/Contents/Frameworks/SDL.framework/Versions/A/SDL' > > > Could somebody tell me what might be wrong? What version of OS X and Python are you using? What buildapp.py script is this? > Or perhaps answer the general question: How does one build a standalone > application in Python on OS X? Are there any tutorials? Any tips? It's a complicated process right now. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040519/91fc014c/smime.bin From thor.thor.thor.thor at virgin.net Wed May 19 14:35:25 2004 From: thor.thor.thor.thor at virgin.net (thor) Date: Wed May 19 13:36:02 2004 Subject: [Pythonmac-SIG] another bundlebuilder question In-Reply-To: References: <6D4C9921-A9A6-11D8-A675-000A95686CD8@redivi.com> Message-ID: <4B423E20-A9C3-11D8-99C8-0003930EC1EA@virgin.net> Hi and thanks again for helping ! > The correct place would be your site-packages folder.. Ok great! I've put it there now. I am still getting the same error: mac$ python buildapp.py --standalone build Finding module dependencies Building 'build/myApp.app' Copying files Relocating libraries Traceback (most recent call last): File "buildapp.py", line 31, in ? plist = infoPlist, File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder2.py", line 974, in buildapp main(builder) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder2.py", line 962, in main builder.build() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder2.py", line 159, in build self._relocateHeaders() File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/bundlebuilder2.py", line 206, in _relocateHeaders fobj.copyToFolder(dst, copyfile=self.copyFile, copytree=self.copyTree) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/plat-mac/macholib/util.py", line 180, in copyToFolder IOError: [Errno 2] No such file or directory: 'build/myApp.app/Contents/Frameworks/SDL.framework/Versions/A/SDL' > What version of OS X and Python are you using? What buildapp.py > script is this? OS X 10.3.3, Python 2.3, latest pygame and it is basically your buildapp.py script which I found in the CVS of the alien game you referred me to. here is how I modified the script: ============================ from bundlebuilder2 import buildapp from plistlib import Plist, Dict import glob, imp, shutil, os NAME = 'myApp' VERSION = '0.1' infoPlist = Plist( CFBundleIconFile = 'myApp.icns', CFBundleName = NAME, CFBundleShortVersionString = VERSION, CFBundleGetInfoString = ' '.join([NAME, VERSION]), CFBundleExecutable = NAME, ) # pkgdata stuff pygamedata = os.path.join('pkgdata', 'pygame') if not os.path.exists(pygamedata): os.makedirs(pygamedata) pygamedir = imp.find_module('pygame')[1] for fn in glob.glob(os.path.join(pygamedir, '*.ttf')): shutil.copy(fn, pygamedata) buildapp( name = 'myApp.app', bundle_id = 'org.pygame.aliens', mainprogram = 'main.py', #nibname = 'MainMenu', #resources = ["English.lproj", "../../data", "pkgdata"], plist = infoPlist, ) I commented out the nibname and resources out as I am not using any of that in my program. Is that a mistake? What does the bundle_id do by the way? > It's a complicated process right now. Hmm. Yes, It seems quite complicated for me, but I am quite new to Python. Getting this to work would be a big step and make things much more interesting. (I might write some tuts online of how I managed to do this if I will be able to, so your help and tips could benefit others as well) later thor From bob at redivi.com Wed May 19 13:45:55 2004 From: bob at redivi.com (Bob Ippolito) Date: Wed May 19 13:46:04 2004 Subject: [Pythonmac-SIG] another bundlebuilder question In-Reply-To: <4B423E20-A9C3-11D8-99C8-0003930EC1EA@virgin.net> References: <6D4C9921-A9A6-11D8-A675-000A95686CD8@redivi.com> <4B423E20-A9C3-11D8-99C8-0003930EC1EA@virgin.net> Message-ID: <6149B4DE-A9BC-11D8-A675-000A95686CD8@redivi.com> On May 19, 2004, at 2:35 PM, thor wrote: > > Hi and thanks again for helping ! > >> The correct place would be your site-packages folder.. > > Ok great! I've put it there now. > > I am still getting the same error: Strange, I'll look into it later this week. bundlebuilder2 and macholib are still in the experimental stages. The version I have online may be older than what I built that example with. >> What version of OS X and Python are you using? What buildapp.py >> script is this? > > OS X 10.3.3, Python 2.3, latest pygame and it is basically your > buildapp.py script > which I found in the CVS of the alien game you referred me to. > buildapp( > name = 'myApp.app', > bundle_id = 'org.pygame.aliens', > mainprogram = 'main.py', > #nibname = 'MainMenu', > #resources = ["English.lproj", "../../data", "pkgdata"], > plist = infoPlist, > ) > > I commented out the nibname and resources out as I am not > using any of that in my program. Is that a mistake? > What does the bundle_id do by the way? Every bundle in OS X should have a unique bundle identifier. Google for CFBundleIdentifier. >> It's a complicated process right now. > > Hmm. Yes, It seems quite complicated for me, but I am quite > new to Python. Getting this to work would be a big step and > make things much more interesting. (I might write some tuts > online of how I managed to do this if I will be able to, so your > help and tips could benefit others as well) You should probably just wait until the situation has stabilized a bit and better tools are available. It could be soon, but I am quite busy right now with paid work so I can't make any guarantees. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040519/76f28aa9/smime.bin From Jack.Jansen at cwi.nl Wed May 19 17:50:07 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed May 19 17:50:01 2004 Subject: [Pythonmac-SIG] Bundlebuilder vs. save as applet In-Reply-To: References: <20040516222747.CFA6422A8B1@server.wordtechcommunications.com> <07C88AAA-A972-11D8-8D04-000A958D1666@cwi.nl> Message-ID: <7E144743-A9DE-11D8-9EE8-000D934FF6B4@cwi.nl> On 19 May 2004, at 14:41, Kevin Walzer wrote: > Thanks for the advice. I will keep using save as applet, as it's > perfect for my needs. It's a very nice feature! > > I'm just curious: how do the save as applet settings translate into > bundlebuilder settings? Is it "semi-standalone," "standalone," etc? That's a good question! (in other words: hmm, I wouldn't really know:-) I will find out, and add a note to the FAQ. -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From Jack.Jansen at cwi.nl Wed May 19 17:52:56 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Wed May 19 17:52:50 2004 Subject: [Pythonmac-SIG] Bundlebuilder vs. save as applet In-Reply-To: References: <20040516222747.CFA6422A8B1@server.wordtechcommunications.com> <07C88AAA-A972-11D8-8D04-000A958D1666@cwi.nl> Message-ID: Good suggestions! I'm not sure how feasible the plugin idea would be (it would need to do GUI things, and I'm not sure we can pull off something that would work in, say, all of Cocoa, Tkinter and wxPython based GUI apps), but we may be able to come up with some sort of a trick that at least makes it look like a plugin. Could you add a SF feature request, please, and assign it to me? On 19 May 2004, at 18:44, has wrote: > Jack Jansen wrote: > >> In a future release I'd like to add a GUI interface to bundlebuilder, >> so you can gradually migrate from save as applet to bundlebuilder >> without the current steep learning curve. > > Sounds good. Here's a few suggestions, for what they're worth: > > - Would it be possible/practical to construct this as, say, a plug-in > component rather than a standalone executable? That way IDEs could > incorporate it directly, bringing up the BB dialog when the user > selects 'Save as Applet...'. > > - Arranging the window so that 'Advanced' options are initially hidden > behind one of those disclosure triangle thingies would keep it easy to > use when folk just want to spit out a generic applet. > > - Also, it'd be good to provide 'BBGUI' as a separate module to the > original BB module so that scripts and applications wanting to use > BB's programmatic interface aren't made to import unnecessary GUI > toolkit modules. > > HTH > > has > -- > http://freespace.virgin.net/hamish.sanderson/ > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- Jack Jansen, , http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman From oshea at uleth.ca Wed May 19 21:05:31 2004 From: oshea at uleth.ca (Seamus O'Shea) Date: Wed May 19 21:05:41 2004 Subject: [Pythonmac-SIG] gcc error In-Reply-To: References: <2BFDF4ED-A8CE-11D8-840D-000393D555FA@uleth.ca> Message-ID: Right in one. ~ > gcc --version gcc (GCC) 3.3 Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ~ > gcc -no-cpp-precmp gcc: unrecognized option `-no-cpp-precmp' gcc: no input files ~ > gcc -no-cpp-precomp-blablabla gcc: unrecognized option `-no-cpp-precomp-blablabla' gcc: no input files Wrong gcc 3.3, wherever it came from! I will trash them all and reinstall from the Apple disks. Many thanks. On May 19, 2004, at 2:58 AM, Jack Jansen wrote: > > On 18-mei-04, at 15:20, Seamus O'Shea wrote: > >> >> Thanks for the response. In reply: >> >> I don't think so. I installed the recent developer tools, but I can >> get the error using the older compiler >> >> numarray-0.9 > sudo /usr/sbin/gcc_select 2 >> Default compiler has been set to: >> Apple Computer, Inc. version gcc-938, based on gcc version 2.95.2 >> 19991024 (release) >> numarray-0.9 > python setup.py build >> Using EXTRA_COMPILE_ARGS = ['-Ddarwin'] >> running build >> running build_py >> copying Lib/numinclude.py -> >> build/lib.darwin-7.3.0-Power_Macintosh-2.3/numarray >> running build_ext >> building 'numarray._conv' extension >> gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp >> -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -Wall >> -Wstrict-prototypes -IInclude/numarray >> -I/System/Library/Frameworks/Python.framework/Versions/2.3/include/ >> python2.3 -c Src/_convmodule.c -o >> build/temp.darwin-7.3.0-Power_Macintosh-2.3/Src/_convmodule.o >> -Ddarwin >> gcc: unrecognized option `-no-cpp-precomp' >> gcc: installation problem, cannot exec `cc1': No such file or >> directory >> error: command 'gcc' failed with exit status 1 >> >> I find it difficult to figure out where it is setting the various >> options, etc. Can you suggest a useful source to read for a coherent >> overview of what's supposed to happen? > > I still have the feeling that there's something else called "gcc" > lurking on your $PATH. Could you try the following three commands, > just to make sure? > > $ gcc --version > gcc (GCC) 3.3 20030304 (Apple Computer, Inc. build 1640) > Copyright (C) 2002 Free Software Foundation, Inc. > This is free software; see the source for copying conditions. There > is NO > warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR > PURPOSE. > > $ gcc -no-cpp-precomp > gcc: no input files > > $ gcc -no-cpp-precomp-blablabla > gcc: unrecognized option `-no-cpp-precomp-blablabla' > gcc: no input files > > -- > Jack Jansen, , http://www.cwi.nl/~jack > If I can't dance I don't want to be part of your revolution -- Emma > Goldman > > Dr. S?amus F. O'Shea Professor of Chemistry Vice President (Academic) & Provost University of Lethbridge (403) 329-2202 -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 2841 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040519/a4291ba3/attachment.bin From kenneth.m.mcdonald at sbcglobal.net Wed May 19 22:34:25 2004 From: kenneth.m.mcdonald at sbcglobal.net (Kenneth McDonald) Date: Wed May 19 22:34:33 2004 Subject: [Pythonmac-SIG] What system/software do you use for source control? Message-ID: <35C24FB6-AA06-11D8-95AF-000A956870AC@sbcglobal.net> This isn't quite a Python question, except to the extent that I want to put my Python source under some form of source code control and perhaps make some of it public, but it is definitely a Mac-related question. It's one of those questions that doesn't properly fit into any mailing list, so my apologies for posting it here. I've more or less settled on Subversion for the actual source code control system (but if people thought other things might be better for Python, I'd be interested in hearing about it.) However, my system is a laptop, and I'd like to have a "stable" server also, i.e. one others can rely on being connected. However, I do _not_ want to be maintaining another kind of system, meaning that I either want OS X on a Mac, or darwin on a PC. I'd be curious as to what people think of the possibilities. The problem with a Mac is that it is relatively expensive for a system that doesn't need to do much (even if I buy used). The problem with a PC is that to get it cheap, I'd need to put it together myself, and I don't want to do that. It'd be nice if there were a cheap, darwin-running self-contained minibox for about $300. Actually, what I really want is a 2-CPU system where one of the CPUs is in a laptop that detaches, and the two halves can function separately. Ah well, dream on... Cheers, Ken From drewmccormack at mac.com Thu May 20 08:40:25 2004 From: drewmccormack at mac.com (Drew McCormack) Date: Thu May 20 08:40:36 2004 Subject: [Pythonmac-SIG] Xgrid and python Message-ID: I have just published an article on MacDevCenter about writing cocoa apps that tap into Xgrid. The second part, which is available now, makes use of python and PIL in a batch image processing app. http://www.macdevcenter.com/pub/a/mac/2004/05/18/xgrid_pt2.html A big thanks goes out to Bob, Jack, and others who helped me get PIL up and running so that I could finish the project. Drew McCormack From dan at cgl.ucsf.edu Thu May 20 13:30:39 2004 From: dan at cgl.ucsf.edu (Daniel Greenblatt) Date: Thu May 20 13:30:43 2004 Subject: [Pythonmac-SIG] passing a url to a helper application In-Reply-To: References: Message-ID: Not quite sure where this question belongs.... I was able to succesfully write a helper application in Python, (mostly from people's help on this list!!) by making it listen for AppleEvents, specifically for the 'odoc' event Does anyone know if it is at all possible to determine the URL that a file came from (if it came from the browser, and was passed off to LaunchServices)?? I know on UNIX-y platforms, you can slip a '%u' into the mailcap entry that describes the helper application, but I'm not sure if there is any notion of this via the LaunchServices API... Thanks Dan ---------------------------- Daniel Greenblatt UCSF Computer Graphics Lab dan@cgl.ucsf.edu On Sat, 8 May 2004 pythonmac-sig-request@python.org wrote: > Date: Sat, 08 May 2004 12:01:19 -0400 > From: pythonmac-sig-request@python.org > Reply-To: pythonmac-sig@python.org > To: pythonmac-sig@python.org > Subject: Pythonmac-SIG Digest, Vol 13, Issue 8 > > Send Pythonmac-SIG mailing list submissions to > pythonmac-sig@python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/pythonmac-sig > or, via email, send a message with subject or body 'help' to > pythonmac-sig-request@python.org > > You can reach the person managing the list at > pythonmac-sig-owner@python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Pythonmac-SIG digest..." > From bob at redivi.com Thu May 20 13:44:57 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu May 20 13:45:08 2004 Subject: [Pythonmac-SIG] passing a url to a helper application In-Reply-To: References: Message-ID: <68ED93EE-AA85-11D8-A675-000A95686CD8@redivi.com> On May 20, 2004, at 1:30 PM, Daniel Greenblatt wrote: > I was able to succesfully write a helper application in Python, > (mostly from people's help on this list!!) > by making it listen for AppleEvents, specifically for the 'odoc' event > > Does anyone know if it is at all possible to determine the URL that a > file came from (if it came from the browser, and was passed off to > LaunchServices)?? > > I know on UNIX-y platforms, you can slip a '%u' into the > mailcap entry that describes the helper application, but I'm > not sure if there is any notion of this via the LaunchServices API... try implementing GURL instead of odoc: http://developer.apple.com/documentation/Carbon/Reference/ LaunchServicesReference/LSRReference/function_group_2.html -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040520/fd5bfa84/smime.bin From hengist.podd at virgin.net Thu May 20 16:53:09 2004 From: hengist.podd at virgin.net (has) Date: Thu May 20 17:05:52 2004 Subject: [Pythonmac-SIG] Bundlebuilder vs. save as applet In-Reply-To: References: <20040516222747.CFA6422A8B1@server.wordtechcommunications.com> <07C88AAA-A972-11D8-8D04-000A958D1666@cwi.nl> Message-ID: Jack Jansen wrote: >Good suggestions! I'm not sure how feasible the plugin idea would be >(it would need to do GUI things, and I'm not sure we can pull off >something that would work in, say, all of Cocoa, Tkinter and >wxPython based GUI apps), but we may be able to come up with some >sort of a trick that at least makes it look like a plugin. > >Could you add a SF feature request, please, and assign it to me? Done. 957652: Implement BundleBuilder GUI as plugin component. If you don't want to tie it to a specific GUI toolkit (probably a good idea), best solution may be to stick a generic interface between the Controller and View layers. You can then provide alternative Cocoa, Tkinter and wxPython View layers built to that interface as separate modules, and allow the client to import the appropriate module for their application. HTH has -- http://freespace.virgin.net/hamish.sanderson/ From bob at redivi.com Thu May 20 17:34:39 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu May 20 17:34:47 2004 Subject: [Pythonmac-SIG] Bundlebuilder vs. save as applet In-Reply-To: References: <20040516222747.CFA6422A8B1@server.wordtechcommunications.com> <07C88AAA-A972-11D8-8D04-000A958D1666@cwi.nl> Message-ID: <7FB332F7-AAA5-11D8-A675-000A95686CD8@redivi.com> On May 20, 2004, at 4:53 PM, has wrote: > Jack Jansen wrote: > >> Good suggestions! I'm not sure how feasible the plugin idea would be >> (it would need to do GUI things, and I'm not sure we can pull off >> something that would work in, say, all of Cocoa, Tkinter and wxPython >> based GUI apps), but we may be able to come up with some sort of a >> trick that at least makes it look like a plugin. >> >> Could you add a SF feature request, please, and assign it to me? > > Done. 957652: Implement BundleBuilder GUI as plugin component. > > If you don't want to tie it to a specific GUI toolkit (probably a good > idea), best solution may be to stick a generic interface between the > Controller and View layers. You can then provide alternative Cocoa, > Tkinter and wxPython View layers built to that interface as separate > modules, and allow the client to import the appropriate module for > their application. Why not just have some sort of command line, pipe, and/or apple event interface to the bundle building application that IDEs and such can use, instead of trying to make the IDEs do everything on their own? -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040520/1f52456b/smime.bin From daniel at brightfire.org Thu May 20 17:56:39 2004 From: daniel at brightfire.org (Daniel Lord) Date: Thu May 20 17:56:54 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 13, Issue 24 Message-ID: <92A81F9D-AAA8-11D8-AE70-000A95ACE052@brightfire.org> On May 20, 2004, at 9:11 AM, Kenneth McDonald wrote: > I've more or less settled on Subversion for the actual source code > control system (but if people thought other things might be better > for Python, I'd be interested in hearing about it.) For what it is worth, I use CVS between a laptop and dual desktop. Free, arcane, terse, narrow-functioning, with lot's of redundant third-party enhancements and command-line only out-of-the-box. Everything a good development tool should be . But 'free' takes first prize for me. Daniel From bob at redivi.com Thu May 20 18:18:18 2004 From: bob at redivi.com (Bob Ippolito) Date: Thu May 20 18:18:28 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 13, Issue 24 In-Reply-To: <92A81F9D-AAA8-11D8-AE70-000A95ACE052@brightfire.org> References: <92A81F9D-AAA8-11D8-AE70-000A95ACE052@brightfire.org> Message-ID: <99140B98-AAAB-11D8-A675-000A95686CD8@redivi.com> On May 20, 2004, at 5:56 PM, Daniel Lord wrote: > > On May 20, 2004, at 9:11 AM, Kenneth McDonald > wrote: > >> I've more or less settled on Subversion for the actual source code >> control system (but if people thought other things might be better >> for Python, I'd be interested in hearing about it.) > > For what it is worth, I use CVS between a laptop and dual desktop. > Free, arcane, terse, narrow-functioning, with lot's of redundant > third-party enhancements and command-line only out-of-the-box. > Everything a good development tool should be . But 'free' takes > first prize for me. Subversion does more or less everything you would want CVS to do (and then some), but better. You should take a look at it sometime, there's very little learning curve for someone who knows CVS already. Many of the useful third-party tools work with (or have equivalents for) Subversion, and it's more free (as in not GPL) than CVS is. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040520/2046dca6/smime.bin From steph at cs.ualberta.ca Fri May 21 12:48:14 2004 From: steph at cs.ualberta.ca (Stephanie Schaeffer) Date: Fri May 21 12:48:28 2004 Subject: [Pythonmac-SIG] Python and Quickdraw In-Reply-To: References: Message-ID: Does anyone have a small example of making a window and drawing on it using Python and Quickdraw that they could give me? I can draw, and I can make windows, but I can't seem to make the drawing come out on the windows ... Thanks for any help. Steph Schaeffer From drewmccormack at mac.com Fri May 21 12:58:24 2004 From: drewmccormack at mac.com (Drew McCormack) Date: Fri May 21 12:58:40 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 13, Issue 24 In-Reply-To: <99140B98-AAAB-11D8-A675-000A95686CD8@redivi.com> References: <92A81F9D-AAA8-11D8-AE70-000A95ACE052@brightfire.org> <99140B98-AAAB-11D8-A675-000A95686CD8@redivi.com> Message-ID: <12D4169C-AB48-11D8-B9A0-0003937B5C28@mac.com> On May 21, 2004, at 12:18 AM, Bob Ippolito wrote: > > On May 20, 2004, at 5:56 PM, Daniel Lord wrote: > >> >> On May 20, 2004, at 9:11 AM, Kenneth McDonald >> wrote: >> >>> I've more or less settled on Subversion for the actual source code >>> control system (but if people thought other things might be better >>> for Python, I'd be interested in hearing about it.) >> >> For what it is worth, I use CVS between a laptop and dual desktop. >> Free, arcane, terse, narrow-functioning, with lot's of redundant >> third-party enhancements and command-line only out-of-the-box. >> Everything a good development tool should be . But 'free' takes >> first prize for me. > > Subversion does more or less everything you would want CVS to do (and > then some), but better. You should take a look at it sometime, > there's very little learning curve for someone who knows CVS already. > Many of the useful third-party tools work with (or have equivalents > for) Subversion, and it's more free (as in not GPL) than CVS is. > > -bob I thought I would give subversion a try last week, but couldn't get it to install properly. You have to install all manner of different libraries, which is a bit of a barrier to adoption. After I installed all of the packages supplied, I came up against a problem with the libxml installed in the system, which was not a compatible version. I got around it a little by setting the DYLD_LIBRARY_PATH, but for some things it resorted to the system libxml and failed. If anyone can tell me how to get it running under panther, I would be much obliged. What would really be great is a single OS X installer for subversion and all dependencies... Drew From bdash at gmx.net Fri May 21 13:09:09 2004 From: bdash at gmx.net (Mark Rowe) Date: Fri May 21 13:09:20 2004 Subject: [Pythonmac-SIG] Re: Pythonmac-SIG Digest, Vol 13, Issue 24 In-Reply-To: <12D4169C-AB48-11D8-B9A0-0003937B5C28@mac.com> References: <92A81F9D-AAA8-11D8-AE70-000A95ACE052@brightfire.org> <99140B98-AAAB-11D8-A675-000A95686CD8@redivi.com> <12D4169C-AB48-11D8-B9A0-0003937B5C28@mac.com> Message-ID: <92D1A1E0-AB49-11D8-80C5-000A95D05654@gmx.net> On 22/05/2004, at 04:58, Drew McCormack wrote: > If anyone can tell me how to get it running under panther, I would be > much obliged. What would really be great is a single OS X installer > for subversion and all dependencies... http://homepage.mac.com/martinott/ Cheers, Mark From Jack.Jansen at cwi.nl Sun May 23 16:24:07 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Sun May 23 16:24:16 2004 Subject: [Pythonmac-SIG] Python and Quickdraw In-Reply-To: References: Message-ID: <2470025E-ACF7-11D8-9821-000D934FF6B4@cwi.nl> On 21 May 2004, at 18:48, Stephanie Schaeffer wrote: > Does anyone have a small example of making a window and drawing on it > using Python and Quickdraw that they could give me? I can draw, and I > can make windows, but I can't seem to make the drawing come out on the > windows ... Do you go into the event loop? Since OSX drawing is normally double-buffered, and nothing is actually show until you go into the event loop. The best source of example quickdraw code (although not the simplest, probably) is the IDE, which is completely quickdraw-based. -- 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 tobis at geosci.uchicago.edu Sun May 23 18:11:34 2004 From: tobis at geosci.uchicago.edu (Michael Tobis) Date: Sun May 23 18:16:18 2004 Subject: [Pythonmac-SIG] PythonIDE problem Message-ID: I'm tutoring my wife in Python basics. We played around with Python interactive long enough to get the feel for it and conclude that she is interested, so I downloaded 2.3.3, partly so when we get to objects she won't have to deal with two kinds, but mostly to get PythonIDE. No problems with the download. I got PythonIDE working fine at first. Problem: she had a couple of source files saved already on her OS X desktop, so in Python -> Preferences -> Set Scripts Folder I chose ~/Desktop, or maybe, if I was being foolish, /Desktop. Whichever I did, it was a bad idea, and PythonIDE crashed horribly. No big deal, I'm happy to go fix it, but now PythonIDE won't start. Ouch. Symptoms: I get the splash box, and then the program quietly exits. I reinstalled the entire 2.3.3 dmg, but apparently that didn't overwrite the parameter that I clobbered. PythonIDE still won't start! I therefore write this list for two reasons, presuming that the origin of my problems is as I understand them. Reason 1: bug report. I have discovered the hard way a way for a naive user to permanently disable PythonIDE by making a simple mistake. Can someone tell me to whom I should address this issue? Reason 2: request for assistance. Presumably there is a parameter file somewhere that I can alter or remove. Can anyone point me at it or at the people who can assist me in finding it? thanks Michael Tobis From cookedm at physics.mcmaster.ca Sun May 23 19:30:52 2004 From: cookedm at physics.mcmaster.ca (David M. Cooke) Date: Sun May 23 19:30:55 2004 Subject: [Pythonmac-SIG] PythonIDE problem In-Reply-To: References: Message-ID: <20040523233052.GA31702@arbutus.physics.mcmaster.ca> On Sun, May 23, 2004 at 05:11:34PM -0500, Michael Tobis wrote: > Reason 2: request for assistance. Presumably there is a parameter file > somewhere that I can alter or remove. Can anyone point me at it or at the > people who can assist me in finding it? Looks like the preferences file is at "~/Library/Preferences/Python/PythonIDE preferences". Remove that. -- |>|\/|< /--------------------------------------------------------------------------\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |cookedm@physics.mcmaster.ca From Jack.Jansen at cwi.nl Mon May 24 04:03:03 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Mon May 24 04:03:03 2004 Subject: [Pythonmac-SIG] PythonIDE problem In-Reply-To: References: Message-ID: On 24-mei-04, at 0:11, Michael Tobis wrote: > Reason 1: bug report. I have discovered the hard way a way for a naive > user > to permanently disable PythonIDE by making a simple mistake. Can > someone > tell me to whom I should address this issue? Thanks, I've added a bug report . The problem is that it recursively searches your Desktop for files, and runs out of menu IDs while doing so. -- 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 gandreas at delver.com Mon May 24 22:58:15 2004 From: gandreas at delver.com (Glenn Andreas) Date: Mon May 24 22:58:26 2004 Subject: [Pythonmac-SIG] What's installed by default on Jaguar? Message-ID: So I just noticed that on a recently clean install of Jaguar (with the latest patches, incuding BSD "optional" install, but no developer tools installed), PyOXIDE wouldn't work correctly. I eventually narrowed it down to the fact that I couldn't import objc. I thought this was part of Python.framework by default, but apparently not. So I went to packman to install it. I could have sworn there was a nice little icon & stand alone verison of it, but couldn't find that either. Eventually I used the shell to go to (IIRC) /System/Library/Frameworks/Python.Framework/Versions/2.3/Mac/Tools/IDE and directly opened PackageManager.py using pythonw. It doesn't work either - it can't import waste. Can't launch the IDE there - again, no waste. Looking in /Library/Python/2.3 all that's in there is a README that says what it is there for (but no information on where to get more stuff). On a machine that's been updated over the years to 10.3 /Library/Python/2.3 has both _tkinter.so and waste.so (I remember installing _tkinter.so using PackMan - obviously I didn't install waste.so with PackMan because, well, PackMan doesn't run without it). So how does one install waste.so in the first place? (I ended up using pimp.py to manually install PyObjC binary and that works, but I didn't see waste on the list of packages - if I didn't read this mailing list I would have never known to try that). -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From bob at redivi.com Mon May 24 23:21:48 2004 From: bob at redivi.com (Bob Ippolito) Date: Mon May 24 23:21:55 2004 Subject: [Pythonmac-SIG] What's installed by default on Jaguar? In-Reply-To: References: Message-ID: On May 24, 2004, at 10:58 PM, Glenn Andreas wrote: > So I just noticed that on a recently clean install of Jaguar (with the > latest patches, incuding BSD "optional" install, but no developer > tools installed), PyOXIDE wouldn't work correctly. I eventually > narrowed it down to the fact that I couldn't import objc. I thought > this was part of Python.framework by default, but apparently not. Jaguar comes with a statically linked Python 2.2.0 (which is to say it is definitely not a framework, among other things) without many of the goodies. Don't use it for anything, especially not extension modules, and *very* especially not PyObjC (Ronald has some godawful hack where he actually turns off the garbage collector if you import PyObjC from Python 2.2.0.. so that it doesn't crash!). I have a lot of experience with Python 2.2.0 and its bugs, and I tried really hard to make things work with it, but then I gave up. I highly suggest you do the same, immediately, before you cause yourself any more pain. objc is part of PyObjC. Stock Python comes with no special support for Objective C whatsoever, and unlike Perl and Java, Apple does not distribute any sort of Objective C bridge for Python in a default install. > So I went to packman to install it. I could have sworn there was a > nice little icon & stand alone verison of it, but couldn't find that > either. Eventually I used the shell to go to (IIRC) > /System/Library/Frameworks/Python.Framework/Versions/2.3/Mac/Tools/IDE > and directly opened PackageManager.py using pythonw. It doesn't work > either - it can't import waste. Can't launch the IDE there - again, > no waste. > > Looking in /Library/Python/2.3 all that's in there is a README that > says what it is there for (but no information on where to get more > stuff). On a machine that's been updated over the years to 10.3 > /Library/Python/2.3 has both _tkinter.so and waste.so (I remember > installing _tkinter.so using PackMan - obviously I didn't install > waste.so with PackMan because, well, PackMan doesn't run without it). Where did this Python2.3 even come from? It sounds like you did something strange, like installing Jaguar over Panther? If you installed the MacPython 2.3 distro for Jaguar, it should already have waste with it, because all of the GUI tools it ships with depend on it. > So how does one install waste.so in the first place? (I ended up using > pimp.py to manually install PyObjC binary and that works, but I didn't > see waste on the list of packages - if I didn't read this mailing list > I would have never known to try that). waste.so is built as part of the Python source tree, but only if you have its dependency in the right place. It's documented somewhere in Python's source, but I haven't bothered with waste in a very long time.. Jack could probably rattle the details off the top of his head though. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040524/ec483a69/smime.bin From gandreas at delver.com Tue May 25 00:29:32 2004 From: gandreas at delver.com (Glenn Andreas) Date: Tue May 25 00:29:47 2004 Subject: [Pythonmac-SIG] What's installed by default on _Panther_? Message-ID: At 11:21 PM -0400 5/24/04, Bob Ippolito wrote: >On May 24, 2004, at 10:58 PM, Glenn Andreas wrote: > >>So I just noticed that on a recently clean install of Jaguar (with >>the latest patches, incuding BSD "optional" install, but no >>developer tools installed), PyOXIDE wouldn't work correctly. I >>eventually narrowed it down to the fact that I couldn't import >>objc. I thought this was part of Python.framework by default, but >>apparently not. [excellent explanation snipped to attempt to cover embarasment] Next time I'll actually type what I mean, and not something else that I don't. So what's on _Panther_ (10.3) by default? (And any guesses as to what we'll see in Tiger in a month?) -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From bob at redivi.com Tue May 25 00:36:26 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 25 00:36:33 2004 Subject: [Pythonmac-SIG] What's installed by default on _Panther_? In-Reply-To: References: Message-ID: <15962874-AE05-11D8-BDF7-000A95686CD8@redivi.com> On May 25, 2004, at 12:22 AM, Glenn Andreas wrote: > At 11:21 PM -0400 5/24/04, Bob Ippolito wrote: >> On May 24, 2004, at 10:58 PM, Glenn Andreas wrote: >> >>> So I just noticed that on a recently clean install of Jaguar (with >>> the latest patches, incuding BSD "optional" install, but no >>> developer tools installed), PyOXIDE wouldn't work correctly. I >>> eventually narrowed it down to the fact that I couldn't import objc. >>> I thought this was part of Python.framework by default, but >>> apparently not. > > [excellent explanation snipped to attempt to cover embarasment] > > Next time I'll actually type what I mean, and not something else that > I don't. > > So what's on _Panther_ (10.3) by default? Python 2.3.0 - all of the extensions you would typically expect - except for readline and waste - with the addition of the closed-source CoreGraphics SWIG wrapper from Apple Waste is best obtained from the MacPython 2.3 additions from Jack's official MacPython page, and readline can be easily acquired via PackageManager or pimp (with or without the additions, respectively) > (And any guesses as to what we'll see in Tiger in a month?) Even if I knew, which I don't, it probably shouldn't be talked about here (since anyone who gets to see it next month is under NDA). In any case, I'm hoping that whatever Tiger's preview has is flexible, because we still don't have the -undefined dynamic_lookup patches into CVS HEAD, let alone the 2.3 tree.. I really really really really really really really would like to have that stuff in 10.4 because Fatal Python Error: Interpreter Not initialized (version mismatch?) -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040525/1499f5cf/smime.bin From gandreas at delver.com Tue May 25 10:13:03 2004 From: gandreas at delver.com (Glenn Andreas) Date: Tue May 25 10:15:29 2004 Subject: [Pythonmac-SIG] What's installed by default on _Panther_? In-Reply-To: <15962874-AE05-11D8-BDF7-000A95686CD8@redivi.com> References: <15962874-AE05-11D8-BDF7-000A95686CD8@redivi.com> Message-ID: At 12:36 AM -0400 5/25/04, Bob Ippolito wrote: >On May 25, 2004, at 12:22 AM, Glenn Andreas wrote: > >> >>So what's on _Panther_ (10.3) by default? > >Python 2.3.0 > - all of the extensions you would typically expect > - except for readline and waste > - with the addition of the closed-source CoreGraphics SWIG wrapper >from Apple > >Waste is best obtained from the MacPython 2.3 additions from Jack's >official MacPython page, and readline can be easily acquired via >PackageManager or pimp (with or without the additions, respectively) So now my question is why is PackMan & IDE source installed when Waste, which is required to use them, isn't? My underlying problem is that if somebody installs and runs PyOXIDE without having PyObjC installed (as would be the case of a fresh clean install), it doesn't work - I was going to have an alert to tell them to use PackMan to install it (since that works nice and simple), but in this case the probably won't have waste installed either, so they can't do that. I guess I'll just provide a way for the user to use pimp directly to install PyObjC. Is it's API stable enough for generic third parties to use it? I suppose I could also bundle it with PyOXIDE, but I'd rather have an "official" version installed in the system, in case of bug fixes in that version. >>(And any guesses as to what we'll see in Tiger in a month?) > >Even if I knew, which I don't, it probably shouldn't be talked about >here (since anyone who gets to see it next month is under NDA). > >In any case, I'm hoping that whatever Tiger's preview has is >flexible, because we still don't have the -undefined dynamic_lookup >patches into CVS HEAD, let alone the 2.3 tree.. I really really >really really really really really would like to have that stuff in >10.4 because >Fatal Python Error: Interpreter Not initialized (version mismatch?) Sorry - not asking for NDA violation, rather more along of the second comment - what would reasonable to expect and other concerns and desires to be able to bring to them during WWDC (and any suggestions about who to talk to help make this happen). For example, I'd love to see PyObjC included, but is it stable enough & "license compatible" for that to happen? Or for that matter, having Python be part of the base install (instad of the optional BSD install so we would know that we could safely write (pre/post)installer scripts in Python instead of some other abomination). -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From bob at redivi.com Tue May 25 10:44:32 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 25 10:44:45 2004 Subject: [Pythonmac-SIG] What's installed by default on _Panther_? In-Reply-To: References: <15962874-AE05-11D8-BDF7-000A95686CD8@redivi.com> Message-ID: <08E871CE-AE5A-11D8-BDF7-000A95686CD8@redivi.com> On May 25, 2004, at 10:13 AM, Glenn Andreas wrote: > At 12:36 AM -0400 5/25/04, Bob Ippolito wrote: >> On May 25, 2004, at 12:22 AM, Glenn Andreas wrote: >> >>> >>> So what's on _Panther_ (10.3) by default? >> >> Python 2.3.0 >> - all of the extensions you would typically expect >> - except for readline and waste >> - with the addition of the closed-source CoreGraphics SWIG wrapper >> from Apple >> >> Waste is best obtained from the MacPython 2.3 additions from Jack's >> official MacPython page, and readline can be easily acquired via >> PackageManager or pimp (with or without the additions, respectively) > > So now my question is why is PackMan & IDE source installed when > Waste, which is required to use them, isn't? My underlying problem is > that if somebody installs and runs PyOXIDE without having PyObjC > installed (as would be the case of a fresh clean install), it doesn't > work - I was going to have an alert to tell them to use PackMan to > install it (since that works nice and simple), but in this case the > probably won't have waste installed either, so they can't do that. It's not there because Apple chose not to compile it, same with readline. Either they didn't know how that there were required dependencies to make waste compile, or they chose not to include it for license reasons. > I guess I'll just provide a way for the user to use pimp directly to > install PyObjC. Is it's API stable enough for generic third parties > to use it? I suppose I could also bundle it with PyOXIDE, but I'd > rather have an "official" version installed in the system, in case of > bug fixes in that version. The API of pimp is guaranteed to be stable for Python 2.3. For 2.4, we may change it. >>> (And any guesses as to what we'll see in Tiger in a month?) >> >> Even if I knew, which I don't, it probably shouldn't be talked about >> here (since anyone who gets to see it next month is under NDA). >> >> In any case, I'm hoping that whatever Tiger's preview has is >> flexible, because we still don't have the -undefined dynamic_lookup >> patches into CVS HEAD, let alone the 2.3 tree.. I really really >> really really really really really would like to have that stuff in >> 10.4 because >> Fatal Python Error: Interpreter Not initialized (version mismatch?) > > Sorry - not asking for NDA violation, rather more along of the second > comment - what would reasonable to expect and other concerns and > desires to be able to bring to them during WWDC (and any suggestions > about who to talk to help make this happen). > > For example, I'd love to see PyObjC included, but is it stable enough > & "license compatible" for that to happen? Or for that matter, > having Python be part of the base install (instad of the optional BSD > install so we would know that we could safely write > (pre/post)installer scripts in Python instead of some other > abomination). PyObjC is license compatible, but I don't think it's a good idea for 10.4 because the deadline for that is coming up Real Soon Now and it would probably make upgrading and supporting PyObjC more difficult. Having Python as part of the base install would be great, though. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040525/49fe6dca/smime-0001.bin From gandreas at delver.com Tue May 25 15:08:01 2004 From: gandreas at delver.com (Glenn Andreas) Date: Tue May 25 15:08:19 2004 Subject: [Pythonmac-SIG] /System/Library vs /Library Message-ID: Just so hopefully nobody else hits this problem. If you have a system that started life as a 10.2 system with python added on, upgraded to 10.3 and run an application that embeds/links to Python.framework, things might not work as expected. The 10.2 add-on python gets installed in /Library/Frameworks/Python.framework. 10.3 provides /System/Library/Frameworks/Python.framework. If your app is linked to Python.framework, it will end up with the 10.2 version of Python.framework, and not the 10.3 one, since /Library/Frameworks is searched before /System/Library/Frameworks (see http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/InstallingFrameworks.html#//apple_ref/doc/uid/20002261/TPXREF101). Even though both of these probably are 2.3 python, if you use PackMan in SLFP to install a module (say, PyObjC), your app that embedded Python via Python.framework won't see it, since it will end up looking in LFP. You will then swear, remove things, re-install things, try to figure out why system.path on the /usr/bin/python works correctly (and refers to the site package in SLFP where you just installed PyObjC), yet your app is unable to import something you know that you just installed. -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From eichin at metacarta.com Tue May 25 15:16:43 2004 From: eichin at metacarta.com (eichin@metacarta.com) Date: Tue May 25 15:16:51 2004 Subject: [Pythonmac-SIG] What's installed by default on _Panther_? In-Reply-To: <15962874-AE05-11D8-BDF7-000A95686CD8@redivi.com> References: <15962874-AE05-11D8-BDF7-000A95686CD8@redivi.com> Message-ID: <7gr7t88gh0.fsf@pikespeak.metacarta.com> > Python 2.3.0 > - all of the extensions you would typically expect That reminds me, I keep running into things that do from xml.sax import saxutils from xml.sax import saxlib and not finding saxutils, but not finding saxlib - it's probably because the code is written on Debian which *does* have saxlib.py in the python-xml package; I'd be less surpised if neither of them were present, but finding one and not the other seems odd... is it just an older (or newer) version? Or something that's only similar, but not the same? From bob at redivi.com Tue May 25 15:22:03 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 25 15:22:16 2004 Subject: [Pythonmac-SIG] /System/Library vs /Library In-Reply-To: References: Message-ID: On May 25, 2004, at 3:08 PM, Glenn Andreas wrote: > Just so hopefully nobody else hits this problem. > > If you have a system that started life as a 10.2 system with python > added on, upgraded to 10.3 and run an application that embeds/links to > Python.framework, things might not work as expected. > > The 10.2 add-on python gets installed in > /Library/Frameworks/Python.framework. 10.3 provides > /System/Library/Frameworks/Python.framework. If your app is linked to > Python.framework, it will end up with the 10.2 version of > Python.framework, and not the 10.3 one, since /Library/Frameworks is > searched before /System/Library/Frameworks (see > http://developer.apple.com/documentation/MacOSX/Conceptual/ > BPFrameworks/Tasks/InstallingFrameworks.html#//apple_ref/doc/uid/ > 20002261/TPXREF101). > > Even though both of these probably are 2.3 python, if you use PackMan > in SLFP to install a module (say, PyObjC), your app that embedded > Python via Python.framework won't see it, since it will end up looking > in LFP. You will then swear, remove things, re-install things, try to > figure out why system.path on the /usr/bin/python works correctly (and > refers to the site package in SLFP where you just installed PyObjC), > yet your app is unable to import something you know that you just > installed. We're very aware of it. This is why we have "how to remove a jaguar python" in the FAQ. The linking-to-the-wrong-framework problem is compounded by the fact that if you do have both pythons and you link a module intended for one from the other then you will have *both* python images in memory and you'll get a version mismatch. The linking-to-the-wrong-framework problem should be solved for later versions of Python 2.3 (I'm not sure which exactly, but I am relatively sure that 2.3.3 included the -F fix). The latter problem has a solution for users of Mac OS X 10.3+ and I've produced a patch but it is not in CVS, last I checked. -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040525/8a9d7fe9/smime.bin From bob at redivi.com Tue May 25 15:24:29 2004 From: bob at redivi.com (Bob Ippolito) Date: Tue May 25 15:24:38 2004 Subject: [Pythonmac-SIG] What's installed by default on _Panther_? In-Reply-To: <7gr7t88gh0.fsf@pikespeak.metacarta.com> References: <15962874-AE05-11D8-BDF7-000A95686CD8@redivi.com> <7gr7t88gh0.fsf@pikespeak.metacarta.com> Message-ID: <248B3F42-AE81-11D8-B0B2-000A95686CD8@redivi.com> On May 25, 2004, at 3:16 PM, eichin@metacarta.com wrote: > >> Python 2.3.0 >> - all of the extensions you would typically expect > > That reminds me, I keep running into things that do > > from xml.sax import saxutils > from xml.sax import saxlib > > and not finding saxutils, but not finding saxlib - it's probably > because the code is written on Debian which *does* have saxlib.py in > the python-xml package; I'd be less surpised if neither of them were > present, but finding one and not the other seems odd... is it just an > older (or newer) version? Or something that's only similar, but not > the same? python-xml is not part of the standard library! It's PyXML. Blame this on whomever thought it was a good idea for the standard library to be "extended" by some third party package when present. If you had PyXML, you would be able to import _xmlplus (this is the awful hack they use to inject stuff into the xml namespace). -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040525/0f1aa033/smime.bin From gandreas at visi.com Tue May 25 00:22:51 2004 From: gandreas at visi.com (Glenn Andreas) Date: Tue May 25 16:37:38 2004 Subject: [Pythonmac-SIG] What's installed by default on _Panther_? In-Reply-To: References: Message-ID: At 11:21 PM -0400 5/24/04, Bob Ippolito wrote: >On May 24, 2004, at 10:58 PM, Glenn Andreas wrote: > >>So I just noticed that on a recently clean install of Jaguar (with >>the latest patches, incuding BSD "optional" install, but no >>developer tools installed), PyOXIDE wouldn't work correctly. I >>eventually narrowed it down to the fact that I couldn't import >>objc. I thought this was part of Python.framework by default, but >>apparently not. [excellent explanation snipped to attempt to cover embarasment] Next time I'll actually type what I mean, and not something else that I don't. So what's on _Panther_ (10.3) by default? (And any guesses as to what we'll see in Tiger in a month?) -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From p.thibault at bigfoot.com Wed May 26 20:03:47 2004 From: p.thibault at bigfoot.com (Pierre Thibault) Date: Wed May 26 20:05:33 2004 Subject: [Pythonmac-SIG] How to debug? Message-ID: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> Hello, I would like to debug my code in Python. So I am looking for a debugger. I would like to use IDLE but I am unable to start it properly. Is it working on OS X? I would like to know what tools people are using for this purpose. I am looking for a free alternative because I am student. If you like, you can tell the other tools you are using for Python programming. This will give idea. Thank you. --------------------- Pierre From mwh at python.net Thu May 27 06:33:11 2004 From: mwh at python.net (Michael Hudson) Date: Thu May 27 06:33:14 2004 Subject: [Pythonmac-SIG] How to debug? In-Reply-To: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> (Pierre Thibault's message of "Wed, 26 May 2004 20:03:47 -0400") References: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> Message-ID: <2mhdu22m8o.fsf@starship.python.net> Pierre Thibault writes: > Hello, > > I would like to debug my code in Python. So I am looking for a > debugger. I would like to use IDLE but I am unable to start it > properly. Is it working on OS X? > > I would like to know what tools people are using for this purpose. I > am looking for a free alternative because I am student. > > If you like, you can tell the other tools you are using for Python > programming. This will give idea. Well, for debugging I generally use the old methods of: 1) thinking hard, 2) print statements, and 3) pdb from the command line What kind of app are you debugging? That impacts the answer quite a lot... Cheers, mwh -- If you give someone Fortran, he has Fortran. If you give someone Lisp, he has any language he pleases. -- Guy L. Steele Jr, quoted by David Rush in comp.lang.scheme.scsh From chris at fonnesbeck.org Thu May 27 12:11:43 2004 From: chris at fonnesbeck.org (Christopher Fonnesbeck) Date: Thu May 27 12:11:50 2004 Subject: [Pythonmac-SIG] How to debug? Message-ID: <8BC6EDB6-AFF8-11D8-9630-000A956FDAC0@fonnesbeck.org> By *far* the best python debugger I have seen is the JPyDebug plugin for jEdit. Download jEdit, then install the JPyDebug plugin using the plugin manager. I have had no problems with it so far, and it is very easy to use (I recommend docking it at the bottom of the editor, but it can float as well). Chris -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia "The primary objective of copyright is not to reward the labor of authors, but [t]o promote the Progress of Science and useful Arts. To this end, copyright assures authors the right to their original expression, but encourages others to build freely upon the ideas and information conveyed by a work. This result is neither unfair nor unfortunate. It is the means by which copyright advances the progress of science and art." -- US Supreme Court Justice Sandra Day O'Connor From p.thibault at bigfoot.com Thu May 27 12:31:53 2004 From: p.thibault at bigfoot.com (Pierre Thibault) Date: Thu May 27 12:32:56 2004 Subject: [Pythonmac-SIG] How to debug? In-Reply-To: <2mhdu22m8o.fsf@starship.python.net> References: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> <2mhdu22m8o.fsf@starship.python.net> Message-ID: <5CC8FB40-AFFB-11D8-A002-000A95B2409A@bigfoot.com> Le 27 mai 2004, ? 06:33, Michael Hudson a ?crit : > What kind of app are you debugging? That impacts the answer quite a > lot... > I usually program small app. I use Python as a multipurpose language. For me, it is a replacement of the good old BASIC. I'm using it to apply some of the concept that I am learning at school. I am expecting a debugger. I want to be able to run my code line by line and I want to be able to see the value of my variables as they change. Last monday, I was sick. So I made a little Python app to solve "mots cach?s" to spare time. I don't know how you are calling this in English "hidden words"? Here is the code. This is an example of the small apps I do. I gives the letters not found in capital. ------------------------------------------------------------------------ ------------------------- import copy class CrossWordSolver(object): def __init__( self , letters = [""], words = [""]): self.letters = letters # Mutable sequence of string self.words = words # Mutable sequence of string def getLetters( self ): return copy.deepcopy( self._letters ) def setLetters( self, letters ): # letters is a mutable sequence a string self._letters = copy.deepcopy( letters ) self._width = len( self._letters[0] ) self._height = len ( self._letters ) self._letters = [i.upper() for i in self._letters] letters = property( getLetters, setLetters, doc = "Letters of the crossword") def getWords( self ): return copy.deepcopy( self._words ) def setWords( self, words ): # words is a mutable sequence of word self._words = copy.deepcopy( words ) self._words = [i.upper() for i in self._words] words = property( getWords, setWords, doc = "Words to find") def solve( self ): for word in self._words: for dx in -1, 0, 1: for dy in -1, 0, 1: if dx+dy: for x in xrange( self._width ): for y in xrange( self. _height ): wX, wY = x, y for letter in word: if wX >= self._width or wY >= self._height : break if self._letters[wY][wX].upper() != letter.upper() : break wX += dx wY += dy else: for i in xrange( len( word ) ): i = x+dx*i line = self._letters[y] self._letters[y] = line[0:i]+line[i].lower()+line[i+1:] y += dy return self._letters if __name__ == "__main__": crossWordSolver = CrossWordSolver() crossWordSolver.letters = ["tnpevideoenmyheros", "hcoehfdnairfaveuru", "oeorrtgauchepmarco", "relnegnrertitapism", "amsbspoesignergite", "xiosmuplmehcuabedr", "urnjaelaatlmollets", "eaiatisannasunisoe", "scmrnrmntaarroboti", "aloraoecerdmtsiloc", "vedeiuiriremoeanth", "omilftreneaxirrore", "tuvlniuvohcbasmyur", "raaioecaunauotorqe", "apnmcrepitiratibut", "fdouzeuqsidaesrmep", "iertilombricrmeero", "cgaufreevuafngorge"] crossWordSolver.words = ["admis", "armoire", "colis", "confiant", "consulat", "crampe", "debauche", "disque", "divan", "domino", "douze", "ecurie", "embryon", "ensemble", "errant", "essaim", "fauve", "faveur", "friand", "gauche", "gaufre", "gorge", "grain", "harem", "heros", "hymne", "inoui", "jarre", "litre", "lombric", "mante", "menthe", "mille", "miracle", "mollet", "napperon", "opter", "paume", "paver", "pergola", "rabot", "remous", "repit", "robot", "roman", "routier", "sauce", "seiche", "signe", "sinus", "tapis", "tarte", "taxer", "thorax", "tigre", "titrer", "trafic", "truquer", "vaseux", "video"] print crossWordSolver.solve() ------------------------------------------------------------------------ -------- I really like to do this in Python because it is so easy to do nice things with few code. Is it helping? Regards. --------------------- Pierre -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 3851 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040527/b558bfc2/attachment.bin From lanceboyle at cwazy.co.uk Fri May 28 00:40:07 2004 From: lanceboyle at cwazy.co.uk (Lance Boyle) Date: Fri May 28 00:39:57 2004 Subject: [Pythonmac-SIG] How to debug? In-Reply-To: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> References: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> Message-ID: <18753AB6-B061-11D8-B39D-003065F93FF0@cwazy.co.uk> While we're on the subject--If writing with PyObjC in Xcode, can the Xcode debugger be used on the Python code? Jerry On May 26, 2004, at 5:03 PM, Pierre Thibault wrote: > Hello, > > I would like to debug my code in Python. So I am looking for a > debugger. I would like to use IDLE but I am unable to start it > properly. Is it working on OS X? > > I would like to know what tools people are using for this purpose. I > am looking for a free alternative because I am student. > > If you like, you can tell the other tools you are using for Python > programming. This will give idea. > > Thank you. > > --------------------- > Pierre > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > From ronaldoussoren at mac.com Fri May 28 02:05:18 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri May 28 02:06:13 2004 Subject: [Pythonmac-SIG] How to debug? In-Reply-To: <18753AB6-B061-11D8-B39D-003065F93FF0@cwazy.co.uk> References: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> <18753AB6-B061-11D8-B39D-003065F93FF0@cwazy.co.uk> Message-ID: On 28-mei-04, at 6:40, Lance Boyle wrote: > While we're on the subject--If writing with PyObjC in Xcode, can the > Xcode debugger be used on the Python code? No, the Xcode debugger is for (Objective-)C(++) code only. It can be used to debug PyObjC itself, but that is of limited use for the population of this list :-) Ronald > > Jerry > > > > On May 26, 2004, at 5:03 PM, Pierre Thibault wrote: > >> Hello, >> >> I would like to debug my code in Python. So I am looking for a >> debugger. I would like to use IDLE but I am unable to start it >> properly. Is it working on OS X? >> >> I would like to know what tools people are using for this purpose. I >> am looking for a free alternative because I am student. >> >> If you like, you can tell the other tools you are using for Python >> programming. This will give idea. >> >> Thank you. >> >> --------------------- >> Pierre >> >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From brad.allen at omsdal.com Fri May 28 02:32:37 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Fri May 28 02:33:49 2004 Subject: [Pythonmac-SIG] how to determine Mac OS X version Message-ID: I tried platform.mac_ver(), but this seems to be broken. Google turns up various bug reports on this function. I can use the shell command system_profiler on 10.3 but it's too slow on 10.2. We still have lots of machines running 10.2, and it will be several months before they can all be upgraded. sysctl doesn't have a variable for this, only for the Darwin version. Does anybody know a way to do this using Python or calling an outside shell command? I'd like something that will work for both 10.2 and 10.3 without having to install additional Python modules. Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040528/30ceb8f3/attachment.html From bob at redivi.com Fri May 28 02:53:27 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri May 28 02:53:39 2004 Subject: [Pythonmac-SIG] how to determine Mac OS X version In-Reply-To: References: Message-ID: On May 28, 2004, at 2:32 AM, brad.allen@omsdal.com wrote: > > I tried platform.mac_ver(), but this seems to be broken. Google turns > up various bug reports on this function. > > I can use the shell command system_profiler on 10.3 but it's too slow > on 10.2. We still have lots of machines running 10.2, and it will be > several months before they can all be upgraded. Does /usr/bin/sw_vers exist on 10.2? If so, that would be your best bet.. That's what I use in my PackageManager repository scripts. > sysctl doesn't have a variable for this, only for the Darwin version. "only for the Darwin version"? What does that mean? > Does anybody know a way to do this using Python or calling an outside > shell command? I'd like something that will work for both 10.2 and > 10.3 without having to install additional Python modules. see sw_vers above. -bob From bob at redivi.com Fri May 28 02:54:22 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri May 28 02:54:28 2004 Subject: [Pythonmac-SIG] How to debug? In-Reply-To: References: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> <18753AB6-B061-11D8-B39D-003065F93FF0@cwazy.co.uk> Message-ID: On May 28, 2004, at 2:05 AM, Ronald Oussoren wrote: > > On 28-mei-04, at 6:40, Lance Boyle wrote: > >> While we're on the subject--If writing with PyObjC in Xcode, can the >> Xcode debugger be used on the Python code? > > No, the Xcode debugger is for (Objective-)C(++) code only. It can be > used to debug PyObjC itself, but that is of limited use for the > population of this list :-) It can also be used to debug Python itself, or any extension modules.. which has been a great help to me when I'm working on Stackless. -bob From Jack.Jansen at cwi.nl Fri May 28 05:03:56 2004 From: Jack.Jansen at cwi.nl (Jack Jansen) Date: Fri May 28 05:03:56 2004 Subject: [Pythonmac-SIG] how to determine Mac OS X version In-Reply-To: References: Message-ID: On 28-mei-04, at 8:32, brad.allen@omsdal.com wrote: > > I tried platform.mac_ver(), but this seems to be broken. Google turns > up various bug reports on this function. I don't fully remember whether something was changed for Python 2.3, but mac_ver() works nicely for me (MacPython 2.3, MacOSX 10.3). What exactly is the problem you're having? But anyway, if it doesn't work for you the solution is to use the underlying gestalt call: >>> import gestalt >>> print hex(gestalt.gestalt('sysv')) the "sysv" version of gestalt should be interpreted as an 8-bit BCD value followed by 2 4-bit values (which prints out nicely in hex). So 0x1033 means 10.3.3 (not 16.3.3, as MacOSXVI isn't even on the horizon yet:-). "sysv" works all the way back to, uhm, System 7.0 I think. -- 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 -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2086 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040528/e3ec58a6/smime-0001.bin From jwt at onjapan.net Fri May 28 07:23:25 2004 From: jwt at onjapan.net (Jim Tittsler) Date: Fri May 28 07:23:33 2004 Subject: [Pythonmac-SIG] how to determine Mac OS X version In-Reply-To: References: Message-ID: <6F67D5E2-B099-11D8-8E86-0003936A9B5C@onjapan.net> On May 28, 2004, at 18:03, Jack Jansen wrote: > On 28-mei-04, at 8:32, brad.allen@omsdal.com wrote: >> >> I tried platform.mac_ver(), but this seems to be broken. Google turns >> up various bug reports on this function. > > I don't fully remember whether something was changed for Python 2.3, > but mac_ver() works nicely for me (MacPython 2.3, MacOSX 10.3). What > exactly is the problem you're having? Using Apple's Python 2.3 on 10.3.4, mac_ver() fails for me: >>> import platform >>> print platform.mac_ver() Traceback (most recent call last): File "", line 1, in ? File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/platform.py", line 563, in mac_ver sysv,sysu,sysa = _mac_ver_lookup(('sysv','sysu','sysa')) File "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ python2.3/platform.py", line 532, in _mac_ver_lookup append(gestalt(selector)) MacOS.Error: (-5551, 'undefined selector was passed to Gestalt') My machine doesn't like to do gestalt.gestalt('sysu') (and raises the wrong exception for platform.py's _mac_ver_lookup()?). -- Jim Tittsler http://www.OnJapan.net/ GPG: 0x01159DB6 Python Starship http://Starship.Python.net/ Ringo MUG Tokyo http://www.ringo.net/rss.html From jn_list at rebisoft.com Fri May 28 07:57:52 2004 From: jn_list at rebisoft.com (Jack Nutting) Date: Fri May 28 07:56:50 2004 Subject: [Pythonmac-SIG] passing along cmd-key presses Message-ID: <3F63E695-B09E-11D8-976A-000393A6CDA6@rebisoft.com> I'm working on a game using pygame. Thanks to some sample code from Bob, I've managed to connect a proper .nib file. However, my code seems to grab all keystrokes, so that for example cmd-Q doesn't quit the application, but gets picked up as a "q" press by my code. Do I need to somehow check for the status of the cmd keys, so that I can somehow pass along cmd-key presses to the Cocoa event loop? //jack From gandreas at delver.com Fri May 28 10:11:44 2004 From: gandreas at delver.com (Glenn Andreas) Date: Fri May 28 10:13:23 2004 Subject: [Pythonmac-SIG] How to debug? In-Reply-To: <5CC8FB40-AFFB-11D8-A002-000A95B2409A@bigfoot.com> References: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> <2mhdu22m8o.fsf@starship.python.net> <5CC8FB40-AFFB-11D8-A002-000A95B2409A@bigfoot.com> Message-ID: >Le 27 mai 2004, ? 06:33, Michael Hudson a ?crit : > >>What kind of app are you debugging? That impacts the answer quite a >>lot... >> > >I usually program small app. I use Python as a >multipurpose language. For me, it is a >replacement of the good old BASIC. I'm using it >to apply some of the concept that I am learning >at school. > >I am expecting a debugger. I want to be able to >run my code line by line and I want to be able >to see the value of my variables as they change. > >Last monday, I was sick. So I made a little >Python app to solve "mots cach?s" to spare time. >I don't know how you are calling this in English >"hidden words"? PyOXIDE will do this (http://projects.gandreas.com/pyoxide). Just make sure that you've got PyObjC module installed (using PackMan, for example - the next version will be smart enough to detect this case) -- Glenn Andreas gandreas@gandreas.com mondo blobbo, Cythera, Theldrow, oh my! Mad, Bad, and Dangerous to Know From brad.allen at omsdal.com Fri May 28 10:21:19 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Fri May 28 10:22:59 2004 Subject: [Pythonmac-SIG] how to determine Mac OS X version In-Reply-To: <0A5BA230-B073-11D8-8BDE-003065BA8704@pacbell.net> Message-ID: I didn't know about that command. Thanks very much! It works great under Panther. When I get to work, I'll test on a Jaguar system. Dan Wolfe wrote on 05/28/2004 01:48:34 AM: > try the /usr/bin/sw_vers tool > > lobo% sw_vers > ProductName: Mac OS X > ProductVersion: 10.3.4 > BuildVersion: 7H63 > > - Dan > > On May 27, 2004, at 11:32 PM, brad.allen@omsdal.com wrote: > > > > > I tried platform.mac_ver(), but this seems to be broken. Google turns > > up various bug reports on this function. > > > > I can use the shell command system_profiler on 10.3 but it's too slow > > on 10.2. We still have lots of machines running 10.2, and it will be > > several months before they can all be upgraded. > > > > sysctl doesn't have a variable for this, only for the Darwin version. > > > > Does anybody know a way to do this using Python or calling an outside > > shell command? I'd like something that will work for both 10.2 and > > 10.3 without having to install additional Python modules. > > > > Thanks!_______________________________________________ > > Pythonmac-SIG maillist - Pythonmac-SIG@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/20040528/a3b6f0ba/attachment.html From bob at redivi.com Fri May 28 11:30:00 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri May 28 11:30:10 2004 Subject: [Pythonmac-SIG] passing along cmd-key presses In-Reply-To: <3F63E695-B09E-11D8-976A-000393A6CDA6@rebisoft.com> References: <3F63E695-B09E-11D8-976A-000393A6CDA6@rebisoft.com> Message-ID: On May 28, 2004, at 7:57 AM, Jack Nutting wrote: > I'm working on a game using pygame. Thanks to some sample code from > Bob, I've managed to connect a proper .nib file. However, my code > seems to grab all keystrokes, so that for example cmd-Q doesn't quit > the application, but gets picked up as a "q" press by my code. Do I > need to somehow check for the status of the cmd keys, so that I can > somehow pass along cmd-key presses to the Cocoa event loop? You need to catch it yourself and handle it. SDL captures all keypresses. When you do see a cmd-q you can do NSApp().terminate_(None) (you need to import that from AppKit), which should quit. -bob From brad.allen at omsdal.com Fri May 28 11:46:16 2004 From: brad.allen at omsdal.com (brad.allen@omsdal.com) Date: Fri May 28 11:48:07 2004 Subject: [Pythonmac-SIG] how to determine Mac OS X version In-Reply-To: Message-ID: /usr/bin/sw_vers does indeed work on both Jaguar and Panther. This is very helpful. Thanks again! pythonmac-sig-bounces@python.org wrote on 05/28/2004 09:21:19 AM: > > I didn't know about that command. Thanks very much! It works great > under Panther. When I get to work, I'll test on a Jaguar system. > > Dan Wolfe wrote on 05/28/2004 01:48:34 AM: > > > try the /usr/bin/sw_vers tool > > > > lobo% sw_vers > > ProductName: Mac OS X > > ProductVersion: 10.3.4 > > BuildVersion: 7H63 > > > > - Dan > > > > On May 27, 2004, at 11:32 PM, brad.allen@omsdal.com wrote: > > > > > > > > I tried platform.mac_ver(), but this seems to be broken. Google turns > > > up various bug reports on this function. > > > > > > I can use the shell command system_profiler on 10.3 but it's too slow > > > on 10.2. We still have lots of machines running 10.2, and it will be > > > several months before they can all be upgraded. > > > > > > sysctl doesn't have a variable for this, only for the Darwin version. > > > > > > Does anybody know a way to do this using Python or calling an outside > > > shell command? I'd like something that will work for both 10.2 and > > > 10.3 without having to install additional Python modules. > > > > > > Thanks!_______________________________________________ > > > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > > > http://mail.python.org/mailman/listinfo/pythonmac-sig > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/pythonmac-sig/attachments/20040528/bf5e625e/attachment.html From p.thibault at bigfoot.com Fri May 28 13:14:29 2004 From: p.thibault at bigfoot.com (Pierre Thibault) Date: Fri May 28 13:14:40 2004 Subject: [Pythonmac-SIG] How to debug? In-Reply-To: References: <53A1D882-AF71-11D8-B46E-000A95B2409A@bigfoot.com> <2mhdu22m8o.fsf@starship.python.net> <5CC8FB40-AFFB-11D8-A002-000A95B2409A@bigfoot.com> Message-ID: <7A88C0C8-B0CA-11D8-A002-000A95B2409A@bigfoot.com> This is really cool! I was able to debug my app. :-)) But I've notice that I was not able to see the effect of the last statement of my methods. The debugger is stepping too fast out of the methods. I hope you can improve this. PyOxide is great idea. Le 28 mai 2004, ? 10:11, Glenn Andreas a ?crit : > PyOXIDE will do this (http://projects.gandreas.com/pyoxide). > > Just make sure that you've got PyObjC module installed (using PackMan, > for example - the next version will be smart enough to detect this > case) > Regards. --------------------- Pierre From ronaldoussoren at mac.com Fri May 28 13:37:19 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Fri May 28 13:37:37 2004 Subject: [Pythonmac-SIG] how to determine Mac OS X version In-Reply-To: <6F67D5E2-B099-11D8-8E86-0003936A9B5C@onjapan.net> References: <6F67D5E2-B099-11D8-8E86-0003936A9B5C@onjapan.net> Message-ID: On 28-mei-04, at 13:23, Jim Tittsler wrote: > On May 28, 2004, at 18:03, Jack Jansen wrote: >> On 28-mei-04, at 8:32, brad.allen@omsdal.com wrote: >>> >>> I tried platform.mac_ver(), but this seems to be broken. Google >>> turns up various bug reports on this function. >> >> I don't fully remember whether something was changed for Python 2.3, >> but mac_ver() works nicely for me (MacPython 2.3, MacOSX 10.3). What >> exactly is the problem you're having? > > Using Apple's Python 2.3 on 10.3.4, mac_ver() fails for me: > > >>> import platform > >>> print platform.mac_ver() > Traceback (most recent call last): > File "", line 1, in ? > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/platform.py", line 563, in mac_ver > sysv,sysu,sysa = _mac_ver_lookup(('sysv','sysu','sysa')) > File > "/System/Library/Frameworks/Python.framework/Versions/2.3/lib/ > python2.3/platform.py", line 532, in _mac_ver_lookup > append(gestalt(selector)) > MacOS.Error: (-5551, 'undefined selector was passed to Gestalt') > > My machine doesn't like to do gestalt.gestalt('sysu') (and raises the > wrong exception for platform.py's _mac_ver_lookup()?). I'm seeing the same thing on 10.3.3 and 10.3.4. In both cases 'sysu' is the culprit. This is a known problem: http://www.python.org/sf/780461 and seems to be fixed in recent versions of python. Ronald -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From p.thibault at bigfoot.com Fri May 28 14:48:18 2004 From: p.thibault at bigfoot.com (Pierre Thibault) Date: Fri May 28 14:48:23 2004 Subject: [Pythonmac-SIG] How to debug? In-Reply-To: <8BC6EDB6-AFF8-11D8-9630-000A956FDAC0@fonnesbeck.org> References: <8BC6EDB6-AFF8-11D8-9630-000A956FDAC0@fonnesbeck.org> Message-ID: <95955188-B0D7-11D8-A002-000A95B2409A@bigfoot.com> I made a try and it is working very well. At first I thought that it will use Jython but it is really using the native version. This is really cool! Thank you! Le 27 mai 2004, ? 12:11, Christopher Fonnesbeck a ?crit : > By *far* the best python debugger I have seen is the JPyDebug plugin > for jEdit. Download jEdit, then install the JPyDebug plugin using the > plugin manager. I have had no problems with it so far, and it is very > easy to use (I recommend docking it at the bottom of the editor, but > it can float as well). From p.thibault at bigfoot.com Fri May 28 15:41:53 2004 From: p.thibault at bigfoot.com (Pierre Thibault) Date: Fri May 28 15:42:09 2004 Subject: [Pythonmac-SIG] Scintilla? Message-ID: <121EB380-B0DF-11D8-A002-000A95B2409A@bigfoot.com> Is there people using Scintilla to code in Python on OS X? http://www.scintilla.org/ Scintilla is code editor with code completion for Python. It seems to be a great editor but I was unable to make a install on my machine. I would like to know if there is other people that have interest in Scintilla for OS X? Regards. --------------------- Pierre From fonnesbeck at mac.com Thu May 27 12:11:03 2004 From: fonnesbeck at mac.com (Christopher Fonnesbeck) Date: Fri May 28 16:36:53 2004 Subject: [Pythonmac-SIG] How to debug? Message-ID: <73E4F83E-AFF8-11D8-9630-000A956FDAC0@mac.com> By *far* the best python debugger I have seen is the JPyDebug plugin for jEdit. Download jEdit, then install the JPyDebug plugin using the plugin manager. I have had no problems with it so far, and it is very easy to use (I recommend docking it at the bottom of the editor, but it can float as well). Chris -- Christopher J. Fonnesbeck ( c h r i s @ f o n n e s b e c k . o r g ) Georgia Cooperative Fish & Wildlife Research Unit, University of Georgia "The primary objective of copyright is not to reward the labor of authors, but [t]o promote the Progress of Science and useful Arts. To this end, copyright assures authors the right to their original expression, but encourages others to build freely upon the ideas and information conveyed by a work. This result is neither unfair nor unfortunate. It is the means by which copyright advances the progress of science and art." -- US Supreme Court Justice Sandra Day O'Connor From israel at uandmedance.com Fri May 28 14:41:29 2004 From: israel at uandmedance.com (israel@uandmedance.com) Date: Fri May 28 16:36:56 2004 Subject: [Pythonmac-SIG] round() not consistent? In-Reply-To: Message-ID: hello everyone.. I've been playing around with generating some random numbers with random.random and then rounding them off to two decimal points with round() but for some reason this doesn't always work. here is a sample session ''' >>> round(random.random(),2) 0.65000000000000002 >>> round(random.random(),2) 0.57999999999999996 >>> round(random.random(),2) 0.5 >>> round(random.random(),2) 0.63 >>> round(random.random(),2) 0.95999999999999996 >>> round(random.random(),2) 0.42999999999999999 >>> round(random.random(),2) 0.10000000000000001 >>> round(random.random(),2) 0.54000000000000004 >>> round(random.random(),2) 0.81999999999999995 >>> round(random.random(),2) 0.87 >>> round(random.random(),2) 0.56999999999999995 ''' Am I just not understanding how things work here? ~Israel~ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 883 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040528/f3e29208/attachment.bin From bob at redivi.com Fri May 28 16:47:56 2004 From: bob at redivi.com (Bob Ippolito) Date: Fri May 28 16:49:21 2004 Subject: [Pythonmac-SIG] round() not consistent? In-Reply-To: References: Message-ID: <4C1DE4F2-B0E8-11D8-B211-000A95686CD8@redivi.com> On May 28, 2004, at 2:41 PM, israel@uandmedance.com wrote: > > hello everyone.. > > I've been playing around with generating some random numbers with > random.random and then rounding them off to two decimal points with > round() but for some reason this doesn't always work. > > here is a sample session > ''' --- > >>> round(random.random(),2) > 0.57999999999999996 --- > Am I just not understanding how things work here? You are not understanding how things work here. Floating point numbers can not exactly represent all decimal numbers. What you are looking at is the __repr__ of the floating point return values, which shows the precise value of what the float actually contains so that it can be used to reconstruct the exact value. The __str__ of those values would be what you expect to see as a 'human'. Try str(0.57999999999999996), and you will see '0.58'. Google for "ieee 754", and you will find all the information you ever wanted to know about floating point numbers (as implemented by typical computers and compilers). To be more specific, Python's float corresponds to C's double, which is 64bits wide on almost all platforms. -bob From calvin at xmission.com Fri May 28 17:57:42 2004 From: calvin at xmission.com (Calvin) Date: Fri May 28 17:57:49 2004 Subject: [Pythonmac-SIG] round() not consistent? In-Reply-To: from "israel@uandmedance.com" at May 28, 2004 11:41:29 AM Message-ID: when you actually keep the returned value, or do something with it, it really is two decimals long. It has to do with how floating point numbers are calculated. read this for more instructions: http://docs.python.org/tut/node15.html try printing them, and you'll see they always come out correctly. -calvin >>> print round(random.random(),2) 0.44 >>> print round(random.random(),2) 0.95 >>> print round(random.random(),2) 0.67 >>> print round(random.random(),2) 0.35 >>> print round(random.random(),2) 0.55 >>> print round(random.random(),2) 0.83 >>> print round(random.random(),2) 0.85 >>> print round(random.random(),2) 0.88 > hello everyone.. > > I've been playing around with generating some random numbers with > random.random and then rounding them off to two decimal points with > round() but for some reason this doesn't always work. > > here is a sample session > ''' > >>> round(random.random(),2) > 0.65000000000000002 > > >>> round(random.random(),2) > 0.57999999999999996 > > >>> round(random.random(),2) > 0.5 > > >>> round(random.random(),2) > 0.63 > > >>> round(random.random(),2) > 0.95999999999999996 > > >>> round(random.random(),2) > 0.42999999999999999 > > >>> round(random.random(),2) > 0.10000000000000001 > > >>> round(random.random(),2) > 0.54000000000000004 > > >>> round(random.random(),2) > 0.81999999999999995 > > >>> round(random.random(),2) > 0.87 > > >>> round(random.random(),2) > 0.56999999999999995 > ''' > > Am I just not understanding how things work here? > > > ~Israel~ > --Apple-Mail-12-88307031 > Content-Transfer-Encoding: 7bit > Content-Type: text/enriched; > charset=US-ASCII > > > > hello everyone.. > > > I've been playing around with generating some random numbers with > random.random and then rounding them off to two decimal points with > round() but for some reason this doesn't always work.Helvetica > > > here is a sample session > > ''' > > >>> round(random.random(),2) > > 0.65000000000000002 > > > >>> round(random.random(),2) > > 0.57999999999999996 > > > >>> round(random.random(),2) > > 0.5 > > > >>> round(random.random(),2) > > 0.63 > > > >>> round(random.random(),2) > > 0.95999999999999996 > > > >>> round(random.random(),2) > > 0.42999999999999999 > > > >>> round(random.random(),2) > > 0.10000000000000001 > > > >>> round(random.random(),2) > > 0.54000000000000004 > > > >>> round(random.random(),2) > > 0.81999999999999995 > > > >>> round(random.random(),2) > > 0.87 > > > >>> round(random.random(),2) > > 0.56999999999999995 > > ''' > > > Am I just not understanding how things work here? > > > > ~Israel~ > --Apple-Mail-12-88307031-- > > > > --===============1775404856== > Content-Type: text/plain; charset="us-ascii" > MIME-Version: 1.0 > Content-Transfer-Encoding: 7bit > Content-Disposition: inline > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > --===============1775404856==-- > > > From israel at uandmedance.com Fri May 28 18:05:37 2004 From: israel at uandmedance.com (israel@uandmedance.com) Date: Fri May 28 18:04:53 2004 Subject: [Pythonmac-SIG] round() not consistent? In-Reply-To: <4C1DE4F2-B0E8-11D8-B211-000A95686CD8@redivi.com> Message-ID: <26476BD2-B0F3-11D8-BE07-000393A47FF2@uandmedance.com> Thanks Bob and Calvin I would have though round() would cut off those extra digits, but I'll go and do my freshly assigned homework and educate myself. :) Thanks again, ~Israel~ On Friday, May 28, 2004, at 01:47 PM, Bob Ippolito wrote: > > On May 28, 2004, at 2:41 PM, israel@uandmedance.com wrote: > >> >> hello everyone.. >> >> I've been playing around with generating some random numbers with >> random.random and then rounding them off to two decimal points with >> round() but for some reason this doesn't always work. >> >> here is a sample session >> ''' > --- >> >>> round(random.random(),2) >> 0.57999999999999996 > --- >> Am I just not understanding how things work here? > > You are not understanding how things work here. Floating point > numbers can not exactly represent all decimal numbers. What you are > looking at is the __repr__ of the floating point return values, which > shows the precise value of what the float actually contains so that it > can be used to reconstruct the exact value. > > The __str__ of those values would be what you expect to see as a > 'human'. Try str(0.57999999999999996), and you will see '0.58'. > > Google for "ieee 754", and you will find all the information you ever > wanted to know about floating point numbers (as implemented by typical > computers and compilers). To be more specific, Python's float > corresponds to C's double, which is 64bits wide on almost all > platforms. > > -bob > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > ~Israel~ -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: text/enriched Size: 1705 bytes Desc: not available Url : http://mail.python.org/pipermail/pythonmac-sig/attachments/20040528/047cb85e/attachment.bin From dan at cgl.ucsf.edu Fri May 28 19:47:44 2004 From: dan at cgl.ucsf.edu (Daniel Greenblatt) Date: Fri May 28 19:47:53 2004 Subject: [Pythonmac-SIG] argvemulator.ArgvCollector In-Reply-To: <200405280907.i4S97wNM251415@cgl.ucsf.edu> References: <200405280907.i4S97wNM251415@cgl.ucsf.edu> Message-ID: I am using the argvemulator.ArgvCollector code to enable my application (using Python 2.3.2) to respond to Apple Events (works great!!). While the code in plat-mac/argvemulator.py will just collect all the events at program startup and tack them on to sys.argv , I've modified the code to call the 'dooneevent' function every so often while my program is running, to see if there are any new events on the AppleEvent queue (such as an 'odoc' or 'quit') . This all works wonderfully, except when it comes time to close the application. I consistently get a 'The application python2.3 has unexpectedly quit' error message (the report it generates is at the end of this message) . I've done some investigating, and it seems that this only happens if a call is made to Evt.WaitNextEvent (as happens from 'dooneevent'). My application uses Tkinter for the GUI. Are there any known problems involving the two (Tk and AppleEvent) event loops clashing ? Is there any cleanup function I'm forgetting to call? Any suggestions? Thanks, Dan > ------- > Crash log when quiting Chimera X11 1.1951 on Mac > > Host Name: mach.cgl.ucsf.edu > Date/Time: 2004-05-27 16:49:09 -0700 > OS Version: 10.3.4 (Build 7H63) > Report Version: 2 > > Command: python2.3 > Path: /Users/goddard/Desktop/Chimera 1951.app/Contents/Resources/bin/python2.3 > Version: 1.1951 (1.1951) > PID: 528 > Thread: 0 > > Exception: EXC_BAD_ACCESS (0x0001) > Codes: KERN_INVALID_ADDRESS (0x0001) at 0x02d25be4 > > Thread 0 Crashed: > 0 GLEngine 0x02a0be10 0x29fe000 + 0xde10 > 1 _chimera.dylib 0x021b0bf0 0x2008000 + 0x1a8bf0 > 2 _chimera.dylib 0x021b0cf0 0x2008000 + 0x1a8cf0 > 3 _chimera.dylib 0x021f1228 0x2008000 + 0x1e9228 > 4 _chimera.dylib 0x021f12f8 0x2008000 + 0x1e92f8 > 5 dyld 0x8fe17fc4 _dyld_mod_term_funcs + 0x274 > 6 libSystem.B.dylib 0x9002c7b8 exit + 0x58 > 7 python2.3 0x0000cac8 initsigs + 0 (pythonrun.c:1553) > 8 python2.3 0x0000df3c handle_system_exit + 0x150 (pythonrun.c:1017) > 9 python2.3 0x0000bbe4 PyErr_PrintEx + 0x40 (pythonrun.c:1029) > 10 python2.3 0x0000bb44 PyRun_SimpleFileExFlags + 0x268 > (pythonrun.c:841) > 11 python2.3 0x00006098 Py_Main + 0x8d0 (main.c:415) > 12 python2.3 0x00001aec _start + 0x17c (crt.c:267) > 13 python2.3 0x0000196c start + 0x30 > > ---------------------------- Daniel Greenblatt UCSF Computer Graphics Lab dan@cgl.ucsf.edu From ronaldoussoren at mac.com Sat May 29 01:40:21 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Sat May 29 01:40:30 2004 Subject: [Pythonmac-SIG] round() not consistent? In-Reply-To: References: Message-ID: On 28-mei-04, at 23:57, Calvin wrote: > when you actually keep the returned value, or do something with it, it > really is two decimals long. It really isn't two decimals long, go read the tutorial :-) :-) > It has to do with how floating point numbers > are calculated. read this for more instructions: > http://docs.python.org/tut/node15.html To pick some nit, it has to do with how numbers are *represented* not how they are calculated. > > try printing them, and you'll see they always come out correctly. > > -calvin > >>>> print round(random.random(),2) > 0.44 >>>> print round(random.random(),2) > 0.95 >>>> print round(random.random(),2) > 0.67 >>>> print round(random.random(),2) > 0.35 >>>> print round(random.random(),2) > 0.55 >>>> print round(random.random(),2) > 0.83 >>>> print round(random.random(),2) > 0.85 >>>> print round(random.random(),2) > 0.88 > > >> hello everyone.. >> >> I've been playing around with generating some random numbers with >> random.random and then rounding them off to two decimal points with >> round() but for some reason this doesn't always work. >> >> here is a sample session >> ''' >>>>> round(random.random(),2) >> 0.65000000000000002 >> >>>>> round(random.random(),2) >> 0.57999999999999996 >> >>>>> round(random.random(),2) >> 0.5 >> >>>>> round(random.random(),2) >> 0.63 >> >>>>> round(random.random(),2) >> 0.95999999999999996 >> >>>>> round(random.random(),2) >> 0.42999999999999999 >> >>>>> round(random.random(),2) >> 0.10000000000000001 >> >>>>> round(random.random(),2) >> 0.54000000000000004 >> >>>>> round(random.random(),2) >> 0.81999999999999995 >> >>>>> round(random.random(),2) >> 0.87 >> >>>>> round(random.random(),2) >> 0.56999999999999995 >> ''' >> >> Am I just not understanding how things work here? >> >> >> ~Israel~ >> --Apple-Mail-12-88307031 >> Content-Transfer-Encoding: 7bit >> Content-Type: text/enriched; >> charset=US-ASCII >> >> >> >> hello everyone.. >> >> >> I've been playing around with generating some random numbers with >> random.random and then rounding them off to two decimal points with >> round() but for some reason this doesn't always >> work.Helvetica >> >> >> here is a sample session >> >> ''' >> >>>>> round(random.random(),2) >> >> 0.65000000000000002 >> >> >>>>> round(random.random(),2) >> >> 0.57999999999999996 >> >> >>>>> round(random.random(),2) >> >> 0.5 >> >> >>>>> round(random.random(),2) >> >> 0.63 >> >> >>>>> round(random.random(),2) >> >> 0.95999999999999996 >> >> >>>>> round(random.random(),2) >> >> 0.42999999999999999 >> >> >>>>> round(random.random(),2) >> >> 0.10000000000000001 >> >> >>>>> round(random.random(),2) >> >> 0.54000000000000004 >> >> >>>>> round(random.random(),2) >> >> 0.81999999999999995 >> >> >>>>> round(random.random(),2) >> >> 0.87 >> >> >>>>> round(random.random(),2) >> >> 0.56999999999999995 >> >> ''' >> >> >> Am I just not understanding how things work here? >> >> >> >> ~Israel~ >> --Apple-Mail-12-88307031-- >> >> >> >> --===============1775404856== >> Content-Type: text/plain; charset="us-ascii" >> MIME-Version: 1.0 >> Content-Transfer-Encoding: 7bit >> Content-Disposition: inline >> >> _______________________________________________ >> Pythonmac-SIG maillist - Pythonmac-SIG@python.org >> http://mail.python.org/mailman/listinfo/pythonmac-sig >> >> --===============1775404856==-- >> >> >> > > > _______________________________________________ > Pythonmac-SIG maillist - Pythonmac-SIG@python.org > http://mail.python.org/mailman/listinfo/pythonmac-sig > > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173 From kenneth.m.mcdonald at sbcglobal.net Sat May 29 05:18:21 2004 From: kenneth.m.mcdonald at sbcglobal.net (Kenneth McDonald) Date: Sat May 29 05:18:26 2004 Subject: [Pythonmac-SIG] Questions on doing some OS X-specific stuff: Adding file/folder icons from Python? Message-ID: <20FD9508-B151-11D8-952A-000A956870AC@sbcglobal.net> As a 'fun' project to start learning about calling OS X functionality from Python, I thought it'd be neat to write a little app that would go through my photo album (just a whole bunch of dirs with related pictures in each, not an iPhoto album) and 1) Add a permanent thumbnail to each image. 2) Put a custom folder icon on each folder, consisting of a thumbnail of the first image in the folder. (Digital cameras are great, but man, I'm sorta astounded at the number of pictures I've taken...) I can use PIL (I assume) to do the image-related stuff, but what's the best way to attack the assigning-icons-to-files/folders stuff? PyObjC? I seem to remember reading that Python can communicate with Applescript, would that be a better route? At the moment, I know nothing about accessing OS X from Python, so I'm really just looking for a good way to start learning. All I want to do with this first thing is to learn how to make a few OS X calls. Thanks, Ken McDonald From david at ittpoi.com Sat May 29 05:57:40 2004 From: david at ittpoi.com (David Remahl) Date: Sat May 29 05:58:01 2004 Subject: [Pythonmac-SIG] Questions on doing some OS X-specific stuff: Adding file/folder icons from Python? In-Reply-To: <20FD9508-B151-11D8-952A-000A956870AC@sbcglobal.net> References: <20FD9508-B151-11D8-952A-000A956870AC@sbcglobal.net> Message-ID: <9F0DE08E-B156-11D8-814B-000393DC5D80@ittpoi.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 29 maj 2004, at 11.18, Kenneth McDonald wrote: > As a 'fun' project to start learning about calling OS X functionality > from Python, I thought it'd be neat to write a little app that would > go through my photo album (just a whole bunch of dirs with > related pictures in each, not an iPhoto album) and > > 1) Add a permanent thumbnail to each image. > 2) Put a custom folder icon on each folder, consisting > of a thumbnail of the first image in the folder. (Digital > cameras are great, but man, I'm sorta astounded at > the number of pictures I've taken...) > > I can use PIL (I assume) to do the image-related stuff, but > what's the best way to attack the assigning-icons-to-files/folders > stuff? PyObjC? I seem to remember reading that Python can > communicate with Applescript, would that be a better route? > At the moment, I know nothing about accessing OS X from > Python, so I'm really just looking for a good way to start > learning. All I want to do with this first thing is to learn how to > make a few OS X calls. May I suggest using PyObjC , with the IconFamily class by Troy Stephens et.al. (including me)? Using Cocoa with Python makes your task very simple. You can probably leave PIL out too, and use Cocoa's image processing functionality. / Regards, David Remahl - --- PGP key information--- pub 1024D/ 87256085 2003/06/12 David Remahl Web: http://ittpoi.com/david_remahl.asc Fingerprint: 0C38 293C 86A9 7756 9CEA 4ED6 1651 620E 8725 6085 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFAuF6WFlFiDoclYIURAogkAJ4sEaIzay9KuG14ydxdES9tVBYarQCdETXw 9tDDighhkhJRB7+rPMMdZXU= =zDa0 -----END PGP SIGNATURE----- From david at ittpoi.com Sat May 29 06:21:53 2004 From: david at ittpoi.com (David Remahl) Date: Sat May 29 06:22:10 2004 Subject: [Pythonmac-SIG] Questions on doing some OS X-specific stuff: Adding file/folder icons from Python? In-Reply-To: <9F0DE08E-B156-11D8-814B-000393DC5D80@ittpoi.com> References: <20FD9508-B151-11D8-952A-000A956870AC@sbcglobal.net> <9F0DE08E-B156-11D8-814B-000393DC5D80@ittpoi.com> Message-ID: <017A0D6E-B15A-11D8-814B-000393DC5D80@ittpoi.com> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 29 maj 2004, at 11.57, David Remahl wrote: > May I suggest using PyObjC , with the > IconFamily class by Troy Stephens et.al. (including me)? Oops, I forgo to include the URL: / David - --- PGP key information--- pub 1024D/ 87256085 2003/06/12 David Remahl Web: http://ittpoi.com/david_remahl.asc Fingerprint: 0C38 293C 86A9 7756 9CEA 4ED6 1651 620E 8725 6085 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.3 (Darwin) iD8DBQFAuGRDFlFiDoclYIURAvUuAJ4trjj1X4eHDmhE/UH3ucT7dRUh9gCfR6Fd 4TA8fC/8XTy36WKQCSnKXlw= =25Gr -----END PGP SIGNATURE----- From ronaldoussoren at mac.com Mon May 31 04:58:29 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon May 31 04:59:04 2004 Subject: [Pythonmac-SIG] ANN: PyObjC 1.1 Message-ID: PyObjC 1.1 is now available for download at http://pyobjc.sourceforge.net/ PyObjC is a bridge between Python and Objective-C. It allows full featured Cocoa applications to be written in pure Python. It is also easy to use other frameworks containing Objective-C class libraries from Python and to mix in Objective-C, C and C++ source. Python is a highly dynamic programming language with a shallow learning curve. It combines remarkable power with very clear syntax. The installer package includes a number of Xcode and Project Builder templates for easily creating new Cocoa-Python projects, as well as support for syntax-coloring Python files. PyObjC also supports full introspection of Objective-C classes and direct invocation of Objective-C APIs from the interactive interpreter. PyObjC requires MacOS X 10.2 or later. PyObjC works both with the Apple provided Python installation in MacOS X 10.2 (and later) and with MacPython 2.3. Users of MacPython 2.3 can install PyObjC though the PackageManager application. The major improvement of PyObjC 1.1 is support for Key-Value Observing. It is now possible to write programs that use Cocoa Bindings. There are also numerous new examples. PyObjC is released with an open source license. From artelse at mohr-i.nl Mon May 31 07:55:54 2004 From: artelse at mohr-i.nl (Arthur Elsenaar) Date: Mon May 31 07:56:06 2004 Subject: [Pythonmac-SIG] ANN: PyObjC 1.1 In-Reply-To: References: Message-ID: <78372BC0-B2F9-11D8-B222-000A95C887F8@mohr-i.nl> Ronald Oussoren wrote: > PyObjC 1.1 is now available for download at > http://pyobjc.sourceforge.net/ > PyObjC requires MacOS X 10.2 or later. PyObjC works both with the > Apple > provided Python installation in MacOS X 10.2 (and later) and with > MacPython 2.3. Users of MacPython 2.3 can install PyObjC though the > PackageManager application. using the packman list at http://pyobjc.sf.net/packman/pyobjc-stable-macosx10.3.plist Packman labels pyobjc1.1 as 'old'. After installing, it doesn't change to the regular 'yes'. I didn't test, but assume it's installed correctly. Arthur From ronaldoussoren at mac.com Mon May 31 08:00:44 2004 From: ronaldoussoren at mac.com (Ronald Oussoren) Date: Mon May 31 08:00:54 2004 Subject: [Pythonmac-SIG] ANN: PyObjC 1.1 In-Reply-To: <78372BC0-B2F9-11D8-B222-000A95C887F8@mohr-i.nl> References: <78372BC0-B2F9-11D8-B222-000A95C887F8@mohr-i.nl> Message-ID: <250EDE14-B2FA-11D8-9C27-0003931CFE24@mac.com> On 31-mei-04, at 13:55, Arthur Elsenaar wrote: > > Ronald Oussoren wrote: > >> PyObjC 1.1 is now available for download at >> http://pyobjc.sourceforge.net/ > >> PyObjC requires MacOS X 10.2 or later. PyObjC works both with the >> Apple >> provided Python installation in MacOS X 10.2 (and later) and with >> MacPython 2.3. Users of MacPython 2.3 can install PyObjC though the >> PackageManager application. > > using the packman list at > http://pyobjc.sf.net/packman/pyobjc-stable-macosx10.3.plist > > Packman labels pyobjc1.1 as 'old'. After installing, it doesn't change > to the regular 'yes'. > I didn't test, but assume it's installed correctly. Do you have an older version of PyObjC installed (specifically 1.0 or earlier)? If so, please use the installer on the DMG instead of packman. I'm replacing the packman database later today, upgrading 1.0 to 1.1 doesn't seem to work correctly using binary packman packages :-( Ronald > > Arthur > > -- X|support bv http://www.xsupport.nl/ T: +31 610271479 F: +31 204416173