python Programming Glossary: mylibrary
How do I propagate C++ exceptions to Python in a SWIG wrapper library? http://stackoverflow.com/questions/1394484/how-do-i-propagate-c-exceptions-to-python-in-a-swig-wrapper-library to throw the following exception from your c code module mylibrary.cpp along with a little error message to be caught in your python.. say you have python code such as the following import mylibrary try s mylibrary.do_something 'foobar' except mylibrary.MyException.. python code such as the following import mylibrary try s mylibrary.do_something 'foobar' except mylibrary.MyException e print e..
Making a virtual package available via sys.modules http://stackoverflow.com/questions/368057/making-a-virtual-package-available-via-sys-modules package available via sys.modules Say I have a package mylibrary . I want to make mylibrary.config available for import either.. Say I have a package mylibrary . I want to make mylibrary.config available for import either as a dynamically created.. place that would then basically be mounted inside the mylibrary namespace. I.e. I do import sys types sys.modules 'mylibrary.config'..
|