Great !!! That works like charm.
Thanks alot.
Thomas
Leo Kislov wrote:
> Thomas W wrote:
> > Maybe a stupid subject, but this is what I want to do :
> >
> > I got some python code stored in a string:
> >
> > somecode = """
> >
> > from somemodule import ISomeInterface
> >
> > class Foo(ISomeIn
Thomas W wrote:
> Maybe a stupid subject, but this is what I want to do :
>
> I got some python code stored in a string:
>
> somecode = """
>
> from somemodule import ISomeInterface
>
> class Foo(ISomeInterface):
> param1 = ...
> param2 =
>
> """
>
> and I want to compile that code so
Thomas W wrote:
> from somemodule import ISomeInteface
>
> d = compile(sourcecode)
>
> myfoo = d.Foo()
>
> print ISomeInterface in myfoo.__bases__
>
> Any hints?
Python is a dynamic language, so compiling something won't tell you much
about what the code actually does. the only reliable way