how to bind keyboard keys to menu items? i know to bind with mouse buttons but with keybooard keys dont know.
for eg: Cntl+O to open a file in File menu.

how to implement undo, redo, find, find again, copy, paste functions in python. i actually gone through the, which is shipped with python package, but it is such big code i couldnt trace it. can any body breif about how implement this in python?

please help me out.

I hope you are talking about Tkinter as GUI. This code might help you. You have to use a if statements to get the right key value to go to the proper function then.

# bind and show a key event with Tkinter 

from Tkinter import *

root = Tk()
prompt = '      Press any key      '
label1 = Label(root, text=prompt, width=len(prompt))

def key(event):
    if event.char == event.keysym:
        msg = 'Normal Key %r' % event.char
    elif len(event.char) == 1:
        msg = 'Punctuation Key %r (%r)' % (event.keysym, event.char)
        msg = 'Special Key %r' % event.keysym

label1.bind_all('<Key>', key)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.