Alec: It seems :py vim.command('return 1') will throw an error that says
"return not inside a function".

Marcin: Yes, I am using vim variables to transfer values from python
functions currently, but I think this method is ugly, I'd like to know a
better solution.

Thank you both.

2011/6/6 Marcin Szamotulski <[email protected]>

> 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 <[email protected]> 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
>

-- 
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

Reply via email to