
Hi Viktor, Actually, I'm the one person on the Chimera team that doesn't do programming! I'll share your mail with the chimera-dev@cgl.ucsf.edu list (for programmer/developer issues) - I believe it has a handful of subscribers in addition to the Chimera team members, and this set of people may have some valuable insights. Best, Elaine ----- Elaine C. Meng, Ph.D. meng@cgl.ucsf.edu UCSF Computer Graphics Lab and Babbitt Lab Department of Pharmaceutical Chemistry University of California, San Francisco http://www.cgl.ucsf.edu/home/meng/index.html On Dec 6, 2006, at 9:28 AM, Viktor Hornak wrote:
Dear Elaine,
sorry to write directly to you and not to chimera list but I have a question which is rather off-topic. It concerns developing C extensions in Python, and I don't even mean specifically for chimera (at this time), but in general. I know that you guys (I am not sure who specifically on chimera team does this sort of a "hard core" programming work) develop a lot of extensions (.so libraries) that can be called from Python and thus you must have a lot of experience doing it. I attempted a couple times to write C extensions in Python as described in Python extension guide but always got burned by reference counting, programs crashing at allocating memory or releasing pointers, etc. In other words, there must be a better/easier way to write extensions. All I need is to transfer integer/float variables and arrays to or from Python to my C subroutine, e.g. I just need to wrap my existing C subroutines and pass arrays back and forth between C and Python (I guess Python lists versus C arrays). I was hoping someone on your team could point me to the right direction. I saw people use SWIG (that looked rather complex though and an overkill for what I need), or Pyrex, etc but I wasn't sure which solution was worth picking up in terms of time I have to spend to learn it and future support (so that the project doesn't disappear in a year). I would really appreciate if you could provide any hints or point me to some resources.
Many thanks for your help and sorry for such an unrelated question!!!
Cheers, -Viktor
-- =================================================================== Viktor Hornak Center for Structural Biology Phone: (631)632-1439 SUNY at Stony Brook Fax: (631)632-1555 Stony Brook, NY 11794-5115 E-mail: viktor.hornak@sunysb.edu ===================================================================