Python and Windows Scripting Host

Mark Hammond mhammond at skippinet.com.au
Wed Jun 14 19:43:18 EDT 2000


In article <O_S15.205$3y1.4771 at typhoon1.ba-dsg.net>,
  "Jim Bower" <jbower at lims.com> wrote:
> Here is what I am trying to do:
>

OK - It appears Roger _was_ correct given your question.

You are running a _normal_ Python script, from within Pythonwin.  Roger
is correct - there is no WScript object available, and can be created
using the code he suggested.

Given the subject line, I assumed you were trying to run this code from
_within_ Windows Scripting Host.

To do this, you place that _exact_ same code you posted in a .pys file
(the import isnt necessary, but will still work), and execute:

cscript foo.pys

Then the WScript object is automatically available, and works.

Mark.


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list