You mean something like this?

servers = file('serverfile.txt')

for server in servers.readlines():
  servername = server.rstrip()
  MyWmiFunction(servername)




On Feb 19, 2008 10:32 PM, Becky Mcquilling <[EMAIL PROTECTED]> wrote:

> I'm new to Python and wanted to do what is a pretty routine and common
> admin function,  simple enough in VBScript, but wanted to try it in Python
> as well.  I'm having troulbe working it out on my own.
>
> Here goes:
>
> I have a text file c:\servernames.txt.  I want the script to read from
> that file, each line being a different machine name, then give me a list of
> the services on the machine and the state, write the result to a log file.
>
> The wmi part is easy to produce, on a single machine, it's stripping the
> contents from a text file one at a time and then logging it to a file, that
> I havne't gotten quite right.
>
> I'm sure this is pretty simple for most of you, I just can't quite seem to
> get it.
>
> bmcquill
>
> _______________________________________________
> python-win32 mailing list
> python-win32@python.org
> http://mail.python.org/mailman/listinfo/python-win32
>
>


-- 
_____________________
Ceci n'est pas un email.
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to