How to use <Button-4> & <Button-5> to zoom in and out the image in python
Question: 
    def onWheel(event):
       d = event.delta
       if d < 0:
          amt=0.9
       else:
          amt=1.1
          canvas.scale(ALL, 200,200 , amt, amt)
    canvas.bind("<Button-4>&<Button-5>", onWheel)
    canvas.focus_set()
    

Here is my code. I run it in a tkinter window in ubuntu machine. But i can
only zoom in the image. zoom out does not work.I want to zoom in & out the
image by using button-4 & button-5


Answer: Finally I got the answer. Here is my code... I changed the above code as :

    
    
     from Tkinter import *
     root = Tk()
    
     Label(root, text='Zoom in & Zoom out using the Mouse Wheel' ,font('Times',12)).pack()
    
     canvas = Canvas(root, width=400, height=400)
     canvas.pack(fill=BOTH, expand=1)
     canvas.create_rectangle(175,175,225,225,fill='blue')
    
     def zoomin(event):
       d = event.delta
       if d < 0:
          amt=0.9
       else:
          amt=1.1
    
       canvas.scale(ALL, 200,200 , amt,amt)
     canvas.bind("<Button-4>", zoomin)
    
     def zoomout(event):
       d = event.delta
       if d >0:
          amt=1.1
       else:
          amt=0.9
       canvas.scale(ALL, 200,200 , amt, amt)
     canvas.bind("<Button-5>", zoomout)
     canvas.focus_set()
     root.mainloop()
    

