Using python as client-side scripting language in IE 6

Discussion in 'Python' started by popov, Dec 16, 2003.

  1. popov

    popov Guest

    I try with no luck to use python in a simple html page:

    <html>
    <body>
    <script language="Python">
    window.alert('test')
    window.document.write('test')
    </script>
    </body>
    </html>

    When opened in IE6 SP1, that does nothing (no error but no message box
    / nothing written in the page).

    I ran win32comext\axscript\client\pyscript.py and pyscript_rexec.py to
    register python as a scripting engine. No errors from those scripts.

    As I understand it and from what I have read in this forum and
    elsewhere, it should work, but it doesn't: what am I doing wrong ?

    Note: I have installed the latest win32all extensions (163) / I'm
    working on a W2K Server box (SP3).
     
    popov, Dec 16, 2003
    #1
    1. Advertising

  2. popov

    John Roth Guest

    "popov" <> wrote in message
    news:...
    > I try with no luck to use python in a simple html page:
    >
    > <html>
    > <body>
    > <script language="Python">
    > window.alert('test')
    > window.document.write('test')
    > </script>
    > </body>
    > </html>
    >
    > When opened in IE6 SP1, that does nothing (no error but no message box
    > / nothing written in the page).
    >
    > I ran win32comext\axscript\client\pyscript.py and pyscript_rexec.py to
    > register python as a scripting engine. No errors from those scripts.
    >
    > As I understand it and from what I have read in this forum and
    > elsewhere, it should work, but it doesn't: what am I doing wrong ?
    >
    > Note: I have installed the latest win32all extensions (163) / I'm
    > working on a W2K Server box (SP3).


    I doubt if it will work for a while. It doesn't work on my system
    either, and a quick check of the pyscript_rexec.py module says
    that it will enable Rexec support. Rexec support was removed from
    base Python in release 2.2.3 and later, so I doubt if this is ever
    going to work until ActiveState (or Mark Hammond) changes the
    base code to use Exec instead of RExec.

    John Roth
     
    John Roth, Dec 16, 2003
    #2
    1. Advertising

  3. popov

    Peter Hansen Guest

    John Roth wrote:
    >
    > "popov" <> wrote:
    > > I ran win32comext\axscript\client\pyscript.py and pyscript_rexec.py to
    > > register python as a scripting engine. No errors from those scripts.
    > >
    > > As I understand it and from what I have read in this forum and
    > > elsewhere, it should work, but it doesn't: what am I doing wrong ?

    >
    > I doubt if it will work for a while. It doesn't work on my system
    > either, and a quick check of the pyscript_rexec.py module says
    > that it will enable Rexec support. Rexec support was removed from
    > base Python in release 2.2.3 and later, so I doubt if this is ever
    > going to work until ActiveState (or Mark Hammond) changes the
    > base code to use Exec instead of RExec.


    I was just trying this myself and had the same lack of results.
    I note however that while pyscript_rexec.py uses the Rexec support
    and might not work for reasons John describes, pyscript.py claims not
    to do that, and seems to be supposed to work. Yet it doesn't....

    Anyone tried this lately with success?

    For the record, I was trying on a vanilla Win98 machine with Py2.3.2.1
    and the latest win32all as well. (The relevant test scripts execute
    okay, showing that the issue is with IE alone, not with the basic
    capability that allows ActiveX script hosting with Python.)

    -Peter
     
    Peter Hansen, Dec 23, 2003
    #3
  4. Hi,

    Yes I have this working. Do this at your own risk:
    Add the following to pyscript.py after the AXNotRExec class definition
    (around line 89):
    AXRExec = AXNotRExec

    Then register with
    python pyscript_rexec.py --debug
    ^^^^^^ (must be the rexec version).
    You may have to unregister any other versions first:
    python pyscript.py --unregister

    Cheers,
    -John

    Peter Hansen <> wrote in message news:<>...
    > John Roth wrote:
    > >
    > > "popov" <> wrote:
    > > > I ran win32comext\axscript\client\pyscript.py and pyscript_rexec.py to
    > > > register python as a scripting engine. No errors from those scripts.
    > > >
    > > > As I understand it and from what I have read in this forum and
    > > > elsewhere, it should work, but it doesn't: what am I doing wrong ?

    > >
    > > I doubt if it will work for a while. It doesn't work on my system
    > > either, and a quick check of the pyscript_rexec.py module says
    > > that it will enable Rexec support. Rexec support was removed from
    > > base Python in release 2.2.3 and later, so I doubt if this is ever
    > > going to work until ActiveState (or Mark Hammond) changes the
    > > base code to use Exec instead of RExec.

    >
    > I was just trying this myself and had the same lack of results.
    > I note however that while pyscript_rexec.py uses the Rexec support
    > and might not work for reasons John describes, pyscript.py claims not
    > to do that, and seems to be supposed to work. Yet it doesn't....
    >
    > Anyone tried this lately with success?
    >
    > For the record, I was trying on a vanilla Win98 machine with Py2.3.2.1
    > and the latest win32all as well. (The relevant test scripts execute
    > okay, showing that the issue is with IE alone, not with the basic
    > capability that allows ActiveX script hosting with Python.)
    >
    > -Peter
     
    John McLaughlin, Jan 23, 2004
    #4
    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,858
    Ron Stephens
    Apr 12, 2004
  2. DaveInSidney
    Replies:
    0
    Views:
    423
    DaveInSidney
    May 9, 2005
  3. Rasmus Kromann-Larsen

    Server-side Scripting Language..

    Rasmus Kromann-Larsen, Aug 9, 2007, in forum: ASP .Net
    Replies:
    0
    Views:
    357
    Rasmus Kromann-Larsen
    Aug 9, 2007
  4. Kathryn
    Replies:
    9
    Views:
    210
    William Morris
    Oct 17, 2003
  5. Andyza
    Replies:
    1
    Views:
    596
    Anthony Jones
    Feb 16, 2007
Loading...

Share This Page