Monday, June 6, 2011

Re: How to get returned value from python functions in vim scripts ?

Hi,

You can do

import vim

and then use

vim.command("let g:return="+str(value))

This works also with dictionaries and lists (though I've encountered that some
times singe quotes inside value when it is a dictionary or a list may couse
troubles). So I would like to know a better method.

Best,
Marcin


On 12:59 Mon 06 Jun , Alec Tica wrote:
> Hi,
>
> In ruby is something like:
>
> VIM::command("return #{my_ruby_var.inspect}")
>
> I expect to be the same in python.
>
> On Mon, Jun 6, 2011 at 12:43 PM, Lenin <lenin.lee@gmail.com> wrote:
> > Hi,
> > I want to get returned value from python functions in vim scripts, how can I
> > make it ?
> > Thanks
> >
> > --
> > You received this message from the "vim_use" maillist.
> > Do not top-post! Type your reply below the text you are replying to.
> > For more information, visit http://www.vim.org/maillist.php
> >
>
>
>
> --
> talek
>
> --
> You received this message from the "vim_use" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

No comments: