Re: [python-win32] Using Python and WMI for multiple machines

2008-02-20 Thread Tim Golden
Becky Mcquilling 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. Welcome to Python! I have a text file c:\servernames.txt. I want

[python-win32] Help with COM objs across threads: The object exporter specified was not found

2008-02-20 Thread mauro tizianel
Dear list, I wrote a small class which has some COM objects among its attributes. I need to access the object from different threads so I defined two methods to marshal and unmarshal the interfaces when working with the object. Everything seemed to work fine on my PC, never had an error. But I

[python-win32] Fwd: Using Python and WMI for multiple machines

2008-02-20 Thread Kevin Horn
On Feb 20, 2008 3:04 AM, Tim Golden [EMAIL PROTECTED] wrote: Becky Mcquilling 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.

Re: [python-win32] Help with COM objs across threads: The object exporter specified was not found

2008-02-20 Thread Mark Hammond
I can’t see how this class is used, but it is slightly suspect, in the fact it stores the result of the unmarshal in ‘self.fmProject’ – but there is nothing to prevent other threads from using self.fmProject, which would be an error. Unless something not shown prevents this happening, you need to

Re: [python-win32] error

2008-02-20 Thread Sagar Khushalani
Thanks! Another question, related and random. Someone, anyone? I am trying to implement an MSMQ, and I have no idea whats going wrong. I looked at: http://comsci.liu.edu/~murali/python/python28.txt one of the few places that actually has help with that. I tried to implement it but for some

Re: [python-win32] Fwd: Using Python and WMI for multiple machines

2008-02-20 Thread Graeme Glass
code - untested import wmi servers = open (c:/servernames.txt).read ().splitlines () for server in servers: wmi_connection = wmi.WMI (server) with open (%s-services.log % server, w) as f: for service in wmi_connection.Win32_Service (): f.write (%s\t%s\n %

Re: [python-win32] Fwd: Using Python and WMI for multiple machines

2008-02-20 Thread Graeme Glass
If I am not mistaken, you can use the with statement with python 2.4 from __future__ import with_statement Um, forget that. That is 2.5 like you said. Sorry. Don't have 2.4 installed anymore to test my brain farts before sending them on. *Jedi mind trick* You never saw this mail