On 07. 06. 2011 13:39, Tony Mechelynck wrote:
> On 07/06/11 09:31, Marko Mahnič wrote:
>> On Jun 7, 9:26 am, Marko Mahnič<[email protected]>  wrote:
>>> On Jun 7, 8:36 am, Ivan Krasilnikov<[email protected]>  wrote:
>>>
>>> function s:MyCallback(param)
>>>     " process
>>> endfunc
>>> python DoSomething(s:SNR . 'MyCallback', ...)
>>
>> This should probably be:
>>     exec "python DoSomething(\"" . s:SNR . "MyCallback\", ...)"
>>
>> Marko
>>
> 
> This last one cannot be right: as a minimum, it lacks a backslash left 
> of "MyCallback".
>

If you keep the quotes and backsalshes, but change the rest you can write (
s:SNR -> getcwd(), MyCallback -> /. ) :

  :python import os
  :exec "python print os.path.exists(\"" . getcwd() . "/.\")"

which works for me (Vim 7.3). If getcwd() returns "/home/user", the generated
Python statement is:

  print os.path.exists("/home/user/.")

In the above case you would get the Python statement:

  DoSomething("32_MyCallback", ...)


Marko

> Best regards,
> Tony.

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