[C++-sig] Instance access

Renato Araujo renatox at gmail.com
Mon Nov 24 13:48:44 CET 2008


maybe this tutorial can help.

http://wiki.python.org/moin/boost.python/EmbeddingPython


On Mon, Nov 24, 2008 at 1:50 AM, fileoffset <fileoffset at gmail.com> wrote:
>
> Is it possible to access an object instance from within python?
>
> I am trying to automate a single class that is part of a larger, complex
> framework.  My idea is that I could load an embedded python script on
> construction of the object, which would act on the 'this' or
> 'shared_from_this()' pointer. This would greatly simplify my automation.
>
> I have tried it myself but it doesn't seem to work:
>
> main_namespace["instance"] = this;
>
> Is that ever going to work like I would want/expect? Or is there an
> alternative or work around that I could use?
>
> Please help! Any information is appreciated
>
> --
> file offset <fileoffset at gmail.com>
>
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>



-- 
Renato Araujo Oliveira Filho


More information about the Cplusplus-sig mailing list