Python and Windows Scripting Host

Roger Upole rupole at compaq.net
Tue Jun 13 17:59:27 EDT 2000


The Wscript object is not referenced directly as a Python variable.
You create it via win32com.client.Dispatch:
    import win32com.client
    wsh=win32com.client.Dispatch('Wscript.Shell')
    wnt =win32com.client.Dispatch('Wscript.Network')
    ...
Then you can use the their functions as
    wsh.somefunction()
    wnt.somefunction()
    ...
>From Pythonwin, if you first run the makepy utility from the tools menu
and select Windows Scripting Host, autocomplete will magically show
you what functions are available.
       HTH
                Roger Upole

"Jim Bower" <jbower at lims.com> wrote in message
news:9Ov15.1411$vM.56343 at typhoon1.ba-dsg.net...
> Just getting started with Python. Downloaded the basic distribution and
the
> Win32All distribution. Python appears to register OK (ran pyscript.py
> separately just to verify).
>
> However, I am getting "NameError: wscript" anywhere the wscript object is
> mentioned. Have I missed something in the install?
>
> Jim Bower jbower at lims.com
>
>
>





More information about the Python-list mailing list