python - Tkinter Prior key giving error -


def keypress(self,event):     if event.keysym in self.keys:         # event type 2 key down, type 3 key         self.keys[event.keysym] = event.type == '2'  def looper(self):     if self.keys['up']:         self.canvas.yview_scroll(-2,'units')     if self.keys['down']:         self.canvas.yview_scroll(2,'units')     if self.keys['left']:         self.canvas.xview_scroll(-2,'units')     if self.keys['right']:         self.canvas.xview_scroll(2,'units')     if self.keys['prior']:         p = p -.01         self.draw()     if self.keys['next']:         p = p +.01         self.draw() 

when run program comes error keyerror: prior. want recognize when press pageup/down keys can zoom in/out. without prior/next runs fine , operates should when press up/down/left/right cursor keys.


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -