On Mar 29, 10:02 pm, Hari <[email protected]> wrote:
> Hello All,
>
> Is there a reverse equivalent of this? I'm trying to see if I can
> avoid writing my custom routines to take python lists and dictionaries
> and convert them to vim lists and dictionaries.
This can be done via vim.command('let ...'). Obviously, will not work
with every kind of Python strings: cannot use unicode or raw strings,
quotes and backslashes could be a problem.
python << EOF
import vim
pyList = [1,2,3,'blah']
pyDict = {1:3, 'bleh':77}
vim.command('let vimList = %s' %repr(pyList))
vim.command('let vimDict = %s' %repr(pyDict))
EOF
echo vimList
echo vimDict
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---