[Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-05 Thread Zachary Pincus
Hi folks, I have a tricky issue with some python extension modules that need to share symbols between themselves. The setup: I am creating python modules to wrap a large template- based C++ image processing library. The fundamental class that each of these modules needs to be able to create,

Re: [Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-05 Thread Zachary Pincus
>> [need to share symbols across dso boundaries snipped] >> Any help or suggestions or thoughts would be greatly appreciated, > > Don't do that? > > Python uses two-level namespaces on OSX, and for a purpose: to avoid > accidentally picking up a symbol from another extension. IIRC You > should >

Re: [Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-05 Thread Zachary Pincus
Thanks for the information, Bob. I appreciate your help. > Actually it's because Python extensions are bundles. Bundles are > NOT shared libraries and can not do what you want. Additionally, > Python on Mac OS X doesn't use dl to load its extensions, it uses > lower-level means... so the R

Re: [Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-05 Thread Zachary Pincus
Thanks again Bob for the feedback. > MH_BUNDLE is not MH_DYLIB and neither are ELF. Everything you > think you know about shared libraries isn't quite the same on Mac > OS X. I suggest you read up on Mach-O, I don't really have time to > answer all of your questions about it. My admittedl

Re: [Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-06 Thread Zachary Pincus
>> (2) Move to using dlopen() to load the libraries instead of >> NSLinkImage. This might need some minor changes to >> dynload_shlib.c, and it would need the configure script to be >> smart enough to choose dynload_next.c on 10.2 and below. > > If you come up with a patch for (2) against Pyt

[Pythonmac-SIG] dl module on Mac python builds

2006-03-06 Thread Zachary Pincus
Hi folks, Despite the fact that dlopen() is available on OS X for 10.3 and above, the python dl module has not been made available on 10.3 and 10.4. Specifically, some code in the python setup.py script explicitly prevents the dl module from being built on darwin even if python sees dlfcn

Re: [Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-06 Thread Zachary Pincus
Thanks for your feedback, Bob. >> I don't have access to a 10.2 machine currently, so if someone is >> able to test this patch on 10.1, 10.2, and/or 10.3, I would be >> most grateful. I can try to find some 10.2 install disks (and hope >> that my computer can run 10.2) if nobody has easy acc

Re: [Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-06 Thread Zachary Pincus
>> I think the Mac OS X box on the sourceforge compile farm may be 10.2. Only if you're a developer on some SF project. Is there a python project someone can add me to so I can test this (and the dl module) patch? Or should I register some dummy project? Zach

Re: [Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-10 Thread Zachary Pincus
> If you come up with a patch for (2) against Python's svn trunk that > is tested and works on 10.2 then I'll commit it. It's not > appropriate to make this sort of change against Python 2.4, > though. *Maybe* for the universal branch that Ronald and I are > doing, because that's also unl

Re: [Pythonmac-SIG] dlopenflags and sharing symbols across python extension modules

2006-03-11 Thread Zachary Pincus
>> Well, after wasting the better part of a day tracking down a computer >> capable of running 10.2, installing 10.2 on it, getting the latest >> updates and the newest 10.2 developer tools, I find that neither >> python 2.5 from svn (today's snapshot or a checkout from the 8th) >> *NOR* the svn sn

[Pythonmac-SIG] [PATCH]: Python should use dlopen() on 10.3+

2006-03-19 Thread Zachary Pincus
Hello folks, Here is a patch to make Python on OS X 10.3 and above use dlopen() (via dynload_shlib.c) to load extension modules, and to make the dl module avaliable. It ought to be incorporated into the SVN for python 2.5, if not for further development on 2.4. If this is an inappropriate c

Re: [Pythonmac-SIG] [PATCH]: Python should use dlopen() on 10.3+

2006-03-21 Thread Zachary Pincus
t there's no reason it should not be applied to the python codebase. Thanks, Zach Pincus Program in Biomedical Informatics and Department of Biochemistry Stanford University School of Medicine On Mar 20, 2006, at 1:05 AM, Ronald Oussoren wrote: > > On 20-mrt-2006, at 4:13, Zacha

Re: [Pythonmac-SIG] readline: where and how installed?

2006-04-12 Thread Zachary Pincus
This is for Bob Ippolito - What version of readline comes with the Universal MacPython 2.4.3 release? And is it statically-linked, or is there a readline dylib somewhere in the python framework? I ask because Michael Broe reported some problems (see below) with IPython that I had tracked do

Re: [Pythonmac-SIG] readline: where and how installed?

2006-04-12 Thread Zachary Pincus
>> This is for Bob Ippolito - > > Well it's really for Ronald, I didn't build it. I have no idea. Sorry! Hopefully Ronald will let us know what version of readline he used. Now, in regards to the GDB issue: can anyone with the latest developer tools who also has the Universal Python build in

Re: [Pythonmac-SIG] readline: where and how installed?

2006-04-12 Thread Zachary Pincus
>> Now, in regards to the GDB issue: can anyone with the latest >> developer tools who also has the Universal Python build installed try >> to run python under gdb? (I have a different install of python 2.4.3 >> that I don't want to nuke by installing the universal build just to >> test this; other

Re: [Pythonmac-SIG] readline: where and how installed?

2006-04-12 Thread Zachary Pincus
Well, not to keep this thread going on any more than necessary -- though we do still need to hear from Ronald about what version of readline was used for the Universal MacPython -- but I have a comment. > I would think that most gdb users already know how to cross an > execve, but maybe I'm

Re: [Pythonmac-SIG] readline: where and how installed?

2006-04-13 Thread Zachary Pincus
>>> Just for fun, what's the point of the execve? Just to choose the >>> right Python executable? >> >> Never mind, I found it on Bob's blog. It's to get around the >> requirement to have an app bundle if you want to draw on the screen, >> apparently. > > That's right. > > Note that this function

Re: [Pythonmac-SIG] readline: where and how installed?

2006-04-13 Thread Zachary Pincus
>> This is for Bob Ippolito - > > No it isn't, Bob didn't build the 2.4.3 release ;-) Sorry sorry! Thanks for making that build, by the way. > >> >> What version of readline comes with the Universal MacPython 2.4.3 >> release? And is it statically-linked, or is there a readline dylib >> somewhere

Re: [Pythonmac-SIG] readline: where and how installed?

2006-04-13 Thread Zachary Pincus
>> So... I have found that IPython exposes a bug in GNU readline 5.1, >> sadly enough. This bug causes segfaults when the up-arrow key is >> used under certain situations. Ugh. Fortunately, the extant >> readline 5.1 patches solve this issue nicely. Hopefully you'll get >> a chance in the n

Re: [Pythonmac-SIG] readline: where and how installed?

2006-04-13 Thread Zachary Pincus
> You can build the readline extension separately from Python without > much fuss. I have a setup.py for it and the extracted source > sitting in my svn: > http://svn.red-bean.com/bob/readline/trunk/ Thanks! I didn't know it was that easy. Also, thanks everyone for your time while this issue

Re: [Pythonmac-SIG] Why dynload_next.c rather than dynload_shlib.c?

2006-04-27 Thread Zachary Pincus
As of Python 2.5a2, python.org python should use dynload_shlib.c on 10.3 and 10.4. I didn't realize that Apple's python was built differently... Anyhow, if you want to build your own Py2.4 with dynload_shlib the patch is pretty easy. You can search for the patch on sourceforge (it's agains

[Pythonmac-SIG] Distribute command-line tools with py2app or similar?

2008-06-28 Thread Zachary Pincus
Hi all, I've built some scientific command-line tools in Python that I'd like to be able to distribute to colleagues. This is dead-simple on Windows -- I use py2exe to make a console application exe (or several), put it/ them on the PATH, and things are good-to-go. However, from googling,

[Pythonmac-SIG] A few more py2appissues/questions

2008-06-29 Thread Zachary Pincus
Hi all, I've been wrestling with py2app for the last day and am getting pretty confused/discouraged. If anyone has any suggestions regarding the following issues I've run across, I would be extremely grateful! I've tested these with both the SVN version of py2app (and dependencies like mo

Re: [Pythonmac-SIG] A few more py2appissues/questions

2008-06-29 Thread Zachary Pincus
Hi all, A couple of addenda: (1) It appears that modules included via the py2app 'includes' option do not have their full dependencies added. I included a handful of modules from my main package via the setup.py script: setup_kws['options'] = {'py2app':{'includes':['mypackage.util',

Re: [Pythonmac-SIG] Distribute command-line tools with py2app or similar?

2008-06-30 Thread Zachary Pincus
Hi Chris, Thanks for your suggestions and help here! I really appreciate it. I wound up building my own installer packages mush as you suggest below, which turned out to be pretty simple to do -- good idea! I haven't tried this, but can you build python from source, specifying an alternat

Re: [Pythonmac-SIG] real-time video capturing and processing

2009-01-08 Thread Zachary Pincus
Hi Michael, I see some faint traces on Google of something called "PySight" that can grab images from iSight cameras. There may be some Apple-provided frameworks for grabbing iSight images as well, which could be called via PyObjC. Failing that, I'm sure you can find some C-level webcam d

Re: [Pythonmac-SIG] real-time video capturing and processing

2009-01-12 Thread Zachary Pincus
thanks a lot for your help. so far i made first steps using PySight which works fine with my iSight camera. Cool, I'm glad this worked. I'll have to try PySight out. i'm able to aquire images and to process them, using code-snippets from here and there, but i lack an idea of PyObjC and i am

Re: [Pythonmac-SIG] How to use pythonw on Mac OS X

2009-03-15 Thread Zachary Pincus
Hi Samantha, You should probably direct your query to the creators of the software you purchased... they're the most likely to be able to get this working for you as soon as possible: http://www.paperpilots.com/pp_contact.html Zach On Mar 14, 2009, at 2:07 PM, Samantha Bess wrote: To

Re: [Pythonmac-SIG] C Extension Scipy/Numpy

2010-02-25 Thread Zachary Pincus
Hi, Probably better to: (1) Ask this on the numpy mailing list, and (2) Provide a complete, compilable example of the offending code. Also, you may find it easier to write a pure-C routine and call into it using ctypes (getting pointers via numpy arrays' ctypes attributes), or alternately, u

Re: [Pythonmac-SIG] [ C Extension Scipy/Numpy

2010-02-26 Thread Zachary Pincus
I highly recommend that you use Cython instead: It is much easier, and you are much more likely to make mistakes with reference counting, etc, if you do it by hand. Trust me on this. There are a few version I tried, but because of the very high mathematical effort I need the fastest solutio

Re: [Pythonmac-SIG] If/else vs or

2010-10-28 Thread Zachary Pincus
On Oct 28, 2010, at 11:08 AM, Ronald Oussoren wrote: On 28 Oct, 2010, at 16:21, Dan Ross wrote: I don't think this is Mac specific, but I wonder if someone could explain why these two groups of code behave differently: [code] colors = ['red', 'green', 'blue', 'orange', 'fuscia', 'black',

Re: [Pythonmac-SIG] Good way for beginner to get started with Python?

2013-04-07 Thread Zachary Pincus
Consider also Processing (not python, but a learn-to-program environment that feels a little like a modern LOGO), or the not-dissimilar Python-based NodeBox environment. There's a lot less filesystem bother (etc.), and I think that both have built-in IDEs, so both should be more lightweight than