Python and Windows Scripting Host
Jim Bower
jbower at lims.com
Wed Jun 14 07:41:31 EDT 2000
Thanks, Roger. There is a test script
(D:\Python\win32comext\axscript\test\test.pys) which came from the Win32All
distribution. It also fails, and also contains wscript directly as a Python
variable. Did I miss something in the documentation?
Thanks,
"Jim Bower" <jbower at lims.com>
"Roger Upole" <rupole at compaq.net> wrote in message
news:39y15.839$Zh1.63369 at news.easynews.com...
> 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