I would like to insert some Python-generated text at the current cursor position in insert mode using the Vim Python interface. The closest I have so far is:
imap <c-x><c-r> <c-o>:python vim.current.line += "trivial example"
This will append "trivial example" rather than put it at the current position. How can I insert the text at the cursor instead?