'Executes python code directly from the clipboard.'

def OnEditExecClipboard(self, command, code):

    win32clipboard.OpenClipboard()
    try:
        code = win32clipboard.GetClipboardData(win32clipboard.CF_UNICODETEXT)
    finally:
        win32clipboard.CloseClipboard()
    code = (code.replace('\r\n', '\n') + '\n')
    try:
        o = compile(code, '<clipboard>', 'exec')
        exec o in __main__.__dict__
    except:
        traceback.print_exc()
