Sorry, please ignore this question - it was a programmer stupidity error on
my part! I was changing the language property after adding the object, which
resets the control and clears the "context"!
But, I do have another question though. If I add code with functions, and
then call Run to execute a specific function, the main code in the Python
module also gets executed before the function. I know I should probably then
not have code outside any of my functions, but is this supposed to happen?
Regards, Frank
----- Original Message -----
From: "Frank Conradie" <[EMAIL PROTECTED]>
To: <>
Sent: Thursday, May 24, 2001 4:01 PM
Subject: Python and MS Script Control
> Hi there
>
> I'm making a Delphi app scriptable via MS Script Control, and it works
fine
> with JScript and partially with Python. The Python ActiveX scripting
engine
> runs fine and executes Python statements, but whenever I put an object in
> the script controls's "context" it does not seem to be accessible from
> inside the Python script.
>
> Example:
> ----------------
> I add an object from Delphi:
>
> msScriptControl.AddObject("wizard", MyObject);
>
> Then I try to use the object from within my Python script:
>
> wizard.Test()
>
> The error I get is:
>
> NameError: name "wizard" is not defined.
>
> This works fine in JScript. Does somebody have an idea what's going on?
>
> Regards, Frank
>
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/activepython
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/activepython