Python and Windows Scripting Host

Jim Bower jbower at lims.com
Wed Jun 14 17:42:06 EDT 2000


Here is what I am trying to do:

import win32com

WScript.Echo("Hello")

Here is what is happening:

Traceback (innermost last):
  File "d:\Python\Pythonwin\pywin\framework\scriptutils.py", line 310, in
RunScript
    exec codeObject in __main__.__dict__
  File "C:\WINNT\Profiles\Administrator\Desktop\test.py", line 3, in ?
    WScript.Echo("Hello")
NameError: WScript

Thanks,
Jim Bower jbower at lims.com



"Mark Hammond" <mhammond at skippinet.com.au> wrote in message
news:8i8mbb$c3f$1 at nnrp1.deja.com...
> In article <39y15.839$Zh1.63369 at news.easynews.com>,
>   "Roger Upole" <rupole at compaq.net> wrote:
> > The Wscript object is not referenced directly as a Python variable.
> > You create it via win32com.client.Dispatch:
>
> Im afraid that is not correct.  When Python is running under the
> Windows Scripting Host, the WScript variable is automatic.
>
>
> > "Jim Bower" <jbower at lims.com> wrote in message
> > news:9Ov15.1411$vM.56343 at typhoon1.ba-dsg.net...
> ...
>
> > > However, I am getting "NameError: wscript" anywhere the wscript
>
> Python is a case sensitive language.  You need to use "WScript"
>
> Mark.
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.





More information about the Python-list mailing list