Is there a way to pass a python function ptr to a c++ method from a python script?

2006-06-05 Thread liam_herron

I have a core c++ library that is exposed to python through the
boost_python framework.
I would like to write the core of a Newton's method solver in C++ and
be able to write the
functions that are evaluated to be in python.   Does anyone have any
ideas on this?

-- 
http://mail.python.org/mailman/listinfo/python-list


Python COM Outlook Question

2007-03-21 Thread liam_herron

Say I want to open a shared email inbox (named "DailyGoodEmails") that
is different from my default Outlook inbox, how do I specify this?

Currently, I would do:

s = Dispatch("Outlook.Application")
space = s.GetNameSpace("MAPI")
inbox = space.GetDefaultFolder(6)
myFolder = inbox.Folders[9] #open the folder i want


I have no idea where the "6" comes from but I want to be able to
specify "DailyGoodEmails" somewhere
and be able to iterate over the emails.

-- 
http://mail.python.org/mailman/listinfo/python-list


Problem Dynamic Loading Linux C++ .so module using python2.4

2006-04-10 Thread liam_herron
I have compiled my boost-enabled C++ module and have it working when I
explicity set my LD_LIBRARY_PATH before invoking the python2.4
interpreter.  Now I don't want everyone to have to set this environment
variable so I would like to devise a way that the module can load
itself.  My attempt was to create a module folder with the following
__init__.py:

-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
import os
import sys

my_path = os.path.dirname(os.path.abspath(__file__))
mylib_path = os.path.join(my_path, 'subdirOfSitePackages')

if sys.platform == 'win32':
# Windows needs DLLs on the %PATH%.
os.environ['PATH'] = os.environ['PATH'] + ";" + my_path
else:
# LINUX
if os.environ.has_key('LD_LIBRARY_PATH'):
os.environ['LD_LIBRARY_PATH'] = mylib_path + ":" +
os.environ['LD_LIBRARY_PATH']
else:
  os.environ['LD_LIBRARY_PATH'] = mylib_path

from myLibFolder._mylib import *

-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

On my filesystem I have the following folder:

/usr/lib/python2.4/site-packages/myLibFolder

With the following files:
__init__.py
_mylib.so
mylibDBAccess.so
mylibCommon.so
libboost_python.so

Where _mylib.so dynamically links with mylibDBAccess.so,
mylibCommon.so, libboost_python.so.

When I try to import this Folder in python2.4, it actually complains
about the subsequent dynamic linking of the .so files (ie
mylibDBAccess.so).

Any ideas on how to resolve this?

Regards,
Liam

-- 
http://mail.python.org/mailman/listinfo/python-list