Re: [python-win32] Dispatches With Events on COM Object

2006-08-04 Thread Neil Benn
Mark Hammond wrote: >> print dir(mod) >> ob = mod.Application >> > > Try adding parens after that line - currently 'ob' is the class, where you > want an instance of the class. > > ob = mod.Application() > > Ah good point, I put back in the brackets (doh!) and I am now back to the previou

Re: [python-win32] sleep() for less than .001s?

2006-08-04 Thread Gabriel Genellina
At Thursday 3/8/2006 22:45, Ray Schumacher wrote: I have been trying to use sleep() and kernel32.QueryPerformanceCounter together; I want to delay until a particular tick without trying up the CPU badly. However, while time.sleep(.001) relieves the CPU, it has wildly unpredictable delay, and s

Re: [python-win32] OLE Server Busy dialog box

2006-08-04 Thread Diogo
> Unless you are using the win32ui module, its unlikely you qualify as an "MFC > COM client". I'm not using the win32ui. And this makes me wonder I would get this box. > | Another way to suppress the server busy dialog box is to use > | OleInitialize and OleUninitialize instead of AfxOleInit in y

Re: [python-win32] sleep() for less than .001s?

2006-08-04 Thread RayS
At 02:59 AM 8/4/2006, Gabriel Genellina wrote: >I'm not sure if this really works, but you could try: >- Raise your thread/process's priority using SetPriorityClass or >SetThreadPriority. This is to minimize the (unpredictable) delay of sleep() I do launch the module with CreateProcess with RealT

Re: [python-win32] sleep() for less than .001s?

2006-08-04 Thread Tim Roberts
Ray Schumacher wrote: > I have been trying to use sleep() and kernel32.QueryPerformanceCounter > together; I want to delay until a particular tick without trying up > the CPU badly. > However, while time.sleep(.001) relieves the CPU, it has wildly > unpredictable delay, and sleep(.0001) delays alm

Re: [python-win32] sleep() for less than .001s?

2006-08-04 Thread Ray Schumacher
In the attached test code, I get - for test in [0, .1, .01, .001, .1] seconds # 2.9us hi 5.2us low, # 110ms hi and low, # 16ms hi and low, # 16ms hi and low, # 2.9us hi 5.2us low Intestingly, if I un-comment the #print '\r', then the processor usage drops by ~1

Re: [python-win32] sleep() for less than .001s?

2006-08-04 Thread Ray Schumacher
At 10:29 AM 8/4/2006, Tim Roberts wrote: Ray Schumacher wrote: > I have been trying to use sleep() and kernel32.QueryPerformanceCounter > together; I want to delay until a particular tick without trying up > the CPU badly. > However, while time.sleep(.001) relieves the CPU, it has wildly > unpred

Re: [python-win32] sleep() for less than .001s?

2006-08-04 Thread Tim Roberts
Ray Schumacher wrote: >In the attached test code, I get - for test in [0, .1, .01, .001, .1] >seconds > ># 2.9us hi 5.2us low, ># 110ms hi and low, ># 16ms hi and low, ># 16ms hi and low, ># 2.9us hi 5.2us low > >Intestingly, if I un-comment the >#print '\r', >t

Re: [python-win32] sleep() for less than .001s?

2006-08-04 Thread Ray Schumacher
At 11:01 AM 8/4/2006, Tim Roberts wrote: >What surprises you? The Win32 Sleep() function takes integer >milliseconds. Thus, .1 will round to 0, which says "give up the CPU >only if a higher-priority task is waiting.". > >The default scheduling interval on your system is 16ms. Some Windows

Re: [python-win32] Dispatches With Events on COM Object

2006-08-04 Thread Mark Hammond
> Ah good point, I put back in the brackets (doh!) and I am now back to > the previous place: > > mod = > gencache.EnsureModule('{A4818FD5-6479-11D4-8452-00104B92DD56}', 0, > 1, 0) > print dir(mod) > ob = mod.Application() > print dir(ob) > objCybio = win32com.client.DispatchWithEvents(ob, CybioEve

[python-win32] Need help with converting a simple Excel macro

2006-08-04 Thread kc106_2005-pywin32
Hi list, I have a need to copy 3 rows of data from the top of my Excel spreadsheet to another location. I would have throught that this should be very straightforward since I've done a fair amount of Excel/Python programming. Unforturnately, I am stuck on this one. The VB Macro says I need to:

[python-win32] Re: Need help with converting a simple Excel macro

2006-08-04 Thread Roger Upole
> Hi list, > > I have a need to copy 3 rows of data from the top of > my Excel spreadsheet to another location. I would > have throught that this should be very straightforward > since I've done a fair amount of Excel/Python > programming. Unforturnately, I am stuck on this one. > > The VB Macr