RE: The devolution of English language and slothful c.l.p behaviors exposed!

2012-01-24 Thread Neru Yume

Wh. I did not expect this when I signed up to the Python mailing list.

> From: dreadpiratej...@gmail.com
> Date: Tue, 24 Jan 2012 09:51:57 -0500
> Subject: Re: The devolution of English language and slothful c.l.p behaviors  
> exposed!
> To: martin.hell...@gmail.com
> CC: python-list@python.org
> 
> On Tue, Jan 24, 2012 at 09:05, Martin P. Hellwig
>  wrote:
> > On 24/01/2012 05:57, Rick Johnson wrote:
> > 
> > I would wish that pedantic citizens of the British colony in America stopped
> > calling whatever misinterpreted waffle they produce, English.
> 
> I, sir, as a citizen of that FORMER British colony here on the
> continent of North America, am offended by this baseless insult. I
> know waffles, sir, I eat waffles and I can guarantee that no American
> calls their waffles "English".  We have English Muffins and Belgian
> Waffles, but no English Waffles.  Though I am particularly fond of
> Blueberry Waffles, myself.
> 
> Which reminds me, time for breakfast.
> 
> Cheers,
> 
> Jeff
> -- 
> http://mail.python.org/mailman/listinfo/python-list
  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: Learn Technical Writing from Unix Man in 10 Days

2012-04-29 Thread Neru Yume

I did not sign up for this. ;_;

  -- 
http://mail.python.org/mailman/listinfo/python-list


PyHook to catch mouse events

2012-01-23 Thread Neru Yume

Using PyHook to record mouse events, one has to add quite a few lines to set up 
a hook, and as far as I have experienced, if one uses time.sleep() or some 
other function that spends some time doing something, the program freezes my 
computer completely while doing this (the cursor starts moving slowly, and so 
on).


Also: Ctrl+c does not work, I have to click the cross to exit the program, 
which is horrible when combined with the freezing mentioned earlier.


Is there a way to avoid the program freezing up? Using the win32api somehow, 
rather than PyHook? (I only know how to generate input with win32api, not catch 
output).


import pythoncom, pyHook
class record(object):
def OnMouseEvent(self, event):
print 'MessageName:',event.MessageName
print 'Message:',event.Message
print 'Time:',event.Time
print 'Window:',event.Window
print 'WindowName:',event.WindowName
print 'Position:',event.Position
print 'Wheel:',event.Wheel
print 'Injected:',event.Injected
print '---'
#time.sleep(1) #If I uncomment this, running the program will freeze stuff, as 
mentioned earlier.
return True

recordit = record()
hm = pyHook.HookManager()
hm.MouseAll = recordit.OnMouseEvent
hm.HookMouse()
pythoncom.PumpMessages()

  -- 
http://mail.python.org/mailman/listinfo/python-list


RE: PyHook to catch mouse events

2012-01-23 Thread Neru Yume

> Date: Mon, 23 Jan 2012 08:24:41 -0500
> From: d...@davea.name
> To: neruy...@hotmail.com
> CC: python-list@python.org
> Subject: Re: PyHook to catch mouse events
> 
> On 01/23/2012 07:06 AM, Neru Yume wrote:
> > Using PyHook to record mouse events, one has to add quite a few lines to 
> > set up a hook, and as far as I have experienced, if one uses time.sleep() 
> > or some other function that spends some time doing something, the program 
> > freezes my computer completely while doing this (the cursor starts moving 
> > slowly, and so on).
> >
> >
> > Also: Ctrl+c does not work, I have to click the cross to exit the program, 
> > which is horrible when combined with the freezing mentioned earlier.
> >
> >
> > Is there a way to avoid the program freezing up? Using the win32api 
> > somehow, rather than PyHook? (I only know how to generate input with 
> > win32api, not catch output).
> >
> >
> > import pythoncom, pyHook
> > class record(object):
> >  def OnMouseEvent(self, event):
> >  print 'MessageName:',event.MessageName
> >  print 'Message:',event.Message
> >  print 'Time:',event.Time
> >  print 'Window:',event.Window
> >  print 'WindowName:',event.WindowName
> >  print 'Position:',event.Position
> >  print 'Wheel:',event.Wheel
> >  print 'Injected:',event.Injected
> >  print '---'
> > #time.sleep(1) #If I uncomment this, running the program will freeze stuff, 
> > as mentioned earlier.
> >  return True
> >
> > recordit = record()
> > hm = pyHook.HookManager()
> > hm.MouseAll = recordit.OnMouseEvent
> > hm.HookMouse()
> > pythoncom.PumpMessages()
> >
> This is the nature of event-driven systems.  When you hook into the 
> Windows system, you're expected to carve your event handlers into 
> something quick.  For normal Python gui programming, breaking the rule 
> will only affect your own program.  Pyhook just does the same thing on a 
> system-wide scale.
> 
> 
> Are you sure you need global events at all?
> 
> If you want to do useful work in response to particular global mouse 
> events, you'll have to arrange to get control some other way.  Normally 
> this is done by posting pseudo-events in your process's message queue, 
> so you'll get control again, and can continue working on the problem.  I 
> don't know the specific details for pyhook, since I don't run Windows 
> any more, and pyhook is not part of Python itself.
> 
> 
> -- 
> 
> DaveA
> 



I do need global events, yes - I am not using any particular GUIs at the moment 
but rather trying to record mouse paths (not limited to one window).


Not very familiar with message queues of processes. 
  -- 
http://mail.python.org/mailman/listinfo/python-list