[python-win32] EnsureDispatch throwing fatal error

2011-03-30 Thread Jiawei Li
I am running the following line of code: iTunes = win32com.client.gencache.EnsureDispatch('iTunes.Application') This results in this error: Traceback (most recent call last): File "Helper.py", line 154, in File "win32com\client\gencache.pyo", line 529, in EnsureDispatch File "win32com\cli

Re: [python-win32] Using Flexible Win32 message pump to monitor window open/close for all application?

2011-03-30 Thread Tim Roberts
reckoner wrote: > Which is listed in the Python cookbook, second edition. Is it possible > to use this to monitor the open/close of different windows? Basically, I > would like to trigger an action for a specific window or handle when > that window class or handle opens/closes. Can this recipe h

[python-win32] Using Flexible Win32 message pump to monitor window open/close for all application?

2011-03-30 Thread reckoner
Hi, I have been looking at the following recipe: Recipe 82236: Flexible Win32 message pump using MsgWaitForMultipleObjects (Python) http://code.activestate.com/recipes/82236-flexible-win32-message-pump-using-msgwaitformultip Which is listed in the Python cookbook, second edition. Is it possib

Re: [python-win32] win32pdhutil failing on counters with a "/"

2011-03-30 Thread Jeffrey Melloy
Duplicating the function and calling CollectQueryData seems to fix it. XP must interpolate the time-series data differently than Windows 7. On Wed, Mar 30, 2011 at 11:07 AM, Jeffrey Melloy wrote: > It gives that error every time.  My script runs through these in a loop. > > I'm using Windows 7,

Re: [python-win32] win32pdhutil failing on counters with a "/"

2011-03-30 Thread Jeffrey Melloy
It gives that error every time. My script runs through these in a loop. I'm using Windows 7, Python 2.6, and I updated to build 216 of py-win32 this morning. (Though is there a good way to get what version you're using from Python? __version__ isn't there.) I get that if I'm working remotely or

Re: [python-win32] win32pdhutil failing on counters with a "/"

2011-03-30 Thread Tim Roberts
Jeffrey Melloy wrote: > My script to parse perfmon data is working correctly, however, when I > have a counter name with "/" in it, it seems to throw an error in > GetFormattedData. > > Has anyone seen this before? Do you get this every time, or only the first time you run it? There was one messa

[python-win32] win32pdhutil failing on counters with a "/"

2011-03-30 Thread Jeffrey Melloy
My script to parse perfmon data is working correctly, however, when I have a counter name with "/" in it, it seems to throw an error in GetFormattedData. Has anyone seen this before? import win32pdhutil machine = "seaweb001p" object = "Memory" counters, instances = win32pdh.EnumObjectItems(

Re: [python-win32] pyconfig.h: conflicting definitions for ssize_t

2011-03-30 Thread Tim Roberts
Mark Hammond wrote: > On 30/03/2011 11:01 AM, Tim Roberts wrote: >> Wolfgang Rohdewald wrote: >> I agree with your conclusion. However, this isn't a Python-Win32 >> issue. You need to file a bug report against Python itself. > it would be good to know exactly what vs2008 says about this - if it

Re: [python-win32] Clear the interactive screen

2011-03-30 Thread Blockheads Oi Oi
On 27/03/2011 07:53, Mark Hammond wrote: Try something like: from pywin.framework import interact interact.edit.currentView.SetSel(0, -1) interact.edit.currentView.Clear() Try the above three lines from the interactive prompt and nothing that I can see happens. Try the last two lines on a si

Re: [python-win32] pyconfig.h: conflicting definitions for ssize_t

2011-03-30 Thread Wolfgang Rohdewald
On Mittwoch 30 März 2011, Mark Hammond wrote: > On 30/03/2011 11:01 AM, Tim Roberts wrote: > > Wolfgang Rohdewald wrote: > > I agree with your conclusion. However, this isn't a > > Python-Win32 issue. You need to file a bug report against > > Python itself. > > it would be good to know exactly w

Re: [python-win32] pyconfig.h: conflicting definitions for ssize_t

2011-03-30 Thread Mark Hammond
On 30/03/2011 11:01 AM, Tim Roberts wrote: Wolfgang Rohdewald wrote: I agree with your conclusion. However, this isn't a Python-Win32 issue. You need to file a bug report against Python itself. it would be good to know exactly what vs2008 says about this - if it uses 'int' we will need to ta