Re: Reaching the real world
"Fuzzyman" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I have a friend who would like to move and program lights and other > electric/electro-mechanical devices by computer. I would like to help - > and needless to say Python would be an ideal language for the > 'programmers interface'. > > What I'd like is an electronic interface that connects to several > relays and a python extension module to switch on and off the relays. > I've had a quick google and can't see anything too similar to what I > want. pyro (python robotics) seems to require expensive (relatively) > robotic equipment. > > Does anyone know anything *similar* to what I have in mind, or have > alternative suggestions ? > Regards, > > Fuzzy > http://www.voidspace.org.uk/python/index.shtml > Take a look at: http://www.geocities.com/hagtronics/pic_das/index.html Very easy to interface to Python. -- http://mail.python.org/mailman/listinfo/python-list
Bug 834351 - Mouse wheel crashes program
Has this bug been fixed in 2.3.5 or 2.4? Does it exist in XP systems?
#-
from Tkinter import *
def _onMouseWheel(event):
print event
root = Tk()
root.bind('',_onMouseWheel)
root.mainloop()
--
http://mail.python.org/mailman/listinfo/python-list
Re: example code sought
"Sean McIlroy" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > There's something quite simple I'd like to do, but I'm hampered by > lack of knowledge regarding Tkinter. If someone could help me out with > a snippet of maximally-simple code showing, in general terms, how to > do this, that would be really great. What I want to do is simply to > move a shape around on the screen using the mouse. I've looked at > Tkdnd.py but I can't seem to extract what I need from the more > involved stuff in there. > > Peace, > STM Use Canvas.move(). Here is some code from a program of mine that may give you an idea of how to go about this. In my case each component consisted of several pieces, each having a unique tag. If they had had the same tag only one move command would have been needed. self.xLast and self.yLast need to be initialized to the current cursor position before the move starts. def onMouseMotion(self, event): x, y = event.x, event.y dx = x - self.xLast dy = y - self.yLast for c in self.selectedComponents: for k in range(c.count): self.canvas.move(c.tags[k], dx, dy) # Move each piece of the component self.xLast, self.yLast = x, y -- http://mail.python.org/mailman/listinfo/python-list
