windows script host and python

Paul Moore paul.moore at uk.origin-it.com
Wed Mar 14 11:39:18 EST 2001


On Wed, 14 Mar 2001 14:36:59 +0100, "Mike Carifio"
<carifio.nospam at nospam.usys.com> wrote:

>I'm looking for some resources on using python with wsh generally.
>
>Specifically, I'm trying to use .wsf files with python. For example,
>given a "one liner" in (say) hello.py:
>
>    WScript.Echo("hello")
>
>then wscript //E:python hello.py works. But hello.wsf below doesn't:
>
><?xml version="1.0" ?>
><?job error="true" debug="true" ?>
>
><package id="package1">
>   <job id="job1"> <!-- run by default -->
>     <comment>
>       blah blah
>     </comment>
>     <script language="python">
>     <![CDATA[
>         WScript.Echo("hello")

  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Don't indent this line. Remember whitespace is significant in Python. Put it
at the left margin, and it works fine (at least it does for me!)

Paul.




More information about the Python-list mailing list