Active Scripting in Python

Discussion in 'Python' started by Jane Austine, Sep 4, 2003.

  1. Jane Austine

    Jane Austine Guest

    I donwloaded win32all for Python 2.3 and installed it.

    I manually run pyscript.py and it returned "successfully registered"
    message.

    For a simple test(on client side), I created the following html:

    <script language=Python>
    alert("hello world")
    </script>

    And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
    anything.

    After googling, I tried "pyscript.py --debug" and the trace collector
    shows:

    Object with win32trace dispatcher created (object=None)
    in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
    (IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
    in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
    (IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None

    Am I doing something stupid?

    Jane
     
    Jane Austine, Sep 4, 2003
    #1
    1. Advertising

  2. Jane Austine

    Syver Enstad Guest

    (Jane Austine) writes:

    > I donwloaded win32all for Python 2.3 and installed it.
    >
    > I manually run pyscript.py and it returned "successfully registered"
    > message.
    >
    > For a simple test(on client side), I created the following html:
    >
    > <script language=Python>
    > alert("hello world")
    > </script>
    >
    > And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
    > anything.
    >
    > After googling, I tried "pyscript.py --debug" and the trace collector
    > shows:
    >
    > Object with win32trace dispatcher created (object=None)
    > in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
    > (IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
    > in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
    > (IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None
    >
    > Am I doing something stupid?


    I think Mark Hammond has disabled the scripting extensions by default,
    go to Mark Hammonds site, there should be an explanation on how to
    enable it there...
     
    Syver Enstad, Sep 4, 2003
    #2
    1. Advertising

  3. On Wed, 2003-09-03 at 23:23, Jane Austine wrote:
    > I donwloaded win32all for Python 2.3 and installed it.
    >
    > I manually run pyscript.py and it returned "successfully registered"
    > message.
    >
    > For a simple test(on client side), I created the following html:
    >
    > <script language=Python>
    > alert("hello world")
    > </script>
    >
    > And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
    > anything.


    I can't test this right now because my Windows machine at home is dead
    (long story), but have you tried using:

    print "hello world"

    OR

    document.write("hello world")

    I guess my question is whether "alert" is available when you're using
    language="Python".

    // m
     
    Mark McEahern, Sep 4, 2003
    #3
  4. "Jane Austine" <> wrote in message
    news:...
    > I donwloaded win32all for Python 2.3 and installed it.
    >
    > I manually run pyscript.py and it returned "successfully registered"
    > message.
    >
    > For a simple test(on client side), I created the following html:
    >
    > <script language=Python>
    > alert("hello world")
    > </script>
    >
    > And opened it in IE6.0 on WinXP. Unfortunately, it doesn't show
    > anything.
    >
    > After googling, I tried "pyscript.py --debug" and the trace collector
    > shows:
    >
    > Object with win32trace dispatcher created (object=None)
    > in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
    > (IID('{BB1A2AE2-A4F9-11CF-8F20-00805F2CD064}'),) None None
    > in _InvokeEx_ with GetInterfaceSafetyOptions 0 1
    > (IID('{BB1A2AE1-A4F9-11CF-8F20-00805F2CD064}'),) None None
    >
    > Am I doing something stupid?
    >
    > Jane


    Try pyscript_rexec.py instead, with the line 184(raise) of rexec.py
    commented out.
     
    Changjune Kim, Sep 5, 2003
    #4
  5. Kim ...

    Thanks for the information ...

    Disabling the raise statement in pyscript.py
    and then running pyscript_rexec.py worked OK ...

    /Python/Lib/site-packages/win32comext/axscript/client

    pyscript.py

    def __setattr__(self, attr, value) :
    ...
    # raise AttributeError, attr # line disabled
    ...

    python pyscript_rexec.py # Python Script Registration

    Example ...

    http://fastq.com/~sckitching/Python/win32_activeX_pyscript.htm

    Only tested with .... < win98_SE | IE6 | Python 2.2.1 >

    --
    Cousin Stanley
    Human Being
    Phoenix, Arizona
     
    Cousin Stanley, Sep 5, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ron Stephens
    Replies:
    23
    Views:
    2,856
    Ron Stephens
    Apr 12, 2004
  2. DaveInSidney
    Replies:
    0
    Views:
    423
    DaveInSidney
    May 9, 2005
  3. darrick

    Python Active Scripting

    darrick, Aug 26, 2005, in forum: Python
    Replies:
    1
    Views:
    418
    quhaha
    Oct 12, 2006
  4. carlos seramos
    Replies:
    2
    Views:
    488
    carlos seramos
    Aug 1, 2003
  5. Peña, Botp
    Replies:
    1
    Views:
    119
Loading...

Share This Page