Python and Windows Scripting Host

Syver Enstad syver.enstad at sensewave.com
Mon Aug 7 17:32:26 EDT 2000


I am totally new to Python and have just tried out the windows version 1.5.2
on Win2000.

I was very pleased to see that it worked with both ASP, IE DHTML and WSH.

I have a .pys file (WSH) here that doesn't do what it should (I have
converted it from VBScript) according to D. Esposito's book Windows Script
Host.

Everything works without any error messages but something seems to be wrong
in the registration of the Event handlers as they are never called.

Are there anybody who have any experience with Python and WSH who could
enlighten me it would be very much appreciated.

//-----------------------------------------------------------------
# WSH testing


Ie = WScript.CreateObject("InternetExplorer.Application", "Browser_")
Ie.Visible = 1;
Ie.Navigate("http://www.wrox.com")

while Ie.Visible:
    pass


def Browser_DownloadBegin():
    WScript.Echo("Download begin")

def Browser_DownloadComplete():
    WScript.Echo("Download complete")

def Browser_DocumentComplete(disp, url):
    WScript.Echo("Document complete at %s" % url)
    doc = Ie.Document
    WScript.Echo(doc.Title)





More information about the Python-list mailing list